Skip to content

Commit

Permalink
fix: Don't send drmsessionupdate after unload (shaka-project#4248)
Browse files Browse the repository at this point in the history
There is an async call, waiting for sessions to update, right before
the StreamingEngine fires off an drmsessionupdate event.
This could potentially cause an error, as the StreamingEngine's
player interface could potentially be set to null during destruction.
This adds a check to see if the StreamingEngine has been destroyed,
to catch that case.

Based on a test failure of shaka-project#4241
  • Loading branch information
theodab authored and joeyparrish committed Jun 2, 2022
1 parent 5afcee8 commit d7a7024
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/media/drm_engine.js
Expand Up @@ -1424,6 +1424,9 @@ shaka.media.DrmEngine = class {
}
return;
}
if (this.destroyer_.destroyed()) {
return;
}

const updateEvent = new shaka.util.FakeEvent('drmsessionupdate');
this.playerInterface_.onEvent(updateEvent);
Expand Down

0 comments on commit d7a7024

Please sign in to comment.