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.js +177 -146
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +44 -115
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +46 -117
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +162 -135
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/controller/eme-controller.ts +154 -116
- package/src/demux/audio/base-audio-demuxer.ts +6 -6
- package/src/demux/tsdemuxer.ts +2 -3
- package/src/demux/video/hevc-video-parser.ts +12 -12
- package/src/loader/key-loader.ts +6 -1
- package/src/remux/mp4-generator.ts +99 -45
- package/src/remux/mp4-remuxer.ts +24 -38
- package/src/types/demuxer.ts +41 -1
- package/src/types/remuxer.ts +25 -0
package/dist/hls.js
CHANGED
@@ -1058,7 +1058,7 @@
|
|
1058
1058
|
// Some browsers don't allow to use bind on console object anyway
|
1059
1059
|
// fallback to default if needed
|
1060
1060
|
try {
|
1061
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.
|
1061
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.10877");
|
1062
1062
|
} catch (e) {
|
1063
1063
|
/* log fn threw an exception. All logger methods are no-ops. */
|
1064
1064
|
return createLogger();
|
@@ -12637,9 +12637,7 @@
|
|
12637
12637
|
track.params[prop] = config.params[prop];
|
12638
12638
|
}
|
12639
12639
|
}
|
12640
|
-
|
12641
|
-
track.sps.push(unit.data);
|
12642
|
-
}
|
12640
|
+
_this2.pushParameterSet(track.sps, unit.data, track.vps);
|
12643
12641
|
if (!VideoSample) {
|
12644
12642
|
VideoSample = _this2.VideoSample = _this2.createVideoSample(true, pes.pts, pes.dts);
|
12645
12643
|
}
|
@@ -12657,9 +12655,7 @@
|
|
12657
12655
|
track.params[_prop] = _config[_prop];
|
12658
12656
|
}
|
12659
12657
|
}
|
12660
|
-
|
12661
|
-
track.pps.push(unit.data);
|
12662
|
-
}
|
12658
|
+
_this2.pushParameterSet(track.pps, unit.data, track.vps);
|
12663
12659
|
}
|
12664
12660
|
break;
|
12665
12661
|
|
@@ -12690,6 +12686,11 @@
|
|
12690
12686
|
this.VideoSample = null;
|
12691
12687
|
}
|
12692
12688
|
};
|
12689
|
+
_proto.pushParameterSet = function pushParameterSet(parameterSets, data, vps) {
|
12690
|
+
if (vps && vps[0] === this.initVPS || !vps && !parameterSets.length) {
|
12691
|
+
parameterSets.push(data);
|
12692
|
+
}
|
12693
|
+
};
|
12693
12694
|
_proto.getNALuType = function getNALuType(data, offset) {
|
12694
12695
|
return (data[offset] & 0x7e) >>> 1;
|
12695
12696
|
};
|
@@ -13756,7 +13757,6 @@
|
|
13756
13757
|
// logger.log('AVC PID:' + pid);
|
13757
13758
|
if (result.videoPid === -1) {
|
13758
13759
|
result.videoPid = pid;
|
13759
|
-
result.segmentVideoCodec = 'avc';
|
13760
13760
|
}
|
13761
13761
|
break;
|
13762
13762
|
|
@@ -14198,7 +14198,7 @@
|
|
14198
14198
|
0x00, 0x00]));
|
14199
14199
|
};
|
14200
14200
|
MP4.mdia = function mdia(track) {
|
14201
|
-
return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));
|
14201
|
+
return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale || 0, track.duration || 0), MP4.hdlr(track.type), MP4.minf(track));
|
14202
14202
|
};
|
14203
14203
|
MP4.mfhd = function mfhd(sequenceNumber) {
|
14204
14204
|
return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00,
|
@@ -14222,7 +14222,7 @@
|
|
14222
14222
|
while (i--) {
|
14223
14223
|
boxes[i] = MP4.trak(tracks[i]);
|
14224
14224
|
}
|
14225
|
-
return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));
|
14225
|
+
return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale || 0, tracks[0].duration || 0)].concat(boxes).concat(MP4.mvex(tracks)));
|
14226
14226
|
};
|
14227
14227
|
MP4.mvex = function mvex(tracks) {
|
14228
14228
|
var i = tracks.length;
|
@@ -14406,7 +14406,7 @@
|
|
14406
14406
|
]));
|
14407
14407
|
};
|
14408
14408
|
MP4.audioStsd = function audioStsd(track) {
|
14409
|
-
var samplerate = track.samplerate;
|
14409
|
+
var samplerate = track.samplerate || 0;
|
14410
14410
|
return new Uint8Array([0x00, 0x00, 0x00,
|
14411
14411
|
// reserved
|
14412
14412
|
0x00, 0x00, 0x00,
|
@@ -14415,7 +14415,7 @@
|
|
14415
14415
|
// data_reference_index
|
14416
14416
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
14417
14417
|
// reserved
|
14418
|
-
0x00, track.channelCount,
|
14418
|
+
0x00, track.channelCount || 0,
|
14419
14419
|
// channelcount
|
14420
14420
|
0x00, 0x10,
|
14421
14421
|
// sampleSize:16bits
|
@@ -14435,25 +14435,36 @@
|
|
14435
14435
|
return MP4.box(MP4.types['ac-3'], MP4.audioStsd(track), MP4.box(MP4.types.dac3, track.config));
|
14436
14436
|
};
|
14437
14437
|
MP4.stsd = function stsd(track) {
|
14438
|
+
var segmentCodec = track.segmentCodec;
|
14438
14439
|
if (track.type === 'audio') {
|
14439
|
-
if (
|
14440
|
-
return MP4.box(MP4.types.stsd, MP4.STSD, MP4.
|
14440
|
+
if (segmentCodec === 'aac') {
|
14441
|
+
return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));
|
14441
14442
|
}
|
14442
|
-
if (
|
14443
|
+
if (segmentCodec === 'ac3' && track.config) {
|
14443
14444
|
return MP4.box(MP4.types.stsd, MP4.STSD, MP4.ac3(track));
|
14444
14445
|
}
|
14445
|
-
|
14446
|
-
|
14447
|
-
|
14446
|
+
if (segmentCodec === 'mp3' && track.codec === 'mp3') {
|
14447
|
+
return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));
|
14448
|
+
}
|
14448
14449
|
} else {
|
14449
|
-
|
14450
|
+
if (track.pps && track.sps) {
|
14451
|
+
if (segmentCodec === 'avc') {
|
14452
|
+
return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));
|
14453
|
+
}
|
14454
|
+
if (segmentCodec === 'hevc' && track.vps) {
|
14455
|
+
return MP4.box(MP4.types.stsd, MP4.STSD, MP4.hvc1(track));
|
14456
|
+
}
|
14457
|
+
} else {
|
14458
|
+
throw new Error("video track missing pps or sps");
|
14459
|
+
}
|
14450
14460
|
}
|
14461
|
+
throw new Error("unsupported " + track.type + " segment codec (" + segmentCodec + "/" + track.codec + ")");
|
14451
14462
|
};
|
14452
14463
|
MP4.tkhd = function tkhd(track) {
|
14453
14464
|
var id = track.id;
|
14454
|
-
var duration = track.duration * track.timescale;
|
14455
|
-
var width = track.width;
|
14456
|
-
var height = track.height;
|
14465
|
+
var duration = (track.duration || 0) * (track.timescale || 0);
|
14466
|
+
var width = track.width || 0;
|
14467
|
+
var height = track.height || 0;
|
14457
14468
|
var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));
|
14458
14469
|
var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));
|
14459
14470
|
return MP4.box(MP4.types.tkhd, new Uint8Array([0x01,
|
@@ -14712,6 +14723,21 @@
|
|
14712
14723
|
var AC3_SAMPLES_PER_FRAME = 1536;
|
14713
14724
|
var chromeVersion = null;
|
14714
14725
|
var safariWebkitVersion = null;
|
14726
|
+
function createMp4Sample(isKeyframe, duration, size, cts) {
|
14727
|
+
return {
|
14728
|
+
duration: duration,
|
14729
|
+
size: size,
|
14730
|
+
cts: cts,
|
14731
|
+
flags: {
|
14732
|
+
isLeading: 0,
|
14733
|
+
isDependedOn: 0,
|
14734
|
+
hasRedundancy: 0,
|
14735
|
+
degradPrio: 0,
|
14736
|
+
dependsOn: isKeyframe ? 2 : 1,
|
14737
|
+
isNonSync: isKeyframe ? 0 : 1
|
14738
|
+
}
|
14739
|
+
};
|
14740
|
+
}
|
14715
14741
|
var MP4Remuxer = /*#__PURE__*/function () {
|
14716
14742
|
function MP4Remuxer(observer, config, typeSupported, logger) {
|
14717
14743
|
this.logger = void 0;
|
@@ -15211,7 +15237,7 @@
|
|
15211
15237
|
maxDtsDelta = Math.max(maxDtsDelta, mp4SampleDuration);
|
15212
15238
|
minPtsDelta = Math.min(minPtsDelta, ptsDelta);
|
15213
15239
|
maxPtsDelta = Math.max(maxPtsDelta, ptsDelta);
|
15214
|
-
outputSamples.push(
|
15240
|
+
outputSamples.push(createMp4Sample(VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
|
15215
15241
|
}
|
15216
15242
|
if (outputSamples.length) {
|
15217
15243
|
if (chromeVersion) {
|
@@ -15248,7 +15274,7 @@
|
|
15248
15274
|
this.nextAvcDts = nextAvcDts = lastDTS + mp4SampleDuration;
|
15249
15275
|
this.videoSampleDuration = mp4SampleDuration;
|
15250
15276
|
this.isVideoContiguous = true;
|
15251
|
-
var moof = MP4.moof(track.sequenceNumber++, firstDTS, _extends(
|
15277
|
+
var moof = MP4.moof(track.sequenceNumber++, firstDTS, _extends(track, {
|
15252
15278
|
samples: outputSamples
|
15253
15279
|
}));
|
15254
15280
|
var type = 'video';
|
@@ -15452,7 +15478,7 @@
|
|
15452
15478
|
// Default the sample's duration to the computed mp4SampleDuration, which will either be 1024 for AAC or 1152 for MPEG
|
15453
15479
|
// In the case that we have 1 sample, this will be the duration. If we have more than one sample, the duration
|
15454
15480
|
// becomes the PTS diff with the previous sample
|
15455
|
-
outputSamples.push(
|
15481
|
+
outputSamples.push(createMp4Sample(true, mp4SampleDuration, unitLen, 0));
|
15456
15482
|
lastPTS = _pts2;
|
15457
15483
|
}
|
15458
15484
|
|
@@ -15561,23 +15587,6 @@
|
|
15561
15587
|
samples: samples
|
15562
15588
|
};
|
15563
15589
|
}
|
15564
|
-
var Mp4Sample = function Mp4Sample(isKeyframe, duration, size, cts) {
|
15565
|
-
this.size = void 0;
|
15566
|
-
this.duration = void 0;
|
15567
|
-
this.cts = void 0;
|
15568
|
-
this.flags = void 0;
|
15569
|
-
this.duration = duration;
|
15570
|
-
this.size = size;
|
15571
|
-
this.cts = cts;
|
15572
|
-
this.flags = {
|
15573
|
-
isLeading: 0,
|
15574
|
-
isDependedOn: 0,
|
15575
|
-
hasRedundancy: 0,
|
15576
|
-
degradPrio: 0,
|
15577
|
-
dependsOn: isKeyframe ? 2 : 1,
|
15578
|
-
isNonSync: isKeyframe ? 0 : 1
|
15579
|
-
};
|
15580
|
-
};
|
15581
15590
|
|
15582
15591
|
var PassThroughRemuxer = /*#__PURE__*/function () {
|
15583
15592
|
function PassThroughRemuxer(observer, config, typeSupported, logger) {
|
@@ -16311,7 +16320,7 @@
|
|
16311
16320
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
16312
16321
|
}
|
16313
16322
|
|
16314
|
-
var version = "1.6.0-beta.2.0.canary.
|
16323
|
+
var version = "1.6.0-beta.2.0.canary.10877";
|
16315
16324
|
|
16316
16325
|
// ensure the worker ends up in the bundle
|
16317
16326
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -21764,121 +21773,143 @@
|
|
21764
21773
|
if (initData === null) {
|
21765
21774
|
return;
|
21766
21775
|
}
|
21767
|
-
|
21768
|
-
var keySystemDomain;
|
21769
|
-
if (initDataType === 'sinf' && _this.getLicenseServerUrl(KeySystems.FAIRPLAY)) {
|
21770
|
-
// Match sinf keyId to playlist skd://keyId=
|
21771
|
-
var json = bin2str(new Uint8Array(initData));
|
21772
|
-
try {
|
21773
|
-
var sinf = base64Decode(JSON.parse(json).sinf);
|
21774
|
-
var tenc = parseSinf(sinf);
|
21775
|
-
if (!tenc) {
|
21776
|
-
throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");
|
21777
|
-
}
|
21778
|
-
keyId = tenc.subarray(8, 24);
|
21779
|
-
keySystemDomain = KeySystems.FAIRPLAY;
|
21780
|
-
} catch (error) {
|
21781
|
-
_this.warn(logMessage + " Failed to parse sinf: " + error);
|
21782
|
-
return;
|
21783
|
-
}
|
21784
|
-
} else if (_this.getLicenseServerUrl(KeySystems.WIDEVINE)) {
|
21785
|
-
// Support Widevine clear-lead key-session creation (otherwise depend on playlist keys)
|
21786
|
-
var psshResults = parseMultiPssh(initData);
|
21787
|
-
|
21788
|
-
// TODO: If using keySystemAccessPromises we might want to wait until one is resolved
|
21776
|
+
if (!_this.keyFormatPromise) {
|
21789
21777
|
var keySystems = Object.keys(_this.keySystemAccessPromises);
|
21790
21778
|
if (!keySystems.length) {
|
21791
21779
|
keySystems = getKeySystemsForConfig(_this.config);
|
21792
21780
|
}
|
21793
|
-
var
|
21794
|
-
|
21795
|
-
|
21796
|
-
|
21797
|
-
|
21798
|
-
|
21799
|
-
|
21800
|
-
|
21801
|
-
|
21802
|
-
|
21803
|
-
|
21804
|
-
|
21805
|
-
|
21781
|
+
var keyFormats = keySystems.map(keySystemDomainToKeySystemFormat).filter(function (k) {
|
21782
|
+
return !!k;
|
21783
|
+
});
|
21784
|
+
_this.keyFormatPromise = _this.getKeyFormatPromise(keyFormats);
|
21785
|
+
}
|
21786
|
+
_this.keyFormatPromise.then(function (keySystemFormat) {
|
21787
|
+
var keySystem = keySystemFormatToKeySystemDomain(keySystemFormat);
|
21788
|
+
var keyId;
|
21789
|
+
var keySystemDomain;
|
21790
|
+
if (initDataType === 'sinf') {
|
21791
|
+
if (keySystem !== KeySystems.FAIRPLAY) {
|
21792
|
+
_this.warn("Ignoring unexpected \"" + event.type + "\" event with init data type: \"" + initDataType + "\" for selected key-system " + keySystem);
|
21793
|
+
return;
|
21806
21794
|
}
|
21807
|
-
|
21808
|
-
|
21809
|
-
|
21810
|
-
|
21811
|
-
|
21812
|
-
|
21813
|
-
|
21814
|
-
|
21815
|
-
keyId =
|
21795
|
+
// Match sinf keyId to playlist skd://keyId=
|
21796
|
+
var json = bin2str(new Uint8Array(initData));
|
21797
|
+
try {
|
21798
|
+
var sinf = base64Decode(JSON.parse(json).sinf);
|
21799
|
+
var tenc = parseSinf(sinf);
|
21800
|
+
if (!tenc) {
|
21801
|
+
throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");
|
21802
|
+
}
|
21803
|
+
keyId = tenc.subarray(8, 24);
|
21804
|
+
keySystemDomain = KeySystems.FAIRPLAY;
|
21805
|
+
} catch (error) {
|
21806
|
+
_this.warn(logMessage + " Failed to parse sinf: " + error);
|
21807
|
+
return;
|
21816
21808
|
}
|
21817
|
-
}
|
21818
|
-
|
21819
|
-
|
21820
|
-
|
21821
|
-
|
21822
|
-
|
21823
|
-
|
21824
|
-
|
21825
|
-
|
21826
|
-
|
21827
|
-
|
21828
|
-
|
21829
|
-
|
21830
|
-
var
|
21831
|
-
if (!
|
21832
|
-
|
21809
|
+
} else {
|
21810
|
+
if (keySystem !== KeySystems.WIDEVINE && keySystem !== KeySystems.PLAYREADY) {
|
21811
|
+
_this.warn("Ignoring unexpected \"" + event.type + "\" event with init data type: \"" + initDataType + "\" for selected key-system " + keySystem);
|
21812
|
+
return;
|
21813
|
+
}
|
21814
|
+
// Support Widevine/PlayReady clear-lead key-session creation (otherwise depend on playlist keys)
|
21815
|
+
var psshResults = parseMultiPssh(initData);
|
21816
|
+
var psshInfos = psshResults.filter(function (pssh) {
|
21817
|
+
return !!pssh.systemId && keySystemIdToKeySystemDomain(pssh.systemId) === keySystem;
|
21818
|
+
});
|
21819
|
+
if (psshInfos.length) {
|
21820
|
+
_this.warn(logMessage + " Using first of " + psshInfos.length + " pssh found for selected key-system " + keySystem);
|
21821
|
+
}
|
21822
|
+
var psshInfo = psshInfos[0];
|
21823
|
+
if (!psshInfo) {
|
21824
|
+
if (psshResults.length === 0 || psshResults.some(function (pssh) {
|
21825
|
+
return !pssh.systemId;
|
21826
|
+
})) {
|
21827
|
+
_this.warn(logMessage + " contains incomplete or invalid pssh data");
|
21828
|
+
} else {
|
21829
|
+
_this.log("ignoring " + logMessage + " for " + psshResults.map(function (pssh) {
|
21830
|
+
return keySystemIdToKeySystemDomain(pssh.systemId);
|
21831
|
+
}).join(',') + " pssh data in favor of playlist keys");
|
21832
|
+
}
|
21833
|
+
return;
|
21833
21834
|
}
|
21834
|
-
|
21835
|
-
if (
|
21836
|
-
|
21837
|
-
|
21835
|
+
keySystemDomain = keySystemIdToKeySystemDomain(psshInfo.systemId);
|
21836
|
+
if (psshInfo.version === 0 && psshInfo.data) {
|
21837
|
+
if (keySystemDomain === KeySystems.WIDEVINE) {
|
21838
|
+
var offset = psshInfo.data.length - 22;
|
21839
|
+
keyId = psshInfo.data.subarray(offset, offset + 16);
|
21840
|
+
} else if (keySystemDomain === KeySystems.PLAYREADY) {
|
21841
|
+
keyId = parsePlayReadyWRM(psshInfo.data);
|
21842
|
+
}
|
21843
|
+
}
|
21844
|
+
}
|
21845
|
+
if (!keySystemDomain || !keyId) {
|
21846
|
+
return;
|
21847
|
+
}
|
21848
|
+
var keyIdHex = Hex.hexDump(keyId);
|
21849
|
+
var _this2 = _this,
|
21850
|
+
keyIdToKeySessionPromise = _this2.keyIdToKeySessionPromise,
|
21851
|
+
mediaKeySessions = _this2.mediaKeySessions;
|
21852
|
+
var keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex];
|
21853
|
+
var _loop = function _loop() {
|
21854
|
+
// Match playlist key
|
21855
|
+
var keyContext = mediaKeySessions[i];
|
21856
|
+
var decryptdata = keyContext.decryptdata;
|
21857
|
+
if (!decryptdata.keyId) {
|
21858
|
+
return 0; // continue
|
21859
|
+
}
|
21860
|
+
var oldKeyIdHex = Hex.hexDump(decryptdata.keyId);
|
21861
|
+
if (keyIdHex === oldKeyIdHex || decryptdata.uri.replace(/-/g, '').indexOf(keyIdHex) !== -1) {
|
21862
|
+
keySessionContextPromise = keyIdToKeySessionPromise[oldKeyIdHex];
|
21863
|
+
if (decryptdata.pssh) {
|
21864
|
+
return 1; // break
|
21865
|
+
}
|
21866
|
+
delete keyIdToKeySessionPromise[oldKeyIdHex];
|
21867
|
+
decryptdata.pssh = new Uint8Array(initData);
|
21868
|
+
decryptdata.keyId = keyId;
|
21869
|
+
keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = keySessionContextPromise.then(function () {
|
21870
|
+
return _this.generateRequestWithPreferredKeySession(keyContext, initDataType, initData, 'encrypted-event-key-match');
|
21871
|
+
});
|
21872
|
+
keySessionContextPromise.catch(function (error) {
|
21873
|
+
return _this.handleError(error);
|
21874
|
+
});
|
21838
21875
|
return 1; // break
|
21839
21876
|
}
|
21840
|
-
|
21841
|
-
|
21842
|
-
|
21843
|
-
|
21844
|
-
|
21845
|
-
|
21846
|
-
|
21847
|
-
|
21848
|
-
|
21849
|
-
|
21877
|
+
},
|
21878
|
+
_ret;
|
21879
|
+
for (var i = 0; i < mediaKeySessions.length; i++) {
|
21880
|
+
_ret = _loop();
|
21881
|
+
if (_ret === 0) continue;
|
21882
|
+
if (_ret === 1) break;
|
21883
|
+
}
|
21884
|
+
if (!keySessionContextPromise) {
|
21885
|
+
if (keySystemDomain !== keySystem) {
|
21886
|
+
_this.log("Ignoring \"" + event.type + "\" event with " + keySystemDomain + " init data for selected key-system " + keySystem);
|
21887
|
+
return;
|
21850
21888
|
}
|
21851
|
-
|
21852
|
-
|
21853
|
-
|
21854
|
-
|
21855
|
-
|
21856
|
-
if (_ret === 1) break;
|
21857
|
-
}
|
21858
|
-
if (!keySessionContextPromise) {
|
21859
|
-
// Clear-lead key (not encountered in playlist)
|
21860
|
-
keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = _this.getKeySystemSelectionPromise([keySystemDomain]).then(function (_ref) {
|
21861
|
-
var _keySystemToKeySystem;
|
21862
|
-
var keySystem = _ref.keySystem,
|
21863
|
-
mediaKeys = _ref.mediaKeys;
|
21864
|
-
_this.throwIfDestroyed();
|
21865
|
-
var decryptdata = new LevelKey('ISO-23001-7', keyIdHex, (_keySystemToKeySystem = keySystemDomainToKeySystemFormat(keySystem)) != null ? _keySystemToKeySystem : '');
|
21866
|
-
decryptdata.pssh = new Uint8Array(initData);
|
21867
|
-
decryptdata.keyId = keyId;
|
21868
|
-
return _this.attemptSetMediaKeys(keySystem, mediaKeys).then(function () {
|
21889
|
+
// "Clear-lead" (misc key not encountered in playlist)
|
21890
|
+
keySessionContextPromise = keyIdToKeySessionPromise[keyIdHex] = _this.getKeySystemSelectionPromise([keySystemDomain]).then(function (_ref) {
|
21891
|
+
var _keySystemToKeySystem;
|
21892
|
+
var keySystem = _ref.keySystem,
|
21893
|
+
mediaKeys = _ref.mediaKeys;
|
21869
21894
|
_this.throwIfDestroyed();
|
21870
|
-
var
|
21871
|
-
|
21872
|
-
|
21873
|
-
|
21895
|
+
var decryptdata = new LevelKey('ISO-23001-7', keyIdHex, (_keySystemToKeySystem = keySystemDomainToKeySystemFormat(keySystem)) != null ? _keySystemToKeySystem : '');
|
21896
|
+
decryptdata.pssh = new Uint8Array(initData);
|
21897
|
+
decryptdata.keyId = keyId;
|
21898
|
+
return _this.attemptSetMediaKeys(keySystem, mediaKeys).then(function () {
|
21899
|
+
_this.throwIfDestroyed();
|
21900
|
+
var keySessionContext = _this.createMediaKeySessionContext({
|
21901
|
+
decryptdata: decryptdata,
|
21902
|
+
keySystem: keySystem,
|
21903
|
+
mediaKeys: mediaKeys
|
21904
|
+
});
|
21905
|
+
return _this.generateRequestWithPreferredKeySession(keySessionContext, initDataType, initData, 'encrypted-event-no-match');
|
21874
21906
|
});
|
21875
|
-
return _this.generateRequestWithPreferredKeySession(keySessionContext, initDataType, initData, 'encrypted-event-no-match');
|
21876
21907
|
});
|
21877
|
-
|
21878
|
-
|
21879
|
-
|
21880
|
-
}
|
21881
|
-
}
|
21908
|
+
keySessionContextPromise.catch(function (error) {
|
21909
|
+
return _this.handleError(error);
|
21910
|
+
});
|
21911
|
+
}
|
21912
|
+
});
|
21882
21913
|
};
|
21883
21914
|
_this.onWaitingForKey = function (event) {
|
21884
21915
|
_this.log("\"" + event.type + "\" event");
|
@@ -33463,7 +33494,7 @@
|
|
33463
33494
|
};
|
33464
33495
|
_proto.load = function load(frag) {
|
33465
33496
|
var _this2 = this;
|
33466
|
-
if (!frag.decryptdata && frag.encrypted && this.emeController) {
|
33497
|
+
if (!frag.decryptdata && frag.encrypted && this.emeController && this.config.emeEnabled) {
|
33467
33498
|
// Multiple keys, but none selected, resolve in eme-controller
|
33468
33499
|
return this.emeController.selectKeySystemFormat(frag).then(function (keySystemFormat) {
|
33469
33500
|
return _this2.loadInternal(frag, keySystemFormat);
|