Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix support clear and encrypted periods #4606

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ shaka.media.DrmEngine = class {
if (this.mediaKeysAttached_) {
await this.mediaKeysAttached_;

this.destroyer_.ensureNotDestroyed();
return;
}

Expand Down Expand Up @@ -483,14 +484,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