Skip to content

Commit

Permalink
fix(drm): Fix support for multi-period encrypted live
Browse files Browse the repository at this point in the history
To support encrypted, multi-period live streams, you must initialize
the CDM whenever there is a license server config, without regard for
whether or not there is encryption signalled in a manifest.

If you join the stream during a clear ad, and there isn't enough
rewind allowed to see any encrypted periods at the time you join, the
manifest may not indicate encryption.  If we start playback without
setting up decryption, we would fail later when an encrypted period
appeared.

This issue affected releases v3.0.0 - v3.0.5.

Fixes shaka-project#2979
Fixes shaka-project#2645

Change-Id: Ic7ddcf46843178e6a3ce0b1d663da40dc9f4be8f
  • Loading branch information
joeyparrish committed Nov 11, 2020
1 parent 14460ad commit 9692dc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ shaka.media.DrmEngine = class {
const clearKeyDrmInfo = this.configureClearKey_();
if (clearKeyDrmInfo) {
for (const variant of variants) {
if (variant.video && variant.video.encrypted) {
if (variant.video) {
variant.video.drmInfos = [clearKeyDrmInfo];
}
if (variant.audio && variant.audio.encrypted) {
if (variant.audio) {
variant.audio.drmInfos = [clearKeyDrmInfo];
}
}
Expand Down Expand Up @@ -1763,10 +1763,10 @@ shaka.media.DrmEngine = class {
});

for (const variant of variants) {
if (variant.video && variant.video.encrypted) {
if (variant.video) {
variant.video.drmInfos = drmInfos;
}
if (variant.audio && variant.audio.encrypted) {
if (variant.audio) {
variant.audio.drmInfos = drmInfos;
}
}
Expand Down

0 comments on commit 9692dc0

Please sign in to comment.