Skip to content

Commit

Permalink
add flag to indicate whether mms is being used
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-barstow committed Nov 27, 2024
1 parent c66fa3e commit af5e3e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/playlist-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class PlaylistController extends videojs.EventTarget {
this.playlistExclusionDuration = playlistExclusionDuration;
this.maxPlaylistRetries = maxPlaylistRetries;
this.enableLowInitialPlaylist = enableLowInitialPlaylist;
this.experimentalUseMMS_ = experimentalUseMMS;
this.usingManagedMediaSource_ = false;

if (this.useCueTags_) {
this.cueTagsTrack_ = this.tech_.addTextTrack(
Expand All @@ -216,6 +216,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) {
Expand Down Expand Up @@ -1959,7 +1960,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, this.experimentalUseMMS_) : muxerSupportsCodec(codec));
const supportFunction = (isFmp4, codec) => (isFmp4 ? browserSupportsCodec(codec, this.usingManagedMediaSource_) : muxerSupportsCodec(codec));
const unsupportedCodecs = {};
let unsupportedAudio;

Expand Down Expand Up @@ -2101,11 +2102,11 @@ export class PlaylistController extends videojs.EventTarget {
const codecs = codecsForPlaylist(this.main, variant);
const unsupported = [];

if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !browserSupportsCodec(codecs.audio, this.experimentalUseMMS_)) {
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, this.experimentalUseMMS_)) {
if (codecs.video && !muxerSupportsCodec(codecs.video) && !browserSupportsCodec(codecs.video, this.usingManagedMediaSource_)) {
unsupported.push(`video codec ${codecs.video}`);
}

Expand Down

0 comments on commit af5e3e2

Please sign in to comment.