diff --git a/src/playlist-controller.js b/src/playlist-controller.js index b69bb39c1..430e02edd 100644 --- a/src/playlist-controller.js +++ b/src/playlist-controller.js @@ -198,6 +198,7 @@ export class PlaylistController extends videojs.EventTarget { this.playlistExclusionDuration = playlistExclusionDuration; this.maxPlaylistRetries = maxPlaylistRetries; this.enableLowInitialPlaylist = enableLowInitialPlaylist; + this.usingManagedMediaSource_ = false; if (this.useCueTags_) { this.cueTagsTrack_ = this.tech_.addTextTrack( @@ -221,6 +222,7 @@ export class PlaylistController extends videojs.EventTarget { // Airplay source not yet implemented. Remote playback must be disabled. this.tech_.el_.disableRemotePlayback = true; this.mediaSource = new window.ManagedMediaSource(); + this.usingManagedMediaSource_ = true; videojs.log('Using ManagedMediaSource'); } else if (window.MediaSource) { @@ -1997,7 +1999,7 @@ export class PlaylistController extends videojs.EventTarget { } // fmp4 relies on browser support, while ts relies on muxer support - const supportFunction = (isFmp4, codec) => (isFmp4 ? browserSupportsCodec(codec) : muxerSupportsCodec(codec)); + const supportFunction = (isFmp4, codec) => (isFmp4 ? browserSupportsCodec(codec, this.usingManagedMediaSource_) : muxerSupportsCodec(codec)); const unsupportedCodecs = {}; let unsupportedAudio; @@ -2139,11 +2141,11 @@ export class PlaylistController extends videojs.EventTarget { const codecs = codecsForPlaylist(this.main, variant); const unsupported = []; - if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !browserSupportsCodec(codecs.audio)) { + if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !browserSupportsCodec(codecs.audio, this.usingManagedMediaSource_)) { unsupported.push(`audio codec ${codecs.audio}`); } - if (codecs.video && !muxerSupportsCodec(codecs.video) && !browserSupportsCodec(codecs.video)) { + if (codecs.video && !muxerSupportsCodec(codecs.video) && !browserSupportsCodec(codecs.video, this.usingManagedMediaSource_)) { unsupported.push(`video codec ${codecs.video}`); }