diff --git a/lib/offline/storage.js b/lib/offline/storage.js index b05f17557c..e393477a5d 100644 --- a/lib/offline/storage.js +++ b/lib/offline/storage.js @@ -397,7 +397,7 @@ shaka.offline.Storage = class { shaka.drm.DrmEngine.configureClearKey( config.drm.clearKeys, manifest.variants); - const needsPersistentLicense = manifest.variants.some((v) => { + const clearKeyDataLicenseServerUri = manifest.variants.some((v) => { if (v.audio) { for (const drmInfo of v.audio.drmInfos) { if (!drmInfo.licenseServerUri.startsWith('data:')) { @@ -415,10 +415,10 @@ shaka.offline.Storage = class { return false; }); - const usePersistentLicense = - needsPersistentLicense && config.offline.usePersistentLicense; - - console.log(usePersistentLicense); + let usePersistentLicense = config.offline.usePersistentLicense; + if (clearKeyDataLicenseServerUri) { + usePersistentLicense = false; + } // Create the DRM engine, and load the keys in the manifest. drmEngine = await this.createDrmEngine(