Skip to content

Commit

Permalink
Merge pull request #94 from bbc/BADGERS-472-abort-manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
jlks authored Oct 14, 2024
2 parents 20c3473 + 4092508 commit 8777346
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/streaming/MediaPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ function MediaPlayer() {
videoModel,
uriFragmentModel,
domStorage,
segmentBaseController;
segmentBaseController,
retrieveManifestLoader;

/*
---------------------------------------------------------------------------
Expand Down Expand Up @@ -457,6 +458,10 @@ function MediaPlayer() {
offlineController.reset();
offlineController = null;
}

if (retrieveManifestLoader) {
retrieveManifestLoader.reset();
}
}

/**
Expand Down Expand Up @@ -1834,7 +1839,7 @@ function MediaPlayer() {
* @instance
*/
function retrieveManifest(url, callback) {
let manifestLoader = _createManifestLoader();
retrieveManifestLoader = _createManifestLoader();
let self = this;

const handler = function (e) {
Expand All @@ -1844,13 +1849,13 @@ function MediaPlayer() {
callback(null, e.error);
}
eventBus.off(Events.INTERNAL_MANIFEST_LOADED, handler, self);
manifestLoader.reset();
retrieveManifestLoader.reset();
};

eventBus.on(Events.INTERNAL_MANIFEST_LOADED, handler, self);

uriFragmentModel.initialize(url);
manifestLoader.load(url);
retrieveManifestLoader.load(url);
}

/**
Expand Down

0 comments on commit 8777346

Please sign in to comment.