Skip to content

Commit

Permalink
fix: Fix MediaCapabilities polyfill on Hisense (#4927)
Browse files Browse the repository at this point in the history
fixes #4925
  • Loading branch information
avelad authored Jan 23, 2023
1 parent d9fa4eb commit 6a48cfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/polyfill/media_capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ shaka.polyfill.MediaCapabilities = class {
// should always install polyfill for WebOS browsers.
// Since MediaCapabilities implementation is buggy in EOS browsers, we
// should always install polyfill for EOS browsers.
// Since MediaCapabilities implementation is buggy in Hisense browsers, we
// should always install polyfill for Hisense browsers.
let canUseNativeMCap = true;
if (shaka.util.Platform.isApple() ||
shaka.util.Platform.isPS5() ||
shaka.util.Platform.isPS4() ||
shaka.util.Platform.isWebOS() ||
shaka.util.Platform.isTizen() ||
shaka.util.Platform.isChromecast() ||
shaka.util.Platform.isEOS()) {
shaka.util.Platform.isEOS() ||
shaka.util.Platform.isHisense()) {
canUseNativeMCap = false;
}
if (canUseNativeMCap && navigator.mediaCapabilities) {
Expand Down
8 changes: 8 additions & 0 deletions lib/util/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ shaka.util.Platform = class {
return shaka.util.Platform.userAgentContains_('PlayStation 4');
}

/**
* Check if the current platform is Hisense.
*/
static isHisense() {
return shaka.util.Platform.userAgentContains_('Hisense') ||
shaka.util.Platform.userAgentContains_('VIDAA');
}

/**
* Check if the current platform is Virgin Media device.
*/
Expand Down

0 comments on commit 6a48cfe

Please sign in to comment.