Skip to content

Commit

Permalink
feat(MediaCap): Always polyfill MediaCap for Chromecast
Browse files Browse the repository at this point in the history
Since we got some unexpected decodingInfo results from MediaCapabilities
on Chromecast, we should fall back to MediaSource.isTypeSupported() on
Chromecast.

Issue shaka-project#1391

Change-Id: I4947ec78624e98c7039df64ad691e14ece2588e0
  • Loading branch information
michellezhuogg committed Apr 29, 2021
1 parent 95ba28b commit e592d48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/polyfill/media_capabilities.js
Expand Up @@ -8,6 +8,7 @@ goog.provide('shaka.polyfill.MediaCapabilities');

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


/**
Expand All @@ -22,7 +23,10 @@ shaka.polyfill.MediaCapabilities = class {
static install() {
shaka.log.debug('MediaCapabilities: install');

if (navigator.mediaCapabilities) {
// Since MediaCapabilities is not fully supported on Chromecast yet, we
// should always install polyfill for Chromecast.
// TODO: re-evaluate MediaCapabilities in the future versions of Chromecast.
if (!shaka.util.Platform.isChromecast() && navigator.mediaCapabilities) {
shaka.log.debug(
'MediaCapabilities: Native mediaCapabilities support found.');
return;
Expand Down

0 comments on commit e592d48

Please sign in to comment.