Skip to content

Commit

Permalink
[MSS] Do not update manifest if already updating at tracks switching …
Browse files Browse the repository at this point in the history
…for live streams (#3780)

* Do not update manifest if already updating (for example when MSS audio and text tracks are changed simultaneoulsy)

* [MSS] Do not update manifest if already updating at tracks switching for live streams
  • Loading branch information
bbert authored Sep 30, 2021
1 parent 262fdee commit 4b4a45d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/streaming/ManifestUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,15 @@ function ManifestUpdater() {
isUpdating = false;
}

function getIsUpdating() {
return isUpdating;
}

instance = {
initialize: initialize,
setManifest: setManifest,
refreshManifest: refreshManifest,
getIsUpdating: getIsUpdating,
setConfig: setConfig,
reset: reset
};
Expand Down
6 changes: 4 additions & 2 deletions src/streaming/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,11 @@ function Stream(config) {

// Applies only for MSS streams
if (manifest.refreshManifestOnSwitchTrack) {
logger.debug('Stream - Refreshing manifest for switch track');
trackChangedEvents.push(e);
manifestUpdater.refreshManifest();
if (!manifestUpdater.getIsUpdating()) {
logger.debug('Stream - Refreshing manifest for switch track');
manifestUpdater.refreshManifest();
}
} else {
processor.selectMediaInfo(mediaInfo)
.then(() => {
Expand Down

0 comments on commit 4b4a45d

Please sign in to comment.