Skip to content

Commit

Permalink
move keysystemaccess error to outer promise accumulation
Browse files Browse the repository at this point in the history
  • Loading branch information
adrums86 committed Mar 12, 2024
1 parent dfdf1aa commit 5470a4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/eme.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const getSupportedConfigurations = (keySystem, keySystemOptions) => {
return [supportedConfiguration];
};

export const getSupportedKeySystem = (keySystems, emeError) => {
export const getSupportedKeySystem = (keySystems) => {
// As this happens after the src is set on the video, we rely only on the set src (we
// do not change src based on capabilities of the browser in this plugin).

Expand All @@ -82,12 +82,9 @@ export const getSupportedKeySystem = (keySystems, emeError) => {

if (!promise) {
promise =
window.navigator.requestMediaKeySystemAccess(keySystem, supportedConfigurations).catch((error) => {
emeError(error, videojs.Error.EMEFailedToRequestMediaKeySystemAccess);
});
window.navigator.requestMediaKeySystemAccess(keySystem, supportedConfigurations);
} else {
promise = promise.catch(() => {
// TODO: Not sure if we want to call emeError here or not.
window.navigator.requestMediaKeySystemAccess(keySystem, supportedConfigurations);
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export const handleEncryptedEvent = (player, event, options, sessions, eventBus,
eventBus,
emeError
});
}).catch((error) => {
emeError(error, videojs.Error.EMEFailedToRequestMediaKeySystemAccess);
});
};

Expand Down

0 comments on commit 5470a4c

Please sign in to comment.