Skip to content

Commit

Permalink
fix: Disable Encryption Scheme Polyfil On Some Devices (#7355)
Browse files Browse the repository at this point in the history
Fixes #7354
These platforms don't support `encryptionScheme`, so there is no need to
install this polyfil.
  • Loading branch information
agajassi authored and joeyparrish committed Sep 26, 2024
1 parent 5e193b9 commit 0a5abf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/polyfill/encryption_scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
goog.provide('shaka.polyfill.EncryptionScheme');

goog.require('shaka.polyfill');
goog.require('shaka.util.Platform');

/**
* @summary A polyfill to add support for EncryptionScheme queries in EME.
Expand All @@ -23,6 +24,14 @@ shaka.polyfill.EncryptionScheme = class {
* @export
*/
static install() {
// Skip polyfill for PlayStation 4 and SkyQ devices due to known crashes
// caused by unsupported encryptionScheme handling. These platforms do not
// require the polyfill, and forcing encryptionScheme processing can result
// in playback crashes.
if (shaka.util.Platform.isPS4() || shaka.util.Platform.isSkyQ()) {
return;
}

EncryptionSchemePolyfills.install();
}
};
Expand Down
7 changes: 7 additions & 0 deletions lib/util/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ shaka.util.Platform = class {
return shaka.util.Platform.userAgentContains_('SOPOpenBrowser');
}

/**
* Check if the current platform is SkyQ STB.
*/
static isSkyQ() {
return shaka.util.Platform.userAgentContains_('Sky_STB');
}

/**
* Check if the current platform is Amazon Fire TV.
* https://developer.amazon.com/docs/fire-tv/identify-amazon-fire-tv-devices.html
Expand Down

0 comments on commit 0a5abf5

Please sign in to comment.