Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix MediaCapabilities polyfill on Hisense #4927

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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