Skip to content

Commit

Permalink
fix: Fix rare exception after StreamingEngine teardown (shaka-project…
Browse files Browse the repository at this point in the history
…#4830)

In some cases, the timing of certain events can cause a seek callback to
fire on StreamingEngine after it has been destroyed. This checks for
that condition to avoid an exception.

Closes shaka-project#4813
  • Loading branch information
joeyparrish committed Dec 14, 2022
1 parent 224207b commit 234beef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/media/streaming_engine.js
Expand Up @@ -622,6 +622,11 @@ shaka.media.StreamingEngine = class {
* within the presentation timeline.
*/
seeked() {
if (!this.playerInterface_) {
// Already destroyed.
return;
}

const presentationTime = this.playerInterface_.getPresentationTime();
const ContentType = shaka.util.ManifestParserUtils.ContentType;
const newTimeIsBuffered = (type) => {
Expand Down

0 comments on commit 234beef

Please sign in to comment.