Skip to content

Commit

Permalink
fix: Don't send drmsessionupdate after unload (#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 #4241
  • Loading branch information
theodab authored and joeyparrish committed Jun 2, 2022
1 parent 79509c8 commit c20c590
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,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 c20c590

Please sign in to comment.