Skip to content

Commit

Permalink
fix: fix support clear and encrypted periods (#4606)
Browse files Browse the repository at this point in the history
Closes #4512
  • Loading branch information
avelad authored and joeyparrish committed Oct 26, 2022
1 parent 265d56d commit 4c4b799
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ shaka.media.DrmEngine = class {
if (this.mediaKeysAttached_) {
await this.mediaKeysAttached_;

this.destroyer_.ensureNotDestroyed();
return;
}

Expand Down Expand Up @@ -484,14 +485,12 @@ shaka.media.DrmEngine = class {

/**
* We can attach media keys before the playback actually begins when:
* - Using legacy implementations requires MediaKeys to be set before
* having webkitneedkey / msneedkey event, which will be translated as
* an encrypted event by the polyfills
* - If we are not using FairPlay Modern EME
* - Some initData already has been generated (through the manifest)
* - In case of an offline session
*/
if (manifestInitData ||
shaka.util.Platform.isMediaKeysPolyfilled() ||
this.currentDrmInfo_.keySystem !== 'com.apple.fps' ||
this.offlineSessionIds_.length) {
await this.attachMediaKeys_();
}
Expand Down

0 comments on commit 4c4b799

Please sign in to comment.