Skip to content

Commit

Permalink
Rename option into renewMediaKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Sep 6, 2024
1 parent 3fdedf5 commit ff14e9a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
21 changes: 11 additions & 10 deletions doc/api/Decryption_Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,20 @@ Note that if setting that property to `true` fixes your issue, it may be that it
the [`maxSessionCacheSize`](#maxsessioncachesize) which is for now too high.

However if your problem doesn't disappear after setting `closeSessionsOnStop` to `true`,
you may try [`renewMediaKeys`](#renewmediakeys) next.
you may try [`reuseMediaKeys`](#renewmediakeys) next.

### renewMediaKeys
### reuseMediaKeys

If `true`, we will create a new `MediaKeys` instance (a JavaScript object needed to
decrypt contents) if needed for that content.
If set to `true` or if not set, we might rely on the previous `MediaKeys` if a compatible
one is already set on the media element, allowing to potentially speed-up content
playback.

If `false` or if not set, we might rely on the previous `MediaKeys` if a compatible one is
already set on the media element, allowing to potentailly speed-up content playback.
If set tot `false`, we will create a new `MediaKeys` instance (a JavaScript object needed
to decrypt contents) if needed for that content.

We noticed that reusing a previous MediaKeys had led to errors on a few devices. For
We noticed that reusing a previous `MediaKeys` had led to errors on a few devices. For
example some smart TVs had shown errors after playing several encrypted contents, errors
which disappeared if we "renewed" the `MediaKeys` for each content.
which disappeared if we renewed the `MediaKeys` for each content.

We should already be able to detect most of those cases in the RxPlayer logic. However, it
is still possible that we don't know yet of a device which also has problem with that
Expand All @@ -283,8 +284,8 @@ If you have issues appearing only after playing multiple encrypted contents:
If that second option doesn't seem to have an effect, you can just set
`closeSessionsOnStop`.

- If none of the precedent work-arounds work however, you can try setting `renewMediaKeys`
to `true`. If it fixes your problem, please open an RxPlayer issue so we can add your
- If none of the precedent work-arounds work however, you can try setting `reuseMediaKeys`
to `false`. If it fixes your problem, please open an RxPlayer issue so we can add your
device to our list.

### singleLicensePer
Expand Down
2 changes: 1 addition & 1 deletion src/main_thread/decrypt/get_media_keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default async function getMediaKeysInfos(
const persistentSessionsStore = createPersistentSessionsStorage(options);

if (
evt.value.options.renewMediaKeys !== true &&
evt.value.options.reuseMediaKeys !== false &&
canReuseMediaKeys() &&
currentState !== null &&
evt.type === "reuse-media-key-system-access"
Expand Down
18 changes: 9 additions & 9 deletions src/public_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,20 +574,20 @@ export interface IKeySystemOption {
* that it's just the `maxSessionCacheSize` which is for now too high.
*
* However if your problem doesn't disappear after setting
* `closeSessionsOnStop` to `true`, you may try `renewMediaKeys` next.
* `closeSessionsOnStop` to `true`, you may try `reuseMediaKeys` next.
*/
closeSessionsOnStop?: boolean;
/**
* If `true`, we will create a new `MediaKeys` instance (a JavaScript object
* needed to decrypt contents) if needed for that content.
* If set to `true` or if not set, we might rely on the previous `MediaKeys`
* if a compatible one is already set on the media element, allowing to
* potentially speed-up content playback.
*
* If `false` or if not set, we might rely on the previous `MediaKeys` if a
* compatible one is already set on the media element, allowing to potentailly
* speed-up content playback.
* If set to `false`, we will create a new `MediaKeys` instance (a
* JavaScript object needed to decrypt contents) if needed for that content.
*
* We noticed that reusing a previous MediaKeys had led to errors on a few
* devices. For example some smart TVs had shown errors after playing several
* encrypted contents, errors which disappeared if we "renewed" the
* encrypted contents, errors which disappeared if we renewed the
* `MediaKeys` for each content.
*
* We should already be able to detect most of those cases in the RxPlayer
Expand All @@ -611,10 +611,10 @@ export interface IKeySystemOption {
* `closeSessionsOnStop`.
*
* - If none of the precedent work-arounds work however, you can try setting
* `renewMediaKeys` to `true`. If it fixes your problem, please open an
* `reuseMediaKeys` to `false`. If it fixes your problem, please open an
* RxPlayer issue so we can add your device to our list.
*/
renewMediaKeys?: boolean | undefined;
reuseMediaKeys?: boolean | undefined;
singleLicensePer?: "content" | "periods" | "init-data";
/**
* Maximum number of `MediaKeySession` that should be created on the same
Expand Down

0 comments on commit ff14e9a

Please sign in to comment.