Skip to content

Commit

Permalink
fix: Fix mediaCapabilities polyfill on Chromecast
Browse files Browse the repository at this point in the history
Chromecast firmware now includes limited support for
mediaCapabilities, but we still need to install the polyfill for now.
The platform will let us overwrite the decodingInfo method, but not
the mediaCapabilities object itself.  This fixes the polyfill to
handle this situation.

Change-Id: Ia770457ad8465ec1caf4420ef757303adbe55ce5
  • Loading branch information
joeyparrish committed Jul 9, 2021
1 parent b3166db commit de77787
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/polyfill/media_capabilities.js
Expand Up @@ -37,7 +37,9 @@ shaka.polyfill.MediaCapabilities = class {
return;
}

navigator.mediaCapabilities = /** @type {!MediaCapabilities} */ ({});
if (!navigator.mediaCapabilities) {
navigator.mediaCapabilities = /** @type {!MediaCapabilities} */ ({});
}
navigator.mediaCapabilities.decodingInfo =
shaka.polyfill.MediaCapabilities.decodingInfo_;
}
Expand Down

0 comments on commit de77787

Please sign in to comment.