hls.js 1.6.0-beta.2.0.canary.10873 → 1.6.0-beta.2.0.canary.10877

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hls.mjs CHANGED
@@ -401,7 +401,7 @@ function enableLogs(debugConfig, context, id) {
401
401
  // Some browsers don't allow to use bind on console object anyway
402
402
  // fallback to default if needed
403
403
  try {
404
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10873"}`);
404
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10877"}`);
405
405
  } catch (e) {
406
406
  /* log fn threw an exception. All logger methods are no-ops. */
407
407
  return createLogger();
@@ -9847,7 +9847,7 @@ var eventemitter3 = {exports: {}};
9847
9847
  var eventemitter3Exports = eventemitter3.exports;
9848
9848
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9849
9849
 
9850
- const version = "1.6.0-beta.2.0.canary.10873";
9850
+ const version = "1.6.0-beta.2.0.canary.10877";
9851
9851
 
9852
9852
  // ensure the worker ends up in the bundle
9853
9853
  // If the worker should not be included this gets aliased to empty.js
@@ -12257,9 +12257,7 @@ class HevcVideoParser extends BaseVideoParser {
12257
12257
  track.params[prop] = config.params[prop];
12258
12258
  }
12259
12259
  }
12260
- if (!track.vps && !track.sps.length || track.vps && track.vps[0] === this.initVPS) {
12261
- track.sps.push(unit.data);
12262
- }
12260
+ this.pushParameterSet(track.sps, unit.data, track.vps);
12263
12261
  if (!VideoSample) {
12264
12262
  VideoSample = this.VideoSample = this.createVideoSample(true, pes.pts, pes.dts);
12265
12263
  }
@@ -12277,9 +12275,7 @@ class HevcVideoParser extends BaseVideoParser {
12277
12275
  track.params[prop] = config[prop];
12278
12276
  }
12279
12277
  }
12280
- if (!track.vps && !track.pps.length || track.vps && track.vps[0] === this.initVPS) {
12281
- track.pps.push(unit.data);
12282
- }
12278
+ this.pushParameterSet(track.pps, unit.data, track.vps);
12283
12279
  }
12284
12280
  break;
12285
12281
 
@@ -12310,6 +12306,11 @@ class HevcVideoParser extends BaseVideoParser {
12310
12306
  this.VideoSample = null;
12311
12307
  }
12312
12308
  }
12309
+ pushParameterSet(parameterSets, data, vps) {
12310
+ if (vps && vps[0] === this.initVPS || !vps && !parameterSets.length) {
12311
+ parameterSets.push(data);
12312
+ }
12313
+ }
12313
12314
  getNALuType(data, offset) {
12314
12315
  return (data[offset] & 0x7e) >>> 1;
12315
12316
  }
@@ -13375,7 +13376,6 @@ function parsePMT(data, offset, typeSupported, isSampleAes, observer, logger) {
13375
13376
  // logger.log('AVC PID:' + pid);
13376
13377
  if (result.videoPid === -1) {
13377
13378
  result.videoPid = pid;
13378
- result.segmentVideoCodec = 'avc';
13379
13379
  }
13380
13380
  break;
13381
13381
 
@@ -13812,7 +13812,7 @@ class MP4 {
13812
13812
  0x00, 0x00]));
13813
13813
  }
13814
13814
  static mdia(track) {
13815
- return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));
13815
+ return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale || 0, track.duration || 0), MP4.hdlr(track.type), MP4.minf(track));
13816
13816
  }
13817
13817
  static mfhd(sequenceNumber) {
13818
13818
  return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00,
@@ -13836,7 +13836,7 @@ class MP4 {
13836
13836
  while (i--) {
13837
13837
  boxes[i] = MP4.trak(tracks[i]);
13838
13838
  }
13839
- return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));
13839
+ return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale || 0, tracks[0].duration || 0)].concat(boxes).concat(MP4.mvex(tracks)));
13840
13840
  }
13841
13841
  static mvex(tracks) {
13842
13842
  let i = tracks.length;
@@ -14022,7 +14022,7 @@ class MP4 {
14022
14022
  ]);
14023
14023
  }
14024
14024
  static audioStsd(track) {
14025
- const samplerate = track.samplerate;
14025
+ const samplerate = track.samplerate || 0;
14026
14026
  return new Uint8Array([0x00, 0x00, 0x00,
14027
14027
  // reserved
14028
14028
  0x00, 0x00, 0x00,
@@ -14031,7 +14031,7 @@ class MP4 {
14031
14031
  // data_reference_index
14032
14032
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
14033
14033
  // reserved
14034
- 0x00, track.channelCount,
14034
+ 0x00, track.channelCount || 0,
14035
14035
  // channelcount
14036
14036
  0x00, 0x10,
14037
14037
  // sampleSize:16bits
@@ -14051,25 +14051,38 @@ class MP4 {
14051
14051
  return MP4.box(MP4.types['ac-3'], MP4.audioStsd(track), MP4.box(MP4.types.dac3, track.config));
14052
14052
  }
14053
14053
  static stsd(track) {
14054
+ const {
14055
+ segmentCodec
14056
+ } = track;
14054
14057
  if (track.type === 'audio') {
14055
- if (track.segmentCodec === 'mp3' && track.codec === 'mp3') {
14056
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));
14058
+ if (segmentCodec === 'aac') {
14059
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));
14057
14060
  }
14058
- if (track.segmentCodec === 'ac3') {
14061
+ if (segmentCodec === 'ac3' && track.config) {
14059
14062
  return MP4.box(MP4.types.stsd, MP4.STSD, MP4.ac3(track));
14060
14063
  }
14061
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));
14062
- } else if (track.segmentCodec === 'avc') {
14063
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));
14064
+ if (segmentCodec === 'mp3' && track.codec === 'mp3') {
14065
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));
14066
+ }
14064
14067
  } else {
14065
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.hvc1(track));
14068
+ if (track.pps && track.sps) {
14069
+ if (segmentCodec === 'avc') {
14070
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));
14071
+ }
14072
+ if (segmentCodec === 'hevc' && track.vps) {
14073
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.hvc1(track));
14074
+ }
14075
+ } else {
14076
+ throw new Error(`video track missing pps or sps`);
14077
+ }
14066
14078
  }
14079
+ throw new Error(`unsupported ${track.type} segment codec (${segmentCodec}/${track.codec})`);
14067
14080
  }
14068
14081
  static tkhd(track) {
14069
14082
  const id = track.id;
14070
- const duration = track.duration * track.timescale;
14071
- const width = track.width;
14072
- const height = track.height;
14083
+ const duration = (track.duration || 0) * (track.timescale || 0);
14084
+ const width = track.width || 0;
14085
+ const height = track.height || 0;
14073
14086
  const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));
14074
14087
  const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));
14075
14088
  return MP4.box(MP4.types.tkhd, new Uint8Array([0x01,
@@ -14312,6 +14325,21 @@ const MPEG_AUDIO_SAMPLE_PER_FRAME = 1152;
14312
14325
  const AC3_SAMPLES_PER_FRAME = 1536;
14313
14326
  let chromeVersion = null;
14314
14327
  let safariWebkitVersion = null;
14328
+ function createMp4Sample(isKeyframe, duration, size, cts) {
14329
+ return {
14330
+ duration,
14331
+ size,
14332
+ cts,
14333
+ flags: {
14334
+ isLeading: 0,
14335
+ isDependedOn: 0,
14336
+ hasRedundancy: 0,
14337
+ degradPrio: 0,
14338
+ dependsOn: isKeyframe ? 2 : 1,
14339
+ isNonSync: isKeyframe ? 0 : 1
14340
+ }
14341
+ };
14342
+ }
14315
14343
  class MP4Remuxer {
14316
14344
  constructor(observer, config, typeSupported, logger) {
14317
14345
  this.logger = void 0;
@@ -14810,7 +14838,7 @@ class MP4Remuxer {
14810
14838
  maxDtsDelta = Math.max(maxDtsDelta, mp4SampleDuration);
14811
14839
  minPtsDelta = Math.min(minPtsDelta, ptsDelta);
14812
14840
  maxPtsDelta = Math.max(maxPtsDelta, ptsDelta);
14813
- outputSamples.push(new Mp4Sample(VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
14841
+ outputSamples.push(createMp4Sample(VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
14814
14842
  }
14815
14843
  if (outputSamples.length) {
14816
14844
  if (chromeVersion) {
@@ -14847,7 +14875,7 @@ class MP4Remuxer {
14847
14875
  this.nextAvcDts = nextAvcDts = lastDTS + mp4SampleDuration;
14848
14876
  this.videoSampleDuration = mp4SampleDuration;
14849
14877
  this.isVideoContiguous = true;
14850
- const moof = MP4.moof(track.sequenceNumber++, firstDTS, _extends({}, track, {
14878
+ const moof = MP4.moof(track.sequenceNumber++, firstDTS, _extends(track, {
14851
14879
  samples: outputSamples
14852
14880
  }));
14853
14881
  const type = 'video';
@@ -15049,7 +15077,7 @@ class MP4Remuxer {
15049
15077
  // Default the sample's duration to the computed mp4SampleDuration, which will either be 1024 for AAC or 1152 for MPEG
15050
15078
  // In the case that we have 1 sample, this will be the duration. If we have more than one sample, the duration
15051
15079
  // becomes the PTS diff with the previous sample
15052
- outputSamples.push(new Mp4Sample(true, mp4SampleDuration, unitLen, 0));
15080
+ outputSamples.push(createMp4Sample(true, mp4SampleDuration, unitLen, 0));
15053
15081
  lastPTS = pts;
15054
15082
  }
15055
15083
 
@@ -15155,25 +15183,6 @@ function flushTextTrackUserdataCueSamples(track, timeOffset, initPTS) {
15155
15183
  samples
15156
15184
  };
15157
15185
  }
15158
- class Mp4Sample {
15159
- constructor(isKeyframe, duration, size, cts) {
15160
- this.size = void 0;
15161
- this.duration = void 0;
15162
- this.cts = void 0;
15163
- this.flags = void 0;
15164
- this.duration = duration;
15165
- this.size = size;
15166
- this.cts = cts;
15167
- this.flags = {
15168
- isLeading: 0,
15169
- isDependedOn: 0,
15170
- hasRedundancy: 0,
15171
- degradPrio: 0,
15172
- dependsOn: isKeyframe ? 2 : 1,
15173
- isNonSync: isKeyframe ? 0 : 1
15174
- };
15175
- }
15176
- }
15177
15186
 
15178
15187
  class PassThroughRemuxer {
15179
15188
  constructor(observer, config, typeSupported, logger) {
@@ -21093,109 +21102,127 @@ class EMEController extends Logger {
21093
21102
  if (initData === null) {
21094
21103
  return;
21095
21104
  }
21096
- let keyId;
21097
- let keySystemDomain;
21098
- if (initDataType === 'sinf' && this.getLicenseServerUrl(KeySystems.FAIRPLAY)) {
21099
- // Match sinf keyId to playlist skd://keyId=
21100
- const json = bin2str(new Uint8Array(initData));
21101
- try {
21102
- const sinf = base64Decode(JSON.parse(json).sinf);
21103
- const tenc = parseSinf(sinf);
21104
- if (!tenc) {
21105
- throw new Error(`'schm' box missing or not cbcs/cenc with schi > tenc`);
21106
- }
21107
- keyId = tenc.subarray(8, 24);
21108
- keySystemDomain = KeySystems.FAIRPLAY;
21109
- } catch (error) {
21110
- this.warn(`${logMessage} Failed to parse sinf: ${error}`);
21111
- return;
21112
- }
21113
- } else if (this.getLicenseServerUrl(KeySystems.WIDEVINE)) {
21114
- // Support Widevine clear-lead key-session creation (otherwise depend on playlist keys)
21115
- const psshResults = parseMultiPssh(initData);
21116
-
21117
- // TODO: If using keySystemAccessPromises we might want to wait until one is resolved
21105
+ if (!this.keyFormatPromise) {
21118
21106
  let keySystems = Object.keys(this.keySystemAccessPromises);
21119
21107
  if (!keySystems.length) {
21120
21108
  keySystems = getKeySystemsForConfig(this.config);
21121
21109
  }
21122
- const psshInfo = psshResults.filter(pssh => {
21123
- const keySystem = pssh.systemId ? keySystemIdToKeySystemDomain(pssh.systemId) : null;
21124
- return keySystem ? keySystems.indexOf(keySystem) > -1 : false;
21125
- })[0];
21126
- if (!psshInfo) {
21127
- if (psshResults.length === 0 || psshResults.some(pssh => !pssh.systemId)) {
21128
- this.warn(`${logMessage} contains incomplete or invalid pssh data`);
21129
- } else {
21130
- this.log(`ignoring ${logMessage} for ${psshResults.map(pssh => keySystemIdToKeySystemDomain(pssh.systemId)).join(',')} pssh data in favor of playlist keys`);
21110
+ const keyFormats = keySystems.map(keySystemDomainToKeySystemFormat).filter(k => !!k);
21111
+ this.keyFormatPromise = this.getKeyFormatPromise(keyFormats);
21112
+ }
21113
+ this.keyFormatPromise.then(keySystemFormat => {
21114
+ const keySystem = keySystemFormatToKeySystemDomain(keySystemFormat);
21115
+ let keyId;
21116
+ let keySystemDomain;
21117
+ if (initDataType === 'sinf') {
21118
+ if (keySystem !== KeySystems.FAIRPLAY) {
21119
+ this.warn(`Ignoring unexpected "${event.type}" event with init data type: "${initDataType}" for selected key-system ${keySystem}`);
21120
+ return;
21131
21121
  }
21132
- return;
21133
- }
21134
- keySystemDomain = keySystemIdToKeySystemDomain(psshInfo.systemId);
21135
- if (psshInfo.version === 0 && psshInfo.data) {
21136
- if (keySystemDomain === KeySystems.WIDEVINE) {
21137
- const offset = psshInfo.data.length - 22;
21138
- keyId = psshInfo.data.subarray(offset, offset + 16);
21139
- } else if (keySystemDomain === KeySystems.PLAYREADY) {
21140
- keyId = parsePlayReadyWRM(psshInfo.data);
21122
+ // Match sinf keyId to playlist skd://keyId=
21123
+ const json = bin2str(new Uint8Array(initData));
21124
+ try {
21125
+ const sinf = base64Decode(JSON.parse(json).sinf);
21126
+ const tenc = parseSinf(sinf);
21127
+ if (!tenc) {
21128
+ throw new Error(`'schm' box missing or not cbcs/cenc with schi > tenc`);
21129
+ }
21130
+ keyId = tenc.subarray(8, 24);
21131
+ keySystemDomain = KeySystems.FAIRPLAY;
21132
+ } catch (error) {
21133
+ this.warn(`${logMessage} Failed to parse sinf: ${error}`);
21134
+ return;
21135
+ }
21136
+ } else {
21137
+ if (keySystem !== KeySystems.WIDEVINE && keySystem !== KeySystems.PLAYREADY) {
21138
+ this.warn(`Ignoring unexpected "${event.type}" event with init data type: "${initDataType}" for selected key-system ${keySystem}`);
21139
+ return;
21140
+ }
21141
+ // Support Widevine/PlayReady clear-lead key-session creation (otherwise depend on playlist keys)
21142
+ const psshResults = parseMultiPssh(initData);
21143
+ const psshInfos = psshResults.filter(pssh => !!pssh.systemId && keySystemIdToKeySystemDomain(pssh.systemId) === keySystem);
21144
+ if (psshInfos.length) {
21145
+ this.warn(`${logMessage} Using first of ${psshInfos.length} pssh found for selected key-system ${keySystem}`);
21146
+ }
21147
+ const psshInfo = psshInfos[0];
21148
+ if (!psshInfo) {
21149
+ if (psshResults.length === 0 || psshResults.some(pssh => !pssh.systemId)) {
21150
+ this.warn(`${logMessage} contains incomplete or invalid pssh data`);
21151
+ } else {
21152
+ this.log(`ignoring ${logMessage} for ${psshResults.map(pssh => keySystemIdToKeySystemDomain(pssh.systemId)).join(',')} pssh data in favor of playlist keys`);
21153
+ }
21154
+ return;
21155
+ }
21156
+ keySystemDomain = keySystemIdToKeySystemDomain(psshInfo.systemId);
21157
+ if (psshInfo.version === 0 && psshInfo.data) {
21158
+ if (keySystemDomain === KeySystems.WIDEVINE) {
21159
+ const offset = psshInfo.data.length - 22;
21160
+ keyId = psshInfo.data.subarray(offset, offset + 16);
21161
+ } else if (keySystemDomain === KeySystems.PLAYREADY) {
21162
+ keyId = parsePlayReadyWRM(psshInfo.data);
21163
+ }
21141
21164
  }
21142
21165
  }
21143
- }
21144
- if (!keySystemDomain || !keyId) {
21145
- return;
21146
- }
21147
- const keyIdHex = Hex.hexDump(keyId);
21148
- const {
21149
- keyIdToKeySessionPromise,
21150
- mediaKeySessions
21151
- } = this;
21152
- let keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex];
21153
- for (let i = 0; i < mediaKeySessions.length; i++) {
21154
- // Match playlist key
21155
- const keyContext = mediaKeySessions[i];
21156
- const decryptdata = keyContext.decryptdata;
21157
- if (!decryptdata.keyId) {
21158
- continue;
21166
+ if (!keySystemDomain || !keyId) {
21167
+ return;
21159
21168
  }
21160
- const oldKeyIdHex = Hex.hexDump(decryptdata.keyId);
21161
- if (keyIdHex === oldKeyIdHex || decryptdata.uri.replace(/-/g, '').indexOf(keyIdHex) !== -1) {
21162
- keySessionContextPromise = keyIdToKeySessionPromise[oldKeyIdHex];
21163
- if (decryptdata.pssh) {
21169
+ const keyIdHex = Hex.hexDump(keyId);
21170
+ const {
21171
+ keyIdToKeySessionPromise,
21172
+ mediaKeySessions
21173
+ } = this;
21174
+ let keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex];
21175
+ for (let i = 0; i < mediaKeySessions.length; i++) {
21176
+ // Match playlist key
21177
+ const keyContext = mediaKeySessions[i];
21178
+ const decryptdata = keyContext.decryptdata;
21179
+ if (!decryptdata.keyId) {
21180
+ continue;
21181
+ }
21182
+ const oldKeyIdHex = Hex.hexDump(decryptdata.keyId);
21183
+ if (keyIdHex === oldKeyIdHex || decryptdata.uri.replace(/-/g, '').indexOf(keyIdHex) !== -1) {
21184
+ keySessionContextPromise = keyIdToKeySessionPromise[oldKeyIdHex];
21185
+ if (decryptdata.pssh) {
21186
+ break;
21187
+ }
21188
+ delete keyIdToKeySessionPromise[oldKeyIdHex];
21189
+ decryptdata.pssh = new Uint8Array(initData);
21190
+ decryptdata.keyId = keyId;
21191
+ keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = keySessionContextPromise.then(() => {
21192
+ return this.generateRequestWithPreferredKeySession(keyContext, initDataType, initData, 'encrypted-event-key-match');
21193
+ });
21194
+ keySessionContextPromise.catch(error => this.handleError(error));
21164
21195
  break;
21165
21196
  }
21166
- delete keyIdToKeySessionPromise[oldKeyIdHex];
21167
- decryptdata.pssh = new Uint8Array(initData);
21168
- decryptdata.keyId = keyId;
21169
- keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = keySessionContextPromise.then(() => {
21170
- return this.generateRequestWithPreferredKeySession(keyContext, initDataType, initData, 'encrypted-event-key-match');
21171
- });
21172
- keySessionContextPromise.catch(error => this.handleError(error));
21173
- break;
21174
21197
  }
21175
- }
21176
- if (!keySessionContextPromise) {
21177
- // Clear-lead key (not encountered in playlist)
21178
- keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = this.getKeySystemSelectionPromise([keySystemDomain]).then(({
21179
- keySystem,
21180
- mediaKeys
21181
- }) => {
21182
- var _keySystemToKeySystem;
21183
- this.throwIfDestroyed();
21184
- const decryptdata = new LevelKey('ISO-23001-7', keyIdHex, (_keySystemToKeySystem = keySystemDomainToKeySystemFormat(keySystem)) != null ? _keySystemToKeySystem : '');
21185
- decryptdata.pssh = new Uint8Array(initData);
21186
- decryptdata.keyId = keyId;
21187
- return this.attemptSetMediaKeys(keySystem, mediaKeys).then(() => {
21198
+ if (!keySessionContextPromise) {
21199
+ if (keySystemDomain !== keySystem) {
21200
+ this.log(`Ignoring "${event.type}" event with ${keySystemDomain} init data for selected key-system ${keySystem}`);
21201
+ return;
21202
+ }
21203
+ // "Clear-lead" (misc key not encountered in playlist)
21204
+ keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = this.getKeySystemSelectionPromise([keySystemDomain]).then(({
21205
+ keySystem,
21206
+ mediaKeys
21207
+ }) => {
21208
+ var _keySystemToKeySystem;
21188
21209
  this.throwIfDestroyed();
21189
- const keySessionContext = this.createMediaKeySessionContext({
21190
- decryptdata,
21191
- keySystem,
21192
- mediaKeys
21210
+ const decryptdata = new LevelKey('ISO-23001-7', keyIdHex, (_keySystemToKeySystem = keySystemDomainToKeySystemFormat(keySystem)) != null ? _keySystemToKeySystem : '');
21211
+ decryptdata.pssh = new Uint8Array(initData);
21212
+ decryptdata.keyId = keyId;
21213
+ return this.attemptSetMediaKeys(keySystem, mediaKeys).then(() => {
21214
+ this.throwIfDestroyed();
21215
+ const keySessionContext = this.createMediaKeySessionContext({
21216
+ decryptdata,
21217
+ keySystem,
21218
+ mediaKeys
21219
+ });
21220
+ return this.generateRequestWithPreferredKeySession(keySessionContext, initDataType, initData, 'encrypted-event-no-match');
21193
21221
  });
21194
- return this.generateRequestWithPreferredKeySession(keySessionContext, initDataType, initData, 'encrypted-event-no-match');
21195
21222
  });
21196
- });
21197
- keySessionContextPromise.catch(error => this.handleError(error));
21198
- }
21223
+ keySessionContextPromise.catch(error => this.handleError(error));
21224
+ }
21225
+ });
21199
21226
  };
21200
21227
  this.onWaitingForKey = event => {
21201
21228
  this.log(`"${event.type}" event`);
@@ -32558,7 +32585,7 @@ class KeyLoader {
32558
32585
  }
32559
32586
  }
32560
32587
  load(frag) {
32561
- if (!frag.decryptdata && frag.encrypted && this.emeController) {
32588
+ if (!frag.decryptdata && frag.encrypted && this.emeController && this.config.emeEnabled) {
32562
32589
  // Multiple keys, but none selected, resolve in eme-controller
32563
32590
  return this.emeController.selectKeySystemFormat(frag).then(keySystemFormat => {
32564
32591
  return this.loadInternal(frag, keySystemFormat);