Skip to content

Commit

Permalink
Merge pull request #1241 from canalplus/feat/track-info-on-media-error
Browse files Browse the repository at this point in the history
Add `trackInfo` property to some `MediaError`
  • Loading branch information
peaBerberian committed Jan 23, 2024
2 parents 88953e3 + 8ba6413 commit 5531dee
Show file tree
Hide file tree
Showing 323 changed files with 52,568 additions and 46,349 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@

/src/parsers/manifest/dash/wasm-parser/target

# IDE files
/.idea
/.vscode
89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,94 @@
# Changelog

## Unreleased

### Features

- Add `getLivePosition` RxPlayer method [#1300]
- Add `startAt.fromLivePosition` `loadVideo` option [#1300]
- Add the possibility to set a new `keySystems` option on the `reload` API [#1308]

### Bug fixes

- Fix subtitles "blinking" in some specific conditions, especially with some DASH low-latency contents [#1314]
- DASH: Fix Period overlap resolution logic for when the first Period is removed [#1311]
- TTML: Fix handling of the `tts:lineHeight` attribute [#1320]
- Fix import of the `LOCAL_MANIFEST` experimental feature
- Avoid very rarely skipping segments which initially were too big to be pushed due to memory limitations [#1323]
- Fix issue arising when using track APIs at the exact last possible position of a Period with no consecutive Period [#1337]
- Starting at the end (through a `startAt` `loadVideo` option) or reloading at the end led to the restart of the content [#1338]
- DRM/Safari: also perform Safari DRM work-arounds when the page is launched from the dock [#1351, #1356]

### Other improvements

- DASH: rely on SCTE214 `supplementalCodecs` instead of `codecs` if it's supported to better support backward compatible Dolby Vision contents [#1307]
- DASH: Provide better support of the `availabilityTimeOffset` attribute [#1300]
- DEBUG_ELEMENT: Add unsupported and undecipherable bitrates to the debug element [#1321]
- DEBUG_ELEMENT: update buffer graph maximum size so it becomes more readable for lengthy contents [#1316]
- DEBUG_ELEMENT: always synchronize inventory of segments before rendering it [#1317]
- Remove remaining RxPlayer dependency removing possibility of some application-side bundling errors [#1312]
- Add exception to text Garbage collection logic to avoid unnecessarily reload text segments frequently [#1325]
- Avoid logging too much the buffer's content when our debugging UI or the demo is used [#1341]
- Demo: Fix reporting of live position in demo page [#1313]


## v3.32.1 (2023-10-19)

### Features

- DASH: add optional `isSpatialAudio` boolean property to Representation returned by `getAvailableAudioTracks`, `getAudioTrack`, corresponding events, and `trackInfo` optional property of `MediaError` objects to signal Dolby Atmos techology [#1275]
- `LOCAL`: add `isSpatialAudio` property to Representation of the experiment `"local"` transport (used for offline playback) [#1275]
- `addFeatures` static method is now available on all RxPlayer builds. It was previously only in the minimal (`rx-player/minimal` import path) [#1287]
- The `NATIVE_TEXT_BUFFER`, `HTML_TEXT_BUFFER` and `IMAGE_BUFFER` features are now totally optional [#1287, #1293]

### Bug fixes

- Fix `setVideoBitrate` and `setAudioBitrate` API which may have led to a higher quality than wanted in the default `"seamless"` `manualBitrateSwitchingMode` if our buffer-based adaptive logic decided to [#1267, #1271]
- On the PlayStation 5, only switch to the `"LOADED"` state once the HTMLMediaElement's `readyState` of `4` has been reached, as it seems to switch to `3` too soon there [#1257]
- DASH: Fix potential track duplication if more than two `AdaptationSet` have an `adaptation-set-switching` `<SupplementalProperty>` between one another [#1279]
- DASH-WASM: availabilityTimeOffset is actually a floating number [#1278]

### Other improvements

- Do not load the last text segment if the current position goes after it as it is unnecessary [#1256]
- Implement better `NetworkError` messages [#1274]
- Set a better error message for when no `keySystems` option is set when playing an encrypted content
- Fix very small memory leak when reloading a content [#1286]
- Re-check for segments to load immediately after the manifest has been refreshed [#1282]
- When "fallbacking" an undecipherable Representation, now empty the whole buffer if we can't make out where content was in the buffer [#1283]
- Improve segment start detection in buffer when there's unknown data buffered before it [#1284]
- DRM: Selection of alternative EME API like those used on IE11 or Safari has been refactored to facilitate future developments [#1261]

### Deprecated

- Deprecate the `manifestUpdateUrl` `loadVideo` option as it doesn't seem used anymore [#1288]
- Deprecate the `NATIVE_TEXT_BUFFER`, `HTML_TEXT_BUFFER` and `IMAGE_BUFFER` features as they are now unneeded [#1287, #1293]


## v3.31.0 (2023-06-14)

### Features

- Add `isContentLoaded`, `isBuffering`, `isPaused`, and `getLastStoredContentPosition` methods [#1248]
- Add `play` and `paused` events [#1253]
- Add `trackInfo` property to some `MediaError` to expose information on the track that caused the error [#1241]

### Bug fixes

- DASH: Fix issue which could lead to infinite rebuffering when switching between multiple Periods [#1232]
- Return actual ending duration through the `getVideoDuration` method when playing dynamic contents whose future end is already known [#1235]
- DASH/WASM: actually reject the `DASH_WASM.initialize`'s Promise if it fails [#1238]
- On the PlayStation 5, set `Infinity` MediaSource duration for live contents to prevent playback issues [#1250]

### Other improvements

- adaptive: Perform various adaptive tweaks to avoid switching too much between qualities in some conditions [#1237]
- Directfile: Detect "forced" subtitles on Safari when playing directfile contents (such as HLS) [#1239]
- Improve `"direct"` `audioTrackSwitchingMode` compatibility by re-seeking [#1246]
- The `DEBUG_ELEMENT` feature now uses the `monospace` fallback font as a default for a better rendering on apple devices
- doc: externalize documentation-generator code


## v3.30.0 (2023-03-07)

### Features
Expand Down
40 changes: 27 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,39 @@ Those have to follow the conventions defined below.



## Reading the current code
## Important code concepts

Even if we hope the current code is straightforward, readable and commented
enough we can still admit that going blind into the codebase can be hard at
first as this is a pretty big technical project on a specific matter.
### Code documentation

We thus encourage you to rely on the architecture documentation you can usually
find alongside the code, in `README.md` files.
You can for example start by reading `src/README.md`, to have a clearer idea
of the general code architecture of the player.
We try to put `README.md` files inside every significant directories inside
`/src` to provide a global architecture documentation of that directory
specifically.

You can try to start understanding a piece of RxPlayer code by navigating
to that file. Understand that the documented behavior may be out of date
(in which case you're welcome to update it or open an issue) though even in
that case, it is a good starting point to understand the directory's role.
Likewise, don't forget to update it if a change you made to the code
necessitates a documentation change.

Also, for a more exhaustive approach to the documentation of the project's file
organization, you can look at [`FILES.md`](./FILES.md).

The code of the RxPlayer being heavily modularized, you should not need to read
the whole documentation to be ready, only the parts you want to update
(hopefully!).
### When renaming or deleting functions, classes or variables

When Refactoring/Renaming, make sure to grep any of the renamed class / function
/ variable's name as they may also be referenced in documentation and code
comments. Same thing for a directory or file name.

If the name is hard to grep (e.g. the name is too generic and thus has too many
false positives), you can generally reduce the area to comments in the same file
and documentation files in the same directory.

### `features` object

Some files should not be imported directly but only be accessed by going through
the `features` object exported at `/src/features`. This is to reduce bundle size
when an application doesn't need all of the RxPlayer's features.



Expand All @@ -53,8 +69,6 @@ directory) by calling `npm run lint:tests`.

### Types

#### General TypeScript rules

We try to be as strict as possible with types:

- the `any` type should be avoided
Expand Down
2 changes: 1 addition & 1 deletion FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ At the time of writing, there are two distinct demos:

## `dist/`: Builds

The `demo/` directory stores the player builds of the last version released.
The `dist/` directory stores the player builds of the last version released.

Contains the minified (``rx-player.min.js``) and the non-minified files
(``rx-player.js``). Both are automatically generated with scripts at every new
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RxPlayer-related question or to propose new features.
Here is the list of current maintainers:

- Paul Berberian <[email protected]>
- Florent Bouisset <[email protected]>


## Previous maintainers ########################################################
Expand Down
35 changes: 2 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,11 @@ Demo pages for our previous versions are also available



## Your questions ##############################################################

You can ask directly your questions about the project on [our
gitter](https://gitter.im/canalplus/rx-player).
We will try our best to answer them as quickly as possible.



## Contribute ##################################################################

Details on how to contribute is written in the [CONTRIBUTING.md
file](./CONTRIBUTING.md) at the root of this repository.

If you need more information, you can contact us via our [gitter
room](https://gitter.im/canalplus/rx-player).


### Dependencies ###############################################################
Expand Down Expand Up @@ -238,7 +228,7 @@ Canal+ Group is a media company with many advanced needs when it comes to media
playback: it provides both live and VoD stream with multiple encryption
requirements, supports a very large panel of devices and has many other
specificities (like adult content restrictions, ad-insertion, Peer-To-Peer
integration...).
integration, low-latency live streaming...).

When the time came to switch from a plugin-based web player approach to an HTML5
one back in 2015, no media player had the key features we wanted, and including
Expand All @@ -249,7 +239,7 @@ The R&D department of Canal+ Group thus started to work on a new featureful
media-player: the RxPlayer. To both help and profit from the community, it also
decided to share it to everyone under a permissive open-source licence.

Now, more than 6 years later, the RxPlayer continues to evolve at the same fast
Now, more than 8 years later, the RxPlayer continues to evolve at the same fast
pace to include a lot of features and improvements you may not find in other
media players.
You can look at our
Expand Down Expand Up @@ -296,24 +286,3 @@ them. Amongst those:
risks always low.

\* In "directfile" mode, on compatible browsers


## Target support ##############################################################

Here is a basic list of supported platforms:

| | Chrome | IE [1] | Edge | Firefox | Safari | Opera |
|-------------|:-------:|:-------:|:------:|:---------:|:--------:|:-------:|
| Windows | >= 30 | >= 11 | >= 12 | >= 42 | >= 8 | >= 25 |
| OSX | >= 30 | - | - | >= 42 | >= 8 | >= 25 |
| Linux | >= 37 | - | - | >= 42 | - | >= 25 |
| Android [2] | >= 30 | - | - | >= 42 | - | >= 15 |
| iOS | No | - | - | No | No | No |

[1] Only on Windows >= 8.

[2] Android version >= 4.2

And more. A good way to know if the browser should be supported by our player is
to go on the page https://www.youtube.com/html5 and check for "Media Source
Extensions" support.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.30.0
3.32.1
24 changes: 0 additions & 24 deletions appveyor.yml

This file was deleted.

1 change: 0 additions & 1 deletion demo/full/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<link rel="stylesheet" href="styles/style.css" media="screen">
<link rel="icon" type="image/x-icon" href="plus.ico" />
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<title>RxPlayer - CANAL+</title>
</head>
<body>
Expand Down
61 changes: 61 additions & 0 deletions demo/full/scripts/components/GitHubButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import * as React from "react";
import { render } from "github-buttons";

const {
useEffect,
useRef,
} = React;

const GitHubButton = ({
href,
ariaLabel,
dataColorScheme = "dark_high_contrast",
dataIcon,
dataShowCount,
dataSize = "large",
dataText,
title,
children,
}: {
href: string;
ariaLabel?: string;
dataColorScheme?: string;
dataIcon?: string;
dataShowCount?: boolean | string;
dataSize?: string;
dataText?: string;
title?: string;
children?: React.ReactNode;
}): JSX.Element => {
const aRef = useRef<HTMLAnchorElement>(null);

useEffect(() => {
const aElement = aRef.current;
if (aElement !== null) {
render(
aElement,
newA => aElement?.parentNode?.replaceChild(newA, aElement),
);
}
});

return (
<span className="button-gh">
<a
ref={aRef}
href={href}
aria-label={ariaLabel}
data-icon={dataIcon}
data-color-scheme={dataColorScheme}
data-show-count={dataShowCount}
data-size={dataSize}
data-text={dataText}
title={title}
>
{children}
</a>
</span>
);
};

export default GitHubButton;
Loading

0 comments on commit 5531dee

Please sign in to comment.