Skip to content

Commit

Permalink
Merge pull request #1308 from canalplus/feat/reload-keySystems
Browse files Browse the repository at this point in the history
Add the possibility to set a new `keySystems` option on the `reload` API
  • Loading branch information
peaBerberian committed Jan 15, 2024
2 parents d1fde0d + cd9ff08 commit 6035e70
Show file tree
Hide file tree
Showing 546 changed files with 19,900 additions and 80,076 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"project": "tsconfig.eslint.json",
"sourceType": "module"
},
"plugins": [
Expand Down Expand Up @@ -328,6 +328,15 @@ module.exports = {
"prefer-template": "off",
"no-restricted-properties": [
"error",
{
"object": "performance",
"property": "now",
"message": "Avoid using `performance.now` directly as timestamps may be different in the worker and the main thread. Please use the `getMonotonicTimeStamp` util instead.",
},
{
"object": "window",
"message": "`window` doesn't work in Node.JS and only works when JavaScript is running in the main thread. Please import `globalScope` instead.",
},
{
"object": "Object",
"property": "assign",
Expand Down
69 changes: 21 additions & 48 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [opened, synchronize, reopened]

jobs:
check:
typechecking_and_linting:

runs-on: ubuntu-latest

Expand All @@ -28,6 +28,24 @@ jobs:
cache: 'npm'
- run: npm install
- run: npm run check

unit_tests:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run test:unit

integration_linux:
Expand All @@ -49,53 +67,8 @@ jobs:
# needed for integration & memory tests codecs support
- run: sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y ubuntu-restricted-extras
- run: npm install
- run: npm run build
# Firefox seems to have issue with integration tests on GitHub actions only
# TODO to check
- run: node tests/integration/run.js --bchromehl
- run: node tests/integration/run.mjs --bchromehl
- run: npm run test:memory

# Windows seems to be a lot less stable for some reason.
# TODO debug?
# integration_windows:

# runs-on: windows-latest

# strategy:
# matrix:
# node-version: [16.x]
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'
# - run: npm install
# # Firefox seems to have issue with integration tests on GitHub actions only
# # TODO to check
# - run: node tests/integration/run.js --bchromehl
# - run: npm run test:memory

# MacOS seems to be a lot less stable for some reason.
# TODO debug?
# integration_macos:

# runs-on: macos-latest

# strategy:
# matrix:
# node-version: [16.x]
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'
# - run: npm install
# - run: npm run test:integration:gh-actions
# - run: npm run test:memory
2 changes: 1 addition & 1 deletion .github/workflows/perfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- run: npm install
- run: export DISPLAY=:99
- run: sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- run: node tests/performance/run.js
- run: node tests/performance/run.mjs
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
/tests/performance/package.json
/tests/performance/package-lock.json

/dist/_esm5.processed
/dist/_esm5.raw
/dist/

/doc/generated

Expand All @@ -36,4 +35,6 @@

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

# IDE files
/.idea
/.vscode
208 changes: 207 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ 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
release.

Two directories, namely ``_esm5.raw`` and ``_esm5.processed`` can also be
generated in here if the right scripts are called.
Directories can also be generated in here if the right scripts are called.
These allow to publish more modular codebases to npm.


Expand Down Expand Up @@ -128,7 +123,6 @@ What is exported there are functions to load:
- Manifests/MPDs
- video/audio segments
- subtitles tracks
- image tracks

For different streaming technologies.

Expand Down
60 changes: 2 additions & 58 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 All @@ -205,31 +195,6 @@ npm install
```


### Build ######################################################################

We use npm scripts to bundle, lint and test the player. Here are some examples:
```sh
# build the player in dist/rx-player.js
npm run build

# lint the code in src/ with eslint
npm run lint

# launch the demo on a local server (http://127.0.0.1:8000)
npm run start

# launch our test suite on various browsers
npm run test

# list all available npm scripts
npm run list
```

Builds are included in the ``dist/`` directory (builds based on the last version
are already included there).



## Why a new player? ###########################################################

### A need for an advanced media player ########################################
Expand All @@ -238,7 +203,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 +214,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 +261,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.32.1
4.0.0-beta.3
15 changes: 11 additions & 4 deletions demo/full/scripts/components/BufferContentGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import * as React from "react";
import type { IRepresentation } from "../../../../src/public_types";
import type {
IAudioRepresentation,
IVideoRepresentation,
} from "../../../../src/public_types";
import capitalizeFirstLetter from "../lib/capitalizeFirstLetter";
import shuffleArray from "../lib/shuffleArray";
import type { IBufferedData } from "../modules/player/index";
import ToolTip from "./ToolTip";

type IRepresentation = IAudioRepresentation | IVideoRepresentation;

const {
useEffect,
useMemo,
Expand Down Expand Up @@ -258,12 +263,14 @@ export default function BufferContentGraph({

let newTipText = "";
switch (adaptation.type) {
case "video":
newTipText += `width: ${representation.width ?? "?"}` + "\n" +
`height: ${representation.height ?? "?"}` + "\n" +
case "video": {
const rep = representation as IVideoRepresentation;
newTipText += `width: ${rep.width ?? "?"}` + "\n" +
`height: ${rep.height ?? "?"}` + "\n" +
`codec: ${representation.codec ?? "?"}` + "\n" +
`bitrate: ${representation.bitrate ?? "?"}` + "\n";
break;
}
case "audio":
newTipText += `language: ${adaptation.language ?? "?"}` + "\n" +
`audioDescription: ${
Expand Down
58 changes: 0 additions & 58 deletions demo/full/scripts/components/ImageThumbnail.tsx

This file was deleted.

Loading

0 comments on commit 6035e70

Please sign in to comment.