Skip to content

Commit

Permalink
fix: Resolve load failures for TS-based content on Android-based Cast…
Browse files Browse the repository at this point in the history
… devices (shaka-project#4569). (shaka-project#4570)

See shaka-project#4569 for more
context.

This affects any Chromecast model which contains the substring `Android`
in their userAgent. For TS content, this causes Shaka to incorrectly
filter all stream variants leaving nothing for the player to select for
playback (resulting in a `4032` error):
https://github.com/shaka-project/shaka-player/blob/757b34e5959f14c9a5b5aed173cc99d98a794a40/lib/util/stream_utils.js#L484-L491.
  • Loading branch information
JulianDomingo authored and joeyparrish committed Oct 14, 2022
1 parent e781309 commit 65903aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
8 changes: 3 additions & 5 deletions lib/polyfill/media_capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ shaka.polyfill.MediaCapabilities = class {
* @export
*/
static install() {
// Since MediaCapabilities is not fully supported on some Chromecast yet,
// we should always install polyfill for all Chromecast not Android-based.
// Since MediaCapabilities implementation is buggy on the Chromecast
// platform (see https://github.com/shaka-project/shaka-player/issues/4569),
// we should always install polyfills on all Chromecast models.
// TODO: re-evaluate MediaCapabilities in the future versions of Chromecast.
// Since MediaCapabilities implementation is buggy in Apple browsers, we
// should always install polyfill for Apple browsers.
Expand All @@ -52,9 +53,6 @@ shaka.polyfill.MediaCapabilities = class {
shaka.util.Platform.isChromecast()) {
canUseNativeMCap = false;
}
if (shaka.util.Platform.isAndroidCastDevice()) {
canUseNativeMCap = true;
}
if (canUseNativeMCap && navigator.mediaCapabilities) {
shaka.log.info(
'MediaCapabilities: Native mediaCapabilities support found.');
Expand Down
10 changes: 0 additions & 10 deletions lib/util/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,6 @@ shaka.util.Platform = class {
return shaka.util.Platform.userAgentContains_('CrKey');
}

/**
* Check if the current platform is a Android-based Cast devices.
*
* @return {boolean}
*/
static isAndroidCastDevice() {
return shaka.util.Platform.isChromecast() &&
shaka.util.Platform.userAgentContains_('Android');
}

/**
* Returns a major version number for Chrome, or Chromium-based browsers.
*
Expand Down

0 comments on commit 65903aa

Please sign in to comment.