hls.js 1.6.0-beta.2.0.canary.10880 → 1.6.0-beta.2.0.canary.10882
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-demo.js +16 -16
- package/dist/hls-demo.js.map +1 -1
- package/dist/hls.js +653 -653
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +473 -473
- 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 +411 -411
- 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 +570 -570
- 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 +2 -2
package/dist/hls.mjs
CHANGED
@@ -173,10 +173,10 @@ var PlaylistLevelType = {
|
|
173
173
|
class EWMA {
|
174
174
|
// About half of the estimated value will be from the last |halfLife| samples by weight.
|
175
175
|
constructor(halfLife, estimate = 0, weight = 0) {
|
176
|
-
this.halfLife =
|
177
|
-
this.alpha_ =
|
178
|
-
this.estimate_ =
|
179
|
-
this.totalWeight_ =
|
176
|
+
this.halfLife = undefined;
|
177
|
+
this.alpha_ = undefined;
|
178
|
+
this.estimate_ = undefined;
|
179
|
+
this.totalWeight_ = undefined;
|
180
180
|
this.halfLife = halfLife;
|
181
181
|
// Larger values of alpha expire historical data more slowly.
|
182
182
|
this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;
|
@@ -212,13 +212,13 @@ class EWMA {
|
|
212
212
|
|
213
213
|
class EwmaBandWidthEstimator {
|
214
214
|
constructor(slow, fast, defaultEstimate, defaultTTFB = 100) {
|
215
|
-
this.defaultEstimate_ =
|
216
|
-
this.minWeight_ =
|
217
|
-
this.minDelayMs_ =
|
218
|
-
this.slow_ =
|
219
|
-
this.fast_ =
|
220
|
-
this.defaultTTFB_ =
|
221
|
-
this.ttfb_ =
|
215
|
+
this.defaultEstimate_ = undefined;
|
216
|
+
this.minWeight_ = undefined;
|
217
|
+
this.minDelayMs_ = undefined;
|
218
|
+
this.slow_ = undefined;
|
219
|
+
this.fast_ = undefined;
|
220
|
+
this.defaultTTFB_ = undefined;
|
221
|
+
this.ttfb_ = undefined;
|
222
222
|
this.defaultEstimate_ = defaultEstimate;
|
223
223
|
this.minWeight_ = 0.001;
|
224
224
|
this.minDelayMs_ = 50;
|
@@ -290,9 +290,9 @@ class EwmaBandWidthEstimator {
|
|
290
290
|
function _defineProperty(e, r, t) {
|
291
291
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
292
292
|
value: t,
|
293
|
-
enumerable:
|
294
|
-
configurable:
|
295
|
-
writable:
|
293
|
+
enumerable: true,
|
294
|
+
configurable: true,
|
295
|
+
writable: true
|
296
296
|
}) : e[r] = t, e;
|
297
297
|
}
|
298
298
|
function _extends() {
|
@@ -317,7 +317,7 @@ function ownKeys(e, r) {
|
|
317
317
|
function _objectSpread2(e) {
|
318
318
|
for (var r = 1; r < arguments.length; r++) {
|
319
319
|
var t = null != arguments[r] ? arguments[r] : {};
|
320
|
-
r % 2 ? ownKeys(Object(t),
|
320
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
321
321
|
_defineProperty(e, r, t[r]);
|
322
322
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
323
323
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
@@ -328,7 +328,7 @@ function _objectSpread2(e) {
|
|
328
328
|
function _toPrimitive(t, r) {
|
329
329
|
if ("object" != typeof t || !t) return t;
|
330
330
|
var e = t[Symbol.toPrimitive];
|
331
|
-
if (
|
331
|
+
if (undefined !== e) {
|
332
332
|
var i = e.call(t, r || "default");
|
333
333
|
if ("object" != typeof i) return i;
|
334
334
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
@@ -342,12 +342,12 @@ function _toPropertyKey(t) {
|
|
342
342
|
|
343
343
|
class Logger {
|
344
344
|
constructor(label, logger) {
|
345
|
-
this.trace =
|
346
|
-
this.debug =
|
347
|
-
this.log =
|
348
|
-
this.warn =
|
349
|
-
this.info =
|
350
|
-
this.error =
|
345
|
+
this.trace = undefined;
|
346
|
+
this.debug = undefined;
|
347
|
+
this.log = undefined;
|
348
|
+
this.warn = undefined;
|
349
|
+
this.info = undefined;
|
350
|
+
this.error = undefined;
|
351
351
|
const lb = `[${label}]:`;
|
352
352
|
this.trace = noop;
|
353
353
|
this.debug = logger.debug.bind(null, lb);
|
@@ -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.
|
404
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10882"}`);
|
405
405
|
} catch (e) {
|
406
406
|
/* log fn threw an exception. All logger methods are no-ops. */
|
407
407
|
return createLogger();
|
@@ -524,7 +524,7 @@ function areCodecsMediaSourceSupported(codecs, type, preferManagedMediaSource =
|
|
524
524
|
function isCodecMediaSourceSupported(codec, type, preferManagedMediaSource = true) {
|
525
525
|
var _MediaSource$isTypeSu;
|
526
526
|
const MediaSource = getMediaSource(preferManagedMediaSource);
|
527
|
-
return (_MediaSource$isTypeSu = MediaSource == null ?
|
527
|
+
return (_MediaSource$isTypeSu = MediaSource == null ? undefined : MediaSource.isTypeSupported(mimeTypeForCodec(codec, type))) != null ? _MediaSource$isTypeSu : false;
|
528
528
|
}
|
529
529
|
function mimeTypeForCodec(codec, type) {
|
530
530
|
return `${type}/mp4;codecs=${codec}`;
|
@@ -647,8 +647,8 @@ const SUPPORTED_INFO_CACHE = {};
|
|
647
647
|
function requiresMediaCapabilitiesDecodingInfo(level, audioTracksByGroup, currentVideoRange, currentFrameRate, currentBw, audioPreference) {
|
648
648
|
// Only test support when configuration is exceeds minimum options
|
649
649
|
const audioGroups = level.audioCodec ? level.audioGroups : null;
|
650
|
-
const audioCodecPreference = audioPreference == null ?
|
651
|
-
const channelsPreference = audioPreference == null ?
|
650
|
+
const audioCodecPreference = audioPreference == null ? undefined : audioPreference.audioCodec;
|
651
|
+
const channelsPreference = audioPreference == null ? undefined : audioPreference.channels;
|
652
652
|
const maxChannels = channelsPreference ? parseInt(channelsPreference) : audioCodecPreference ? Infinity : 2;
|
653
653
|
let audioChannels = null;
|
654
654
|
if (audioGroups != null && audioGroups.length) {
|
@@ -710,7 +710,7 @@ function getMediaDecodingInfoPromise(level, audioTracksByGroup, mediaCapabilitie
|
|
710
710
|
if (!audioGroupId) {
|
711
711
|
return;
|
712
712
|
}
|
713
|
-
(_audioTracksByGroup$g = audioTracksByGroup.groups[audioGroupId]) == null ?
|
713
|
+
(_audioTracksByGroup$g = audioTracksByGroup.groups[audioGroupId]) == null ? undefined : _audioTracksByGroup$g.tracks.forEach(audioTrack => {
|
714
714
|
if (audioTrack.groupId === audioGroupId) {
|
715
715
|
const channels = audioTrack.channels || '';
|
716
716
|
const channelsNumber = parseFloat(channels);
|
@@ -795,9 +795,9 @@ function getSkipValue(details) {
|
|
795
795
|
}
|
796
796
|
class HlsUrlParameters {
|
797
797
|
constructor(msn, part, skip) {
|
798
|
-
this.msn =
|
799
|
-
this.part =
|
800
|
-
this.skip =
|
798
|
+
this.msn = undefined;
|
799
|
+
this.part = undefined;
|
800
|
+
this.skip = undefined;
|
801
801
|
this.msn = msn;
|
802
802
|
this.part = part;
|
803
803
|
this.skip = skip;
|
@@ -818,27 +818,27 @@ class HlsUrlParameters {
|
|
818
818
|
}
|
819
819
|
class Level {
|
820
820
|
constructor(data) {
|
821
|
-
this._attrs =
|
822
|
-
this.audioCodec =
|
823
|
-
this.bitrate =
|
824
|
-
this.codecSet =
|
825
|
-
this.url =
|
826
|
-
this.frameRate =
|
827
|
-
this.height =
|
828
|
-
this.id =
|
829
|
-
this.name =
|
830
|
-
this.videoCodec =
|
831
|
-
this.width =
|
832
|
-
this.details =
|
821
|
+
this._attrs = undefined;
|
822
|
+
this.audioCodec = undefined;
|
823
|
+
this.bitrate = undefined;
|
824
|
+
this.codecSet = undefined;
|
825
|
+
this.url = undefined;
|
826
|
+
this.frameRate = undefined;
|
827
|
+
this.height = undefined;
|
828
|
+
this.id = undefined;
|
829
|
+
this.name = undefined;
|
830
|
+
this.videoCodec = undefined;
|
831
|
+
this.width = undefined;
|
832
|
+
this.details = undefined;
|
833
833
|
this.fragmentError = 0;
|
834
834
|
this.loadError = 0;
|
835
|
-
this.loaded =
|
835
|
+
this.loaded = undefined;
|
836
836
|
this.realBitrate = 0;
|
837
|
-
this.supportedPromise =
|
838
|
-
this.supportedResult =
|
837
|
+
this.supportedPromise = undefined;
|
838
|
+
this.supportedResult = undefined;
|
839
839
|
this._avgBitrate = 0;
|
840
|
-
this._audioGroups =
|
841
|
-
this._subtitleGroups =
|
840
|
+
this._audioGroups = undefined;
|
841
|
+
this._subtitleGroups = undefined;
|
842
842
|
// Deprecated (retained for backwards compatibility)
|
843
843
|
this._urlId = 0;
|
844
844
|
this.url = [data.url];
|
@@ -931,11 +931,11 @@ class Level {
|
|
931
931
|
}
|
932
932
|
get audioGroupId() {
|
933
933
|
var _this$audioGroups;
|
934
|
-
return (_this$audioGroups = this.audioGroups) == null ?
|
934
|
+
return (_this$audioGroups = this.audioGroups) == null ? undefined : _this$audioGroups[0];
|
935
935
|
}
|
936
936
|
get textGroupId() {
|
937
937
|
var _this$subtitleGroups;
|
938
|
-
return (_this$subtitleGroups = this.subtitleGroups) == null ?
|
938
|
+
return (_this$subtitleGroups = this.subtitleGroups) == null ? undefined : _this$subtitleGroups[0];
|
939
939
|
}
|
940
940
|
addFallback() {}
|
941
941
|
}
|
@@ -1002,9 +1002,9 @@ function getVideoSelectionOptions(currentVideoRange, videoPreference) {
|
|
1002
1002
|
|
1003
1003
|
function getStartCodecTier(codecTiers, currentVideoRange, currentBw, audioPreference, videoPreference) {
|
1004
1004
|
const codecSets = Object.keys(codecTiers);
|
1005
|
-
const channelsPreference = audioPreference == null ?
|
1006
|
-
const audioCodecPreference = audioPreference == null ?
|
1007
|
-
const videoCodecPreference = videoPreference == null ?
|
1005
|
+
const channelsPreference = audioPreference == null ? undefined : audioPreference.channels;
|
1006
|
+
const audioCodecPreference = audioPreference == null ? undefined : audioPreference.audioCodec;
|
1007
|
+
const videoCodecPreference = videoPreference == null ? undefined : videoPreference.videoCodec;
|
1008
1008
|
const preferStereo = channelsPreference && parseInt(channelsPreference) === 2;
|
1009
1009
|
// Use first level set to determine stereo, and minimum resolution and framerate
|
1010
1010
|
let hasStereo = false;
|
@@ -1308,13 +1308,13 @@ function searchDownAndUpList(arr, searchIndex, predicate) {
|
|
1308
1308
|
}
|
1309
1309
|
function useAlternateAudio(audioTrackUrl, hls) {
|
1310
1310
|
var _hls$levels$hls$loadL;
|
1311
|
-
return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ?
|
1311
|
+
return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ? undefined : _hls$levels$hls$loadL.uri);
|
1312
1312
|
}
|
1313
1313
|
|
1314
1314
|
class AbrController extends Logger {
|
1315
1315
|
constructor(_hls) {
|
1316
1316
|
super('abr', _hls.logger);
|
1317
|
-
this.hls =
|
1317
|
+
this.hls = undefined;
|
1318
1318
|
this.lastLevelLoadSec = 0;
|
1319
1319
|
this.lastLoadedFragLevel = -1;
|
1320
1320
|
this.firstSelection = -1;
|
@@ -1326,7 +1326,7 @@ class AbrController extends Logger {
|
|
1326
1326
|
this.fragCurrent = null;
|
1327
1327
|
this.partCurrent = null;
|
1328
1328
|
this.bitrateTestDelay = 0;
|
1329
|
-
this.bwEstimator =
|
1329
|
+
this.bwEstimator = undefined;
|
1330
1330
|
/*
|
1331
1331
|
This method monitors the download rate of the current fragment, and will downswitch if that fragment will not load
|
1332
1332
|
quickly enough to prevent underbuffering
|
@@ -1394,7 +1394,7 @@ class AbrController extends Logger {
|
|
1394
1394
|
return;
|
1395
1395
|
}
|
1396
1396
|
const bwe = loadRate ? loadRate * 8 : bwEstimate;
|
1397
|
-
const live = ((_this$hls$latestLevel = this.hls.latestLevelDetails) == null ?
|
1397
|
+
const live = ((_this$hls$latestLevel = this.hls.latestLevelDetails) == null ? undefined : _this$hls$latestLevel.live) === true;
|
1398
1398
|
const abrBandWidthUpFactor = this.hls.config.abrBandWidthUpFactor;
|
1399
1399
|
let fragLevelNextLoadedDelay = Number.POSITIVE_INFINITY;
|
1400
1400
|
let nextLoadLevel;
|
@@ -1803,7 +1803,7 @@ class AbrController extends Logger {
|
|
1803
1803
|
// If no matching level found, see if min auto level would be a better option
|
1804
1804
|
const minLevel = hls.levels[minAutoLevel];
|
1805
1805
|
const autoLevel = hls.levels[hls.loadLevel];
|
1806
|
-
if ((minLevel == null ?
|
1806
|
+
if ((minLevel == null ? undefined : minLevel.bitrate) < (autoLevel == null ? undefined : autoLevel.bitrate)) {
|
1807
1807
|
return minAutoLevel;
|
1808
1808
|
}
|
1809
1809
|
// or if bitrate is not lower, continue to use loadLevel
|
@@ -1847,7 +1847,7 @@ class AbrController extends Logger {
|
|
1847
1847
|
const firstSelection = loadLevel === -1 || lastLoadedFragLevel === -1;
|
1848
1848
|
let currentCodecSet;
|
1849
1849
|
let currentVideoRange = 'SDR';
|
1850
|
-
let currentFrameRate = (level == null ?
|
1850
|
+
let currentFrameRate = (level == null ? undefined : level.frameRate) || 0;
|
1851
1851
|
const {
|
1852
1852
|
audioPreference,
|
1853
1853
|
videoPreference
|
@@ -1875,8 +1875,8 @@ class AbrController extends Logger {
|
|
1875
1875
|
currentBw = Math.max(currentBw, minBitrate);
|
1876
1876
|
this.log(`picked start tier ${JSON.stringify(startTier)}`);
|
1877
1877
|
} else {
|
1878
|
-
currentCodecSet = level == null ?
|
1879
|
-
currentVideoRange = level == null ?
|
1878
|
+
currentCodecSet = level == null ? undefined : level.codecSet;
|
1879
|
+
currentVideoRange = level == null ? undefined : level.videoRange;
|
1880
1880
|
}
|
1881
1881
|
const currentFragDuration = partCurrent ? partCurrent.duration : fragCurrent ? fragCurrent.duration : 0;
|
1882
1882
|
const ttfbEstimateSec = this.bwEstimator.getEstimateTTFB() / 1000;
|
@@ -1891,7 +1891,7 @@ class AbrController extends Logger {
|
|
1891
1891
|
if (config.useMediaCapabilities && !levelInfo.supportedResult && !levelInfo.supportedPromise) {
|
1892
1892
|
var _levelInfo$videoCodec;
|
1893
1893
|
const mediaCapabilities = navigator.mediaCapabilities;
|
1894
|
-
if (typeof (mediaCapabilities == null ?
|
1894
|
+
if (typeof (mediaCapabilities == null ? undefined : mediaCapabilities.decodingInfo) === 'function' && (requiresMediaCapabilitiesDecodingInfo(levelInfo, audioTracksByGroup, currentVideoRange, currentFrameRate, currentBw, audioPreference) || ((_levelInfo$videoCodec = levelInfo.videoCodec) == null ? undefined : _levelInfo$videoCodec.substring(0, 4)) === 'hvc1') // Force media capabilities check for HEVC to avoid failure on Windows
|
1895
1895
|
) {
|
1896
1896
|
levelInfo.supportedPromise = getMediaDecodingInfoPromise(levelInfo, audioTracksByGroup, mediaCapabilities);
|
1897
1897
|
levelInfo.supportedPromise.then(decodingInfo => {
|
@@ -1928,7 +1928,7 @@ class AbrController extends Logger {
|
|
1928
1928
|
}
|
1929
1929
|
}
|
1930
1930
|
const levelDetails = levelInfo.details;
|
1931
|
-
const avgDuration = (partCurrent ? levelDetails == null ?
|
1931
|
+
const avgDuration = (partCurrent ? levelDetails == null ? undefined : levelDetails.partTarget : levelDetails == null ? undefined : levelDetails.averagetargetduration) || currentFragDuration;
|
1932
1932
|
let adjustedbw;
|
1933
1933
|
// follow algorithm captured from stagefright :
|
1934
1934
|
// https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
|
@@ -2221,7 +2221,7 @@ function shouldRetry(retryConfig, retryCount, isTimeout, loaderResponse) {
|
|
2221
2221
|
if (!retryConfig) {
|
2222
2222
|
return false;
|
2223
2223
|
}
|
2224
|
-
const httpStatus = loaderResponse == null ?
|
2224
|
+
const httpStatus = loaderResponse == null ? undefined : loaderResponse.code;
|
2225
2225
|
const retry = retryCount < retryConfig.maxNumRetry && (retryForHttpStatus(httpStatus) || !!isTimeout);
|
2226
2226
|
return retryConfig.shouldRetry ? retryConfig.shouldRetry(retryConfig, retryCount, isTimeout, loaderResponse, retry) : retry;
|
2227
2227
|
}
|
@@ -2247,7 +2247,7 @@ var ErrorActionFlags = {
|
|
2247
2247
|
class ErrorController extends Logger {
|
2248
2248
|
constructor(hls) {
|
2249
2249
|
super('error-controller', hls.logger);
|
2250
|
-
this.hls =
|
2250
|
+
this.hls = undefined;
|
2251
2251
|
this.playlistError = 0;
|
2252
2252
|
this.penalizedRenditions = {};
|
2253
2253
|
this.hls = hls;
|
@@ -2280,7 +2280,7 @@ class ErrorController extends Logger {
|
|
2280
2280
|
this.playlistError = 0;
|
2281
2281
|
}
|
2282
2282
|
getVariantLevelIndex(frag) {
|
2283
|
-
return (frag == null ?
|
2283
|
+
return (frag == null ? undefined : frag.type) === PlaylistLevelType.MAIN ? frag.level : this.hls.loadLevel;
|
2284
2284
|
}
|
2285
2285
|
onManifestLoading() {
|
2286
2286
|
this.playlistError = 0;
|
@@ -2335,7 +2335,7 @@ class ErrorController extends Logger {
|
|
2335
2335
|
return;
|
2336
2336
|
case ErrorDetails.LEVEL_LOAD_ERROR:
|
2337
2337
|
case ErrorDetails.LEVEL_LOAD_TIMEOUT:
|
2338
|
-
if (typeof (context == null ?
|
2338
|
+
if (typeof (context == null ? undefined : context.level) === 'number') {
|
2339
2339
|
data.errorAction = this.getPlaylistRetryOrSwitchAction(data, context.level);
|
2340
2340
|
}
|
2341
2341
|
return;
|
@@ -2358,7 +2358,7 @@ class ErrorController extends Logger {
|
|
2358
2358
|
case ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:
|
2359
2359
|
{
|
2360
2360
|
const level = hls.levels[hls.loadLevel];
|
2361
|
-
const restrictedHdcpLevel = level == null ?
|
2361
|
+
const restrictedHdcpLevel = level == null ? undefined : level.attrs['HDCP-LEVEL'];
|
2362
2362
|
if (restrictedHdcpLevel) {
|
2363
2363
|
data.errorAction = {
|
2364
2364
|
action: NetworkErrorAction.SendAlternateToPenaltyBox,
|
@@ -2480,7 +2480,7 @@ class ErrorController extends Logger {
|
|
2480
2480
|
if (!hls.autoLevelEnabled) {
|
2481
2481
|
hls.loadLevel = -1;
|
2482
2482
|
}
|
2483
|
-
const fragErrorType = (_data$frag2 = data.frag) == null ?
|
2483
|
+
const fragErrorType = (_data$frag2 = data.frag) == null ? undefined : _data$frag2.type;
|
2484
2484
|
// Find alternate audio codec if available on audio codec error
|
2485
2485
|
const isAudioCodecError = fragErrorType === PlaylistLevelType.AUDIO && errorDetails === ErrorDetails.FRAG_PARSING_ERROR || data.sourceBufferName === 'audio' && (errorDetails === ErrorDetails.BUFFER_ADD_CODEC_ERROR || errorDetails === ErrorDetails.BUFFER_APPEND_ERROR);
|
2486
2486
|
const findAudioCodecAlternate = isAudioCodecError && levels.some(({
|
@@ -2540,7 +2540,7 @@ class ErrorController extends Logger {
|
|
2540
2540
|
}
|
2541
2541
|
onErrorOut(event, data) {
|
2542
2542
|
var _data$errorAction;
|
2543
|
-
switch ((_data$errorAction = data.errorAction) == null ?
|
2543
|
+
switch ((_data$errorAction = data.errorAction) == null ? undefined : _data$errorAction.action) {
|
2544
2544
|
case NetworkErrorAction.DoNothing:
|
2545
2545
|
break;
|
2546
2546
|
case NetworkErrorAction.SendAlternateToPenaltyBox:
|
@@ -2623,7 +2623,7 @@ class FragmentTracker {
|
|
2623
2623
|
this.fragments = Object.create(null);
|
2624
2624
|
this.timeRanges = Object.create(null);
|
2625
2625
|
this.bufferPadding = 0.2;
|
2626
|
-
this.hls =
|
2626
|
+
this.hls = undefined;
|
2627
2627
|
this.hasGaps = false;
|
2628
2628
|
this.hls = hls;
|
2629
2629
|
this._registerListeners();
|
@@ -2692,7 +2692,7 @@ class FragmentTracker {
|
|
2692
2692
|
const keys = Object.keys(fragments);
|
2693
2693
|
for (let i = keys.length; i--;) {
|
2694
2694
|
const fragmentEntity = fragments[keys[i]];
|
2695
|
-
if ((fragmentEntity == null ?
|
2695
|
+
if ((fragmentEntity == null ? undefined : fragmentEntity.body.type) === levelType && (!buffered || fragmentEntity.buffered)) {
|
2696
2696
|
const frag = fragmentEntity.body;
|
2697
2697
|
if (frag.start <= position && position <= frag.end) {
|
2698
2698
|
return frag;
|
@@ -2713,7 +2713,7 @@ class FragmentTracker {
|
|
2713
2713
|
}
|
2714
2714
|
// Check if any flagged fragments have been unloaded
|
2715
2715
|
// excluding anything newer than appendedPartSn
|
2716
|
-
const appendedPartSn = (appendedPart == null ?
|
2716
|
+
const appendedPartSn = (appendedPart == null ? undefined : appendedPart.fragment.sn) || -1;
|
2717
2717
|
Object.keys(this.fragments).forEach(key => {
|
2718
2718
|
const fragmentEntity = this.fragments[key];
|
2719
2719
|
if (!fragmentEntity) {
|
@@ -2983,7 +2983,7 @@ class FragmentTracker {
|
|
2983
2983
|
}
|
2984
2984
|
for (let i = keys.length; i--;) {
|
2985
2985
|
const fragmentEntity = fragments[keys[i]];
|
2986
|
-
if ((fragmentEntity == null ?
|
2986
|
+
if ((fragmentEntity == null ? undefined : fragmentEntity.body.type) === type) {
|
2987
2987
|
return true;
|
2988
2988
|
}
|
2989
2989
|
}
|
@@ -3031,7 +3031,7 @@ class FragmentTracker {
|
|
3031
3031
|
this.endListFragments = Object.create(null);
|
3032
3032
|
this.activePartLists = Object.create(null);
|
3033
3033
|
this.hasGaps = false;
|
3034
|
-
const partlist = (_this$hls = this.hls) == null ?
|
3034
|
+
const partlist = (_this$hls = this.hls) == null ? undefined : (_this$hls$latestLevel = _this$hls.latestLevelDetails) == null ? undefined : _this$hls$latestLevel.partList;
|
3035
3035
|
if (partlist) {
|
3036
3036
|
partlist.forEach(part => part.clearElementaryStreamInfo());
|
3037
3037
|
}
|
@@ -3039,7 +3039,7 @@ class FragmentTracker {
|
|
3039
3039
|
}
|
3040
3040
|
function isPartial(fragmentEntity) {
|
3041
3041
|
var _fragmentEntity$range, _fragmentEntity$range2, _fragmentEntity$range3;
|
3042
|
-
return fragmentEntity.buffered && (fragmentEntity.body.gap || ((_fragmentEntity$range = fragmentEntity.range.video) == null ?
|
3042
|
+
return fragmentEntity.buffered && (fragmentEntity.body.gap || ((_fragmentEntity$range = fragmentEntity.range.video) == null ? undefined : _fragmentEntity$range.partial) || ((_fragmentEntity$range2 = fragmentEntity.range.audio) == null ? undefined : _fragmentEntity$range2.partial) || ((_fragmentEntity$range3 = fragmentEntity.range.audiovideo) == null ? undefined : _fragmentEntity$range3.partial));
|
3043
3043
|
}
|
3044
3044
|
function getFragmentKey(fragment) {
|
3045
3045
|
return `${fragment.type}_${fragment.level}_${fragment.sn}`;
|
@@ -3052,9 +3052,9 @@ var DecrypterAesMode = {
|
|
3052
3052
|
|
3053
3053
|
class AESCrypto {
|
3054
3054
|
constructor(subtle, iv, aesMode) {
|
3055
|
-
this.subtle =
|
3056
|
-
this.aesIV =
|
3057
|
-
this.aesMode =
|
3055
|
+
this.subtle = undefined;
|
3056
|
+
this.aesIV = undefined;
|
3057
|
+
this.aesMode = undefined;
|
3058
3058
|
this.subtle = subtle;
|
3059
3059
|
this.aesIV = iv;
|
3060
3060
|
this.aesMode = aesMode;
|
@@ -3105,8 +3105,8 @@ class AESDecryptor {
|
|
3105
3105
|
this.key = new Uint32Array(0);
|
3106
3106
|
this.ksRows = 0;
|
3107
3107
|
this.keySize = 0;
|
3108
|
-
this.keySchedule =
|
3109
|
-
this.invKeySchedule =
|
3108
|
+
this.keySchedule = undefined;
|
3109
|
+
this.invKeySchedule = undefined;
|
3110
3110
|
this.initTable();
|
3111
3111
|
}
|
3112
3112
|
|
@@ -3320,9 +3320,9 @@ class AESDecryptor {
|
|
3320
3320
|
|
3321
3321
|
class FastAESKey {
|
3322
3322
|
constructor(subtle, key, aesMode) {
|
3323
|
-
this.subtle =
|
3324
|
-
this.key =
|
3325
|
-
this.aesMode =
|
3323
|
+
this.subtle = undefined;
|
3324
|
+
this.key = undefined;
|
3325
|
+
this.aesMode = undefined;
|
3326
3326
|
this.subtle = subtle;
|
3327
3327
|
this.key = key;
|
3328
3328
|
this.aesMode = aesMode;
|
@@ -3653,9 +3653,9 @@ class BaseSegment {
|
|
3653
3653
|
this._stats = null;
|
3654
3654
|
this._streams = null;
|
3655
3655
|
// baseurl is the URL to the playlist
|
3656
|
-
this.base =
|
3656
|
+
this.base = undefined;
|
3657
3657
|
// relurl is the portion of the URL that comes from inside the playlist.
|
3658
|
-
this.relurl =
|
3658
|
+
this.relurl = undefined;
|
3659
3659
|
if (typeof base === 'string') {
|
3660
3660
|
base = {
|
3661
3661
|
url: base
|
@@ -3669,7 +3669,7 @@ class BaseSegment {
|
|
3669
3669
|
const params = value.split('@', 2);
|
3670
3670
|
let start;
|
3671
3671
|
if (params.length === 1) {
|
3672
|
-
start = (previous == null ?
|
3672
|
+
start = (previous == null ? undefined : previous.byteRangeEndOffset) || 0;
|
3673
3673
|
} else {
|
3674
3674
|
start = parseInt(params[1]);
|
3675
3675
|
}
|
@@ -3752,7 +3752,7 @@ class Fragment extends BaseSegment {
|
|
3752
3752
|
this._programDateTime = null;
|
3753
3753
|
this._ref = null;
|
3754
3754
|
// Approximate bit rate of the fragment expressed in bits per second (bps) as indicated by the last EXT-X-BITRATE (kbps) tag
|
3755
|
-
this._bitrate =
|
3755
|
+
this._bitrate = undefined;
|
3756
3756
|
this.rawProgramDateTime = null;
|
3757
3757
|
this.tagList = [];
|
3758
3758
|
// EXTINF has to be present for a m3u8 to be considered valid
|
@@ -3762,9 +3762,9 @@ class Fragment extends BaseSegment {
|
|
3762
3762
|
// levelkeys are the EXT-X-KEY tags that apply to this segment for decryption
|
3763
3763
|
// core difference from the private field _decryptdata is the lack of the initialized IV
|
3764
3764
|
// _decryptdata will set the IV for this segment based on the segment number in the fragment
|
3765
|
-
this.levelkeys =
|
3765
|
+
this.levelkeys = undefined;
|
3766
3766
|
// A string representing the fragment type
|
3767
|
-
this.type =
|
3767
|
+
this.type = undefined;
|
3768
3768
|
// A reference to the loader. Set while the fragment is loading, and removed afterwards. Used to abort fragment loading
|
3769
3769
|
this.loader = null;
|
3770
3770
|
// A reference to the key loader. Set while the key is loading, and removed afterwards. Used to abort key loading
|
@@ -3774,25 +3774,25 @@ class Fragment extends BaseSegment {
|
|
3774
3774
|
// The continuity counter of the fragment
|
3775
3775
|
this.cc = 0;
|
3776
3776
|
// The starting Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
|
3777
|
-
this.startPTS =
|
3777
|
+
this.startPTS = undefined;
|
3778
3778
|
// The ending Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
|
3779
|
-
this.endPTS =
|
3779
|
+
this.endPTS = undefined;
|
3780
3780
|
// The starting Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
|
3781
|
-
this.startDTS =
|
3781
|
+
this.startDTS = undefined;
|
3782
3782
|
// The ending Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
|
3783
|
-
this.endDTS =
|
3783
|
+
this.endDTS = undefined;
|
3784
3784
|
// The start time of the fragment, as listed in the manifest. Updated after transmux complete.
|
3785
3785
|
this.start = 0;
|
3786
3786
|
// The offset time (seconds) of the fragment from the start of the Playlist
|
3787
3787
|
this.playlistOffset = 0;
|
3788
3788
|
// Set by `updateFragPTSDTS` in level-helper
|
3789
|
-
this.deltaPTS =
|
3789
|
+
this.deltaPTS = undefined;
|
3790
3790
|
// The maximum starting Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
|
3791
|
-
this.maxStartPTS =
|
3791
|
+
this.maxStartPTS = undefined;
|
3792
3792
|
// The minimum ending Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
|
3793
|
-
this.minEndPTS =
|
3793
|
+
this.minEndPTS = undefined;
|
3794
3794
|
// Init Segment bytes (unset for media segments)
|
3795
|
-
this.data =
|
3795
|
+
this.data = undefined;
|
3796
3796
|
// A flag indicating whether the segment was downloaded in order to test bitrate, and was not buffered
|
3797
3797
|
this.bitrateTest = false;
|
3798
3798
|
// #EXTINF segment title
|
@@ -3800,9 +3800,9 @@ class Fragment extends BaseSegment {
|
|
3800
3800
|
// The Media Initialization Section for this segment
|
3801
3801
|
this.initSegment = null;
|
3802
3802
|
// Fragment is the last fragment in the media playlist
|
3803
|
-
this.endList =
|
3803
|
+
this.endList = undefined;
|
3804
3804
|
// Fragment is marked by an EXT-X-GAP tag indicating that it does not contain media data and should not be loaded
|
3805
|
-
this.gap =
|
3805
|
+
this.gap = undefined;
|
3806
3806
|
// Deprecated
|
3807
3807
|
this.urlId = 0;
|
3808
3808
|
this.type = type;
|
@@ -3934,8 +3934,8 @@ class Fragment extends BaseSegment {
|
|
3934
3934
|
}
|
3935
3935
|
abortRequests() {
|
3936
3936
|
var _this$loader, _this$keyLoader;
|
3937
|
-
(_this$loader = this.loader) == null ?
|
3938
|
-
(_this$keyLoader = this.keyLoader) == null ?
|
3937
|
+
(_this$loader = this.loader) == null ? undefined : _this$loader.abort();
|
3938
|
+
(_this$keyLoader = this.keyLoader) == null ? undefined : _this$keyLoader.abort();
|
3939
3939
|
}
|
3940
3940
|
setElementaryStreamInfo(type, startPTS, endPTS, startDTS, endDTS, partial = false) {
|
3941
3941
|
const {
|
@@ -3969,9 +3969,9 @@ class Part extends BaseSegment {
|
|
3969
3969
|
this.duration = 0;
|
3970
3970
|
this.gap = false;
|
3971
3971
|
this.independent = false;
|
3972
|
-
this.relurl =
|
3973
|
-
this.fragment =
|
3974
|
-
this.index =
|
3972
|
+
this.relurl = undefined;
|
3973
|
+
this.fragment = undefined;
|
3974
|
+
this.index = undefined;
|
3975
3975
|
this.duration = partAttrs.decimalFloatingPoint('DURATION');
|
3976
3976
|
this.gap = partAttrs.bool('GAP');
|
3977
3977
|
this.independent = partAttrs.bool('INDEPENDENT');
|
@@ -4523,8 +4523,8 @@ function getDuration(data, initData) {
|
|
4523
4523
|
continue;
|
4524
4524
|
}
|
4525
4525
|
const trackDefault = track.default;
|
4526
|
-
const tfhdFlags = readUint32(tfhd, 0) | (trackDefault == null ?
|
4527
|
-
let sampleDuration = trackDefault == null ?
|
4526
|
+
const tfhdFlags = readUint32(tfhd, 0) | (trackDefault == null ? undefined : trackDefault.flags);
|
4527
|
+
let sampleDuration = trackDefault == null ? undefined : trackDefault.duration;
|
4528
4528
|
if (tfhdFlags & 0x000008) {
|
4529
4529
|
// 0x000008 indicates the presence of the default_sample_duration field
|
4530
4530
|
if (tfhdFlags & 0x000002) {
|
@@ -5176,7 +5176,7 @@ class Decrypter {
|
|
5176
5176
|
removePKCS7Padding = true
|
5177
5177
|
} = {}) {
|
5178
5178
|
this.logEnabled = true;
|
5179
|
-
this.removePKCS7Padding =
|
5179
|
+
this.removePKCS7Padding = undefined;
|
5180
5180
|
this.subtle = null;
|
5181
5181
|
this.softwareDecrypter = null;
|
5182
5182
|
this.key = null;
|
@@ -5184,8 +5184,8 @@ class Decrypter {
|
|
5184
5184
|
this.remainderData = null;
|
5185
5185
|
this.currentIV = null;
|
5186
5186
|
this.currentResult = null;
|
5187
|
-
this.useSoftware =
|
5188
|
-
this.enableSoftwareAES =
|
5187
|
+
this.useSoftware = undefined;
|
5188
|
+
this.enableSoftwareAES = undefined;
|
5189
5189
|
this.enableSoftwareAES = config.enableSoftwareAES;
|
5190
5190
|
this.removePKCS7Padding = removePKCS7Padding;
|
5191
5191
|
// built in decryptor expects PKCS7 padding
|
@@ -5353,7 +5353,7 @@ const MIN_CHUNK_SIZE = Math.pow(2, 17); // 128kb
|
|
5353
5353
|
|
5354
5354
|
class FragmentLoader {
|
5355
5355
|
constructor(config) {
|
5356
|
-
this.config =
|
5356
|
+
this.config = undefined;
|
5357
5357
|
this.loader = null;
|
5358
5358
|
this.partLoadTimeout = -1;
|
5359
5359
|
this.config = config;
|
@@ -5619,7 +5619,7 @@ function createLoaderContext(frag, part = null) {
|
|
5619
5619
|
var _frag$decryptdata;
|
5620
5620
|
let byteRangeStart = start;
|
5621
5621
|
let byteRangeEnd = end;
|
5622
|
-
if (frag.sn === 'initSegment' && isMethodFullSegmentAesCbc((_frag$decryptdata = frag.decryptdata) == null ?
|
5622
|
+
if (frag.sn === 'initSegment' && isMethodFullSegmentAesCbc((_frag$decryptdata = frag.decryptdata) == null ? undefined : _frag$decryptdata.method)) {
|
5623
5623
|
// MAP segment encrypted with method 'AES-128' or 'AES-256' (cbc), when served with HTTP Range,
|
5624
5624
|
// has the unencrypted size specified in the range.
|
5625
5625
|
// Ref: https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-08#section-6.3.6
|
@@ -5659,7 +5659,7 @@ function isMethodFullSegmentAesCbc(method) {
|
|
5659
5659
|
class LoadError extends Error {
|
5660
5660
|
constructor(data) {
|
5661
5661
|
super(data.error.message);
|
5662
|
-
this.data =
|
5662
|
+
this.data = undefined;
|
5663
5663
|
this.data = data;
|
5664
5664
|
}
|
5665
5665
|
}
|
@@ -5696,7 +5696,7 @@ class LoadError extends Error {
|
|
5696
5696
|
class TaskLoop extends Logger {
|
5697
5697
|
constructor(label, logger) {
|
5698
5698
|
super(label, logger);
|
5699
|
-
this._boundTick =
|
5699
|
+
this._boundTick = undefined;
|
5700
5700
|
this._tickTimer = null;
|
5701
5701
|
this._tickInterval = null;
|
5702
5702
|
this._tickCallCount = 0;
|
@@ -5788,12 +5788,12 @@ class TaskLoop extends Logger {
|
|
5788
5788
|
|
5789
5789
|
class ChunkMetadata {
|
5790
5790
|
constructor(level, sn, id, size = 0, part = -1, partial = false) {
|
5791
|
-
this.level =
|
5792
|
-
this.sn =
|
5793
|
-
this.part =
|
5794
|
-
this.id =
|
5795
|
-
this.size =
|
5796
|
-
this.partial =
|
5791
|
+
this.level = undefined;
|
5792
|
+
this.sn = undefined;
|
5793
|
+
this.part = undefined;
|
5794
|
+
this.id = undefined;
|
5795
|
+
this.size = undefined;
|
5796
|
+
this.partial = undefined;
|
5797
5797
|
this.transmuxing = getNewPerformanceTiming();
|
5798
5798
|
this.buffering = {
|
5799
5799
|
audio: getNewPerformanceTiming(),
|
@@ -5953,7 +5953,7 @@ function substituteVariables(parsed, value) {
|
|
5953
5953
|
const variableList = parsed.variableList;
|
5954
5954
|
return value.replace(VARIABLE_REPLACEMENT_REGEX, variableReference => {
|
5955
5955
|
const variableName = variableReference.substring(2, variableReference.length - 1);
|
5956
|
-
const variableValue = variableList == null ?
|
5956
|
+
const variableValue = variableList == null ? undefined : variableList[variableName];
|
5957
5957
|
if (variableValue === undefined) {
|
5958
5958
|
parsed.playlistParsingError || (parsed.playlistParsingError = new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${variableName}"`));
|
5959
5959
|
return variableReference;
|
@@ -6163,16 +6163,16 @@ function isSCTE35Attribute(attrName) {
|
|
6163
6163
|
class DateRange {
|
6164
6164
|
constructor(dateRangeAttr, dateRangeWithSameId, tagCount = 0) {
|
6165
6165
|
var _dateRangeWithSameId$;
|
6166
|
-
this.attr =
|
6167
|
-
this.tagAnchor =
|
6168
|
-
this.tagOrder =
|
6169
|
-
this._startDate =
|
6170
|
-
this._endDate =
|
6171
|
-
this._dateAtEnd =
|
6172
|
-
this._cue =
|
6173
|
-
this._badValueForSameId =
|
6174
|
-
this.tagAnchor = (dateRangeWithSameId == null ?
|
6175
|
-
this.tagOrder = (_dateRangeWithSameId$ = dateRangeWithSameId == null ?
|
6166
|
+
this.attr = undefined;
|
6167
|
+
this.tagAnchor = undefined;
|
6168
|
+
this.tagOrder = undefined;
|
6169
|
+
this._startDate = undefined;
|
6170
|
+
this._endDate = undefined;
|
6171
|
+
this._dateAtEnd = undefined;
|
6172
|
+
this._cue = undefined;
|
6173
|
+
this._badValueForSameId = undefined;
|
6174
|
+
this.tagAnchor = (dateRangeWithSameId == null ? undefined : dateRangeWithSameId.tagAnchor) || null;
|
6175
|
+
this.tagOrder = (_dateRangeWithSameId$ = dateRangeWithSameId == null ? undefined : dateRangeWithSameId.tagOrder) != null ? _dateRangeWithSameId$ : tagCount;
|
6176
6176
|
if (dateRangeWithSameId) {
|
6177
6177
|
const previousAttr = dateRangeWithSameId.attr;
|
6178
6178
|
for (const key in previousAttr) {
|
@@ -6195,7 +6195,7 @@ class DateRange {
|
|
6195
6195
|
this._startDate = new Date(dateRangeAttr["START-DATE"]);
|
6196
6196
|
}
|
6197
6197
|
if ("END-DATE" in this.attr) {
|
6198
|
-
const endDate = (dateRangeWithSameId == null ?
|
6198
|
+
const endDate = (dateRangeWithSameId == null ? undefined : dateRangeWithSameId.endDate) || new Date(this.attr["END-DATE"]);
|
6199
6199
|
if (isFiniteNumber(endDate.getTime())) {
|
6200
6200
|
this._endDate = endDate;
|
6201
6201
|
}
|
@@ -6280,21 +6280,21 @@ class LevelDetails {
|
|
6280
6280
|
constructor(baseUrl) {
|
6281
6281
|
this.PTSKnown = false;
|
6282
6282
|
this.alignedSliding = false;
|
6283
|
-
this.averagetargetduration =
|
6283
|
+
this.averagetargetduration = undefined;
|
6284
6284
|
this.endCC = 0;
|
6285
6285
|
this.endSN = 0;
|
6286
|
-
this.fragments =
|
6287
|
-
this.fragmentHint =
|
6286
|
+
this.fragments = undefined;
|
6287
|
+
this.fragmentHint = undefined;
|
6288
6288
|
this.partList = null;
|
6289
|
-
this.dateRanges =
|
6289
|
+
this.dateRanges = undefined;
|
6290
6290
|
this.dateRangeTagCount = 0;
|
6291
6291
|
this.live = true;
|
6292
6292
|
this.requestScheduled = -1;
|
6293
6293
|
this.ageHeader = 0;
|
6294
|
-
this.advancedDateTime =
|
6294
|
+
this.advancedDateTime = undefined;
|
6295
6295
|
this.updated = true;
|
6296
6296
|
this.advanced = true;
|
6297
|
-
this.availabilityDelay =
|
6297
|
+
this.availabilityDelay = undefined;
|
6298
6298
|
// Manifest reload synchronization
|
6299
6299
|
this.misses = 0;
|
6300
6300
|
this.startCC = 0;
|
@@ -6303,30 +6303,30 @@ class LevelDetails {
|
|
6303
6303
|
this.targetduration = 0;
|
6304
6304
|
this.totalduration = 0;
|
6305
6305
|
this.type = null;
|
6306
|
-
this.url =
|
6306
|
+
this.url = undefined;
|
6307
6307
|
this.m3u8 = '';
|
6308
6308
|
this.version = null;
|
6309
6309
|
this.canBlockReload = false;
|
6310
6310
|
this.canSkipUntil = 0;
|
6311
6311
|
this.canSkipDateRanges = false;
|
6312
6312
|
this.skippedSegments = 0;
|
6313
|
-
this.recentlyRemovedDateranges =
|
6313
|
+
this.recentlyRemovedDateranges = undefined;
|
6314
6314
|
this.partHoldBack = 0;
|
6315
6315
|
this.holdBack = 0;
|
6316
6316
|
this.partTarget = 0;
|
6317
|
-
this.preloadHint =
|
6318
|
-
this.renditionReports =
|
6317
|
+
this.preloadHint = undefined;
|
6318
|
+
this.renditionReports = undefined;
|
6319
6319
|
this.tuneInGoal = 0;
|
6320
|
-
this.deltaUpdateFailed =
|
6320
|
+
this.deltaUpdateFailed = undefined;
|
6321
6321
|
this.driftStartTime = 0;
|
6322
6322
|
this.driftEndTime = 0;
|
6323
6323
|
this.driftStart = 0;
|
6324
6324
|
this.driftEnd = 0;
|
6325
|
-
this.encryptedFragments =
|
6325
|
+
this.encryptedFragments = undefined;
|
6326
6326
|
this.playlistParsingError = null;
|
6327
6327
|
this.variableList = null;
|
6328
6328
|
this.hasVariableRefs = false;
|
6329
|
-
this.appliedTimelineOffset =
|
6329
|
+
this.appliedTimelineOffset = undefined;
|
6330
6330
|
this.fragments = [];
|
6331
6331
|
this.encryptedFragments = [];
|
6332
6332
|
this.dateRanges = {};
|
@@ -6656,12 +6656,12 @@ class LevelKey {
|
|
6656
6656
|
keyUriToKeyIdMap = {};
|
6657
6657
|
}
|
6658
6658
|
constructor(method, uri, format, formatversions = [1], iv = null) {
|
6659
|
-
this.uri =
|
6660
|
-
this.method =
|
6661
|
-
this.keyFormat =
|
6662
|
-
this.keyFormatVersions =
|
6663
|
-
this.encrypted =
|
6664
|
-
this.isCommonEncryption =
|
6659
|
+
this.uri = undefined;
|
6660
|
+
this.method = undefined;
|
6661
|
+
this.keyFormat = undefined;
|
6662
|
+
this.keyFormatVersions = undefined;
|
6663
|
+
this.encrypted = undefined;
|
6664
|
+
this.isCommonEncryption = undefined;
|
6665
6665
|
this.iv = null;
|
6666
6666
|
this.key = null;
|
6667
6667
|
this.keyId = null;
|
@@ -7362,7 +7362,7 @@ function findFragmentWithStartDate(details, startDateTime, programDateTimes, ind
|
|
7362
7362
|
const pdtStart = pdtFragment.programDateTime;
|
7363
7363
|
if (startDateTime >= pdtStart || index === 0) {
|
7364
7364
|
var _programDateTimes;
|
7365
|
-
const durationBetweenPdt = (((_programDateTimes = programDateTimes[index + 1]) == null ?
|
7365
|
+
const durationBetweenPdt = (((_programDateTimes = programDateTimes[index + 1]) == null ? undefined : _programDateTimes.start) || endTime) - pdtFragment.start;
|
7366
7366
|
if (startDateTime <= pdtStart + durationBetweenPdt * 1000) {
|
7367
7367
|
// map to fragment with date-time range
|
7368
7368
|
const startIndex = programDateTimes[index].sn - details.startSN;
|
@@ -7627,7 +7627,7 @@ function mergeDetails(oldDetails, newDetails) {
|
|
7627
7627
|
if (currentInitSegment) {
|
7628
7628
|
fragmentsToCheck.forEach(frag => {
|
7629
7629
|
var _currentInitSegment;
|
7630
|
-
if (frag && (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) == null ?
|
7630
|
+
if (frag && (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) == null ? undefined : _currentInitSegment.relurl))) {
|
7631
7631
|
frag.initSegment = currentInitSegment;
|
7632
7632
|
}
|
7633
7633
|
});
|
@@ -7859,7 +7859,7 @@ function findPart(partList, sn, partIndex) {
|
|
7859
7859
|
function reassignFragmentLevelIndexes(levels) {
|
7860
7860
|
levels.forEach((level, index) => {
|
7861
7861
|
var _level$details;
|
7862
|
-
const fragments = (_level$details = level.details) == null ?
|
7862
|
+
const fragments = (_level$details = level.details) == null ? undefined : _level$details.fragments;
|
7863
7863
|
if (fragments) {
|
7864
7864
|
fragments.forEach(fragment => {
|
7865
7865
|
fragment.level = index;
|
@@ -7874,7 +7874,7 @@ function reassignFragmentLevelIndexes(levels) {
|
|
7874
7874
|
function findFirstFragWithCC(fragments, cc) {
|
7875
7875
|
for (let i = 0, len = fragments.length; i < len; i++) {
|
7876
7876
|
var _fragments$i;
|
7877
|
-
if (((_fragments$i = fragments[i]) == null ?
|
7877
|
+
if (((_fragments$i = fragments[i]) == null ? undefined : _fragments$i.cc) === cc) {
|
7878
7878
|
return fragments[i];
|
7879
7879
|
}
|
7880
7880
|
}
|
@@ -8035,16 +8035,16 @@ const State = {
|
|
8035
8035
|
class BaseStreamController extends TaskLoop {
|
8036
8036
|
constructor(hls, fragmentTracker, keyLoader, logPrefix, playlistType) {
|
8037
8037
|
super(logPrefix, hls.logger);
|
8038
|
-
this.hls =
|
8038
|
+
this.hls = undefined;
|
8039
8039
|
this.fragPrevious = null;
|
8040
8040
|
this.fragCurrent = null;
|
8041
|
-
this.fragmentTracker =
|
8041
|
+
this.fragmentTracker = undefined;
|
8042
8042
|
this.transmuxer = null;
|
8043
8043
|
this._state = State.STOPPED;
|
8044
|
-
this.playlistType =
|
8044
|
+
this.playlistType = undefined;
|
8045
8045
|
this.media = null;
|
8046
8046
|
this.mediaBuffer = null;
|
8047
|
-
this.config =
|
8047
|
+
this.config = undefined;
|
8048
8048
|
this.bitrateTest = false;
|
8049
8049
|
this.lastCurrentTime = 0;
|
8050
8050
|
this.nextLoadPosition = 0;
|
@@ -8052,15 +8052,15 @@ class BaseStreamController extends TaskLoop {
|
|
8052
8052
|
this.startTimeOffset = null;
|
8053
8053
|
this.retryDate = 0;
|
8054
8054
|
this.levels = null;
|
8055
|
-
this.fragmentLoader =
|
8056
|
-
this.keyLoader =
|
8055
|
+
this.fragmentLoader = undefined;
|
8056
|
+
this.keyLoader = undefined;
|
8057
8057
|
this.levelLastLoaded = null;
|
8058
8058
|
this.startFragRequested = false;
|
8059
|
-
this.decrypter =
|
8059
|
+
this.decrypter = undefined;
|
8060
8060
|
this.initPTS = [];
|
8061
8061
|
this.buffering = true;
|
8062
8062
|
this.loadingParts = false;
|
8063
|
-
this.loopSn =
|
8063
|
+
this.loopSn = undefined;
|
8064
8064
|
this.onMediaSeeking = () => {
|
8065
8065
|
const {
|
8066
8066
|
config,
|
@@ -8235,7 +8235,7 @@ class BaseStreamController extends TaskLoop {
|
|
8235
8235
|
getLevelDetails() {
|
8236
8236
|
if (this.levels && this.levelLastLoaded !== null) {
|
8237
8237
|
var _this$levelLastLoaded;
|
8238
|
-
return (_this$levelLastLoaded = this.levelLastLoaded) == null ?
|
8238
|
+
return (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details;
|
8239
8239
|
}
|
8240
8240
|
}
|
8241
8241
|
onMediaAttached(event, data) {
|
@@ -8318,7 +8318,7 @@ class BaseStreamController extends TaskLoop {
|
|
8318
8318
|
if (config.interstitialsController && config.enableInterstitialPlayback !== false && frag.type !== PlaylistLevelType.SUBTITLE) {
|
8319
8319
|
// Do not load fragments outside the buffering schedule segment
|
8320
8320
|
const interstitials = this.hls.interstitialsManager;
|
8321
|
-
const bufferingItem = interstitials == null ?
|
8321
|
+
const bufferingItem = interstitials == null ? undefined : interstitials.bufferingItem;
|
8322
8322
|
if (bufferingItem) {
|
8323
8323
|
const bufferingInterstitial = bufferingItem.event;
|
8324
8324
|
if (bufferingInterstitial) {
|
@@ -8329,7 +8329,7 @@ class BaseStreamController extends TaskLoop {
|
|
8329
8329
|
} else {
|
8330
8330
|
var _level$details;
|
8331
8331
|
// Limit fragment loading to media in schedule item
|
8332
|
-
if (frag.end <= bufferingItem.start && ((_level$details = level.details) == null ?
|
8332
|
+
if (frag.end <= bufferingItem.start && ((_level$details = level.details) == null ? undefined : _level$details.live) === false) {
|
8333
8333
|
// fragment ends by schedule item start
|
8334
8334
|
return;
|
8335
8335
|
}
|
@@ -8379,7 +8379,7 @@ class BaseStreamController extends TaskLoop {
|
|
8379
8379
|
if (this.state === State.STOPPED || this.state === State.ERROR) {
|
8380
8380
|
return;
|
8381
8381
|
}
|
8382
|
-
this.warn(`Frag error: ${(reason == null ?
|
8382
|
+
this.warn(`Frag error: ${(reason == null ? undefined : reason.message) || reason}`);
|
8383
8383
|
this.resetFragmentLoading(fragment);
|
8384
8384
|
});
|
8385
8385
|
}
|
@@ -8400,7 +8400,7 @@ class BaseStreamController extends TaskLoop {
|
|
8400
8400
|
if (backtracked === 1 || this.reduceMaxBufferLength(minForwardBufferLength, frag.duration)) {
|
8401
8401
|
fragmentTracker.removeFragment(frag);
|
8402
8402
|
}
|
8403
|
-
} else if (((_this$mediaBuffer = this.mediaBuffer) == null ?
|
8403
|
+
} else if (((_this$mediaBuffer = this.mediaBuffer) == null ? undefined : _this$mediaBuffer.buffered.length) === 0) {
|
8404
8404
|
// Stop gap for bad tracker / buffer flush behavior
|
8405
8405
|
fragmentTracker.removeAllFragments();
|
8406
8406
|
} else if (fragmentTracker.hasParts(frag.type)) {
|
@@ -8433,7 +8433,7 @@ class BaseStreamController extends TaskLoop {
|
|
8433
8433
|
}
|
8434
8434
|
waitForLive(levelInfo) {
|
8435
8435
|
const details = levelInfo.details;
|
8436
|
-
return (details == null ?
|
8436
|
+
return (details == null ? undefined : details.live) && details.type !== 'EVENT' && (this.levelLastLoaded !== levelInfo || details.expired);
|
8437
8437
|
}
|
8438
8438
|
flushMainBuffer(startOffset, endOffset, type = null) {
|
8439
8439
|
if (!(startOffset - endOffset)) {
|
@@ -8450,7 +8450,7 @@ class BaseStreamController extends TaskLoop {
|
|
8450
8450
|
}
|
8451
8451
|
_loadInitSegment(fragment, level) {
|
8452
8452
|
this._doFragLoad(fragment, level).then(data => {
|
8453
|
-
const frag = data == null ?
|
8453
|
+
const frag = data == null ? undefined : data.frag;
|
8454
8454
|
if (!frag || this.fragContextChanged(frag) || !this.levels) {
|
8455
8455
|
throw new Error('init load aborted');
|
8456
8456
|
}
|
@@ -8537,7 +8537,7 @@ class BaseStreamController extends TaskLoop {
|
|
8537
8537
|
return;
|
8538
8538
|
}
|
8539
8539
|
}
|
8540
|
-
const level = (_this$levels = this.levels) == null ?
|
8540
|
+
const level = (_this$levels = this.levels) == null ? undefined : _this$levels[frag.level];
|
8541
8541
|
if (level != null && level.fragmentError) {
|
8542
8542
|
this.log(`Resetting level fragment error count of ${level.fragmentError} on frag buffered`);
|
8543
8543
|
level.fragmentError = 0;
|
@@ -8568,7 +8568,7 @@ class BaseStreamController extends TaskLoop {
|
|
8568
8568
|
_doFragLoad(frag, level, targetBufferTime = null, progressCallback) {
|
8569
8569
|
var _frag$decryptdata;
|
8570
8570
|
this.fragCurrent = frag;
|
8571
|
-
const details = level == null ?
|
8571
|
+
const details = level == null ? undefined : level.details;
|
8572
8572
|
if (!this.levels || !details) {
|
8573
8573
|
throw new Error(`frag load aborted, missing level${details ? '' : ' detail'}s`);
|
8574
8574
|
}
|
@@ -8599,7 +8599,7 @@ class BaseStreamController extends TaskLoop {
|
|
8599
8599
|
if (isMediaFragment(frag) && (!fragPrevious || frag.sn !== fragPrevious.sn)) {
|
8600
8600
|
const shouldLoadParts = this.shouldLoadParts(level.details, frag.end);
|
8601
8601
|
if (shouldLoadParts !== this.loadingParts) {
|
8602
|
-
this.log(`LL-Part loading ${shouldLoadParts ? 'ON' : 'OFF'} loading sn ${fragPrevious == null ?
|
8602
|
+
this.log(`LL-Part loading ${shouldLoadParts ? 'ON' : 'OFF'} loading sn ${fragPrevious == null ? undefined : fragPrevious.sn}->${frag.sn}`);
|
8603
8603
|
this.loadingParts = shouldLoadParts;
|
8604
8604
|
}
|
8605
8605
|
}
|
@@ -8662,7 +8662,7 @@ class BaseStreamController extends TaskLoop {
|
|
8662
8662
|
let result;
|
8663
8663
|
if (dataOnProgress && keyLoadingPromise) {
|
8664
8664
|
result = keyLoadingPromise.then(keyLoadedData => {
|
8665
|
-
if (!keyLoadedData || this.fragContextChanged(keyLoadedData == null ?
|
8665
|
+
if (!keyLoadedData || this.fragContextChanged(keyLoadedData == null ? undefined : keyLoadedData.frag)) {
|
8666
8666
|
return null;
|
8667
8667
|
}
|
8668
8668
|
return this.fragmentLoader.load(frag, progressCallback);
|
@@ -8690,7 +8690,7 @@ class BaseStreamController extends TaskLoop {
|
|
8690
8690
|
return new Promise((resolve, reject) => {
|
8691
8691
|
var _level$details2;
|
8692
8692
|
const partsLoaded = [];
|
8693
|
-
const initialPartList = (_level$details2 = level.details) == null ?
|
8693
|
+
const initialPartList = (_level$details2 = level.details) == null ? undefined : _level$details2.partList;
|
8694
8694
|
const loadPart = part => {
|
8695
8695
|
this.fragmentLoader.loadPart(frag, part, progressCallback).then(partLoadedData => {
|
8696
8696
|
partsLoaded[part.index] = partLoadedData;
|
@@ -8768,10 +8768,10 @@ class BaseStreamController extends TaskLoop {
|
|
8768
8768
|
// Buffer must be ahead of first part + duration of parts after last segment
|
8769
8769
|
// and playback must be at or past segment adjacent to part list
|
8770
8770
|
const firstPart = details.partList[0];
|
8771
|
-
const safePartStart = firstPart.end + (((_details$fragmentHint = details.fragmentHint) == null ?
|
8771
|
+
const safePartStart = firstPart.end + (((_details$fragmentHint = details.fragmentHint) == null ? undefined : _details$fragmentHint.duration) || 0);
|
8772
8772
|
if (bufferEnd >= safePartStart) {
|
8773
8773
|
var _this$media;
|
8774
|
-
const playhead = this.hls.hasEnoughToStart ? ((_this$media = this.media) == null ?
|
8774
|
+
const playhead = this.hls.hasEnoughToStart ? ((_this$media = this.media) == null ? undefined : _this$media.currentTime) || this.lastCurrentTime : this.getLoadPosition();
|
8775
8775
|
if (playhead > firstPart.start - firstPart.fragment.duration) {
|
8776
8776
|
return true;
|
8777
8777
|
}
|
@@ -8911,7 +8911,7 @@ class BaseStreamController extends TaskLoop {
|
|
8911
8911
|
}
|
8912
8912
|
getAppendedFrag(position, playlistType = PlaylistLevelType.MAIN) {
|
8913
8913
|
var _this$fragmentTracker;
|
8914
|
-
const fragOrPart = (_this$fragmentTracker = this.fragmentTracker) == null ?
|
8914
|
+
const fragOrPart = (_this$fragmentTracker = this.fragmentTracker) == null ? undefined : _this$fragmentTracker.getAppendedFrag(position, playlistType);
|
8915
8915
|
if (fragOrPart && 'fragment' in fragOrPart) {
|
8916
8916
|
return fragOrPart.fragment;
|
8917
8917
|
}
|
@@ -8951,7 +8951,7 @@ class BaseStreamController extends TaskLoop {
|
|
8951
8951
|
const mainStart = this.hls.startPosition;
|
8952
8952
|
const liveSyncPosition = this.hls.liveSyncPosition;
|
8953
8953
|
const startPosition = frag ? (mainStart !== -1 && mainStart >= start ? mainStart : liveSyncPosition) || frag.start : pos;
|
8954
|
-
this.log(`Setting startPosition to ${startPosition} to match initial live edge. mainStart: ${mainStart} liveSyncPosition: ${liveSyncPosition} frag.start: ${(_frag = frag) == null ?
|
8954
|
+
this.log(`Setting startPosition to ${startPosition} to match initial live edge. mainStart: ${mainStart} liveSyncPosition: ${liveSyncPosition} frag.start: ${(_frag = frag) == null ? undefined : _frag.start}`);
|
8955
8955
|
this.startPosition = this.nextLoadPosition = startPosition;
|
8956
8956
|
}
|
8957
8957
|
} else if (pos <= start) {
|
@@ -9225,7 +9225,7 @@ class BaseStreamController extends TaskLoop {
|
|
9225
9225
|
}
|
9226
9226
|
if (this.fragContextChanged(frag)) {
|
9227
9227
|
var _this$fragCurrent;
|
9228
|
-
this.warn(`Frag load error must match current frag to retry ${frag.url} > ${(_this$fragCurrent = this.fragCurrent) == null ?
|
9228
|
+
this.warn(`Frag load error must match current frag to retry ${frag.url} > ${(_this$fragCurrent = this.fragCurrent) == null ? undefined : _this$fragCurrent.url}`);
|
9229
9229
|
return;
|
9230
9230
|
}
|
9231
9231
|
const gapTagEncountered = data.details === ErrorDetails.FRAG_GAP;
|
@@ -9283,7 +9283,7 @@ class BaseStreamController extends TaskLoop {
|
|
9283
9283
|
// reduce max buf len if current position is buffered
|
9284
9284
|
const buffered = bufferedInfo && bufferedInfo.len > 0.5;
|
9285
9285
|
if (buffered) {
|
9286
|
-
this.reduceMaxBufferLength(bufferedInfo.len, (frag == null ?
|
9286
|
+
this.reduceMaxBufferLength(bufferedInfo.len, (frag == null ? undefined : frag.duration) || 10);
|
9287
9287
|
}
|
9288
9288
|
const flushBuffer = !buffered;
|
9289
9289
|
if (flushBuffer) {
|
@@ -9393,7 +9393,7 @@ class BaseStreamController extends TaskLoop {
|
|
9393
9393
|
}
|
9394
9394
|
return result;
|
9395
9395
|
}, false);
|
9396
|
-
if (!parsed && ((_this$transmuxer = this.transmuxer) == null ?
|
9396
|
+
if (!parsed && ((_this$transmuxer = this.transmuxer) == null ? undefined : _this$transmuxer.error) === null) {
|
9397
9397
|
const error = new Error(`Found no media in fragment ${frag.sn} of ${this.playlistLabel()} ${frag.level} resetting transmuxer to fallback to playlist timing`);
|
9398
9398
|
if (level.fragmentError === 0) {
|
9399
9399
|
// Mark and track the odd empty segment as a gap to avoid reloading
|
@@ -9438,7 +9438,7 @@ class BaseStreamController extends TaskLoop {
|
|
9438
9438
|
}
|
9439
9439
|
resetTransmuxer() {
|
9440
9440
|
var _this$transmuxer2;
|
9441
|
-
(_this$transmuxer2 = this.transmuxer) == null ?
|
9441
|
+
(_this$transmuxer2 = this.transmuxer) == null ? undefined : _this$transmuxer2.reset();
|
9442
9442
|
}
|
9443
9443
|
recoverWorkerError(data) {
|
9444
9444
|
if (data.event === 'demuxerWorker') {
|
@@ -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.
|
9850
|
+
const version = "1.6.0-beta.2.0.canary.10882";
|
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
|
@@ -10718,8 +10718,8 @@ function dummyTrack(type = '', inputTimeScale = 90000) {
|
|
10718
10718
|
|
10719
10719
|
class BaseAudioDemuxer {
|
10720
10720
|
constructor() {
|
10721
|
-
this._audioTrack =
|
10722
|
-
this._id3Track =
|
10721
|
+
this._audioTrack = undefined;
|
10722
|
+
this._id3Track = undefined;
|
10723
10723
|
this.frameIndex = 0;
|
10724
10724
|
this.cachedData = null;
|
10725
10725
|
this.basePTS = null;
|
@@ -11011,8 +11011,8 @@ function probe(data, offset) {
|
|
11011
11011
|
class AACDemuxer extends BaseAudioDemuxer {
|
11012
11012
|
constructor(observer, config) {
|
11013
11013
|
super();
|
11014
|
-
this.observer =
|
11015
|
-
this.config =
|
11014
|
+
this.observer = undefined;
|
11015
|
+
this.config = undefined;
|
11016
11016
|
this.observer = observer;
|
11017
11017
|
this.config = config;
|
11018
11018
|
}
|
@@ -11044,7 +11044,7 @@ class AACDemuxer extends BaseAudioDemuxer {
|
|
11044
11044
|
// Layer bits (position 14 and 15) in header should be always 0 for ADTS
|
11045
11045
|
// More info https://wiki.multimedia.cx/index.php?title=ADTS
|
11046
11046
|
const id3Data = getId3Data(data, 0);
|
11047
|
-
let offset = (id3Data == null ?
|
11047
|
+
let offset = (id3Data == null ? undefined : id3Data.length) || 0;
|
11048
11048
|
if (probe(data, offset)) {
|
11049
11049
|
return false;
|
11050
11050
|
}
|
@@ -11093,7 +11093,7 @@ const getAudioBSID = (data, offset) => {
|
|
11093
11093
|
class AC3Demuxer extends BaseAudioDemuxer {
|
11094
11094
|
constructor(observer) {
|
11095
11095
|
super();
|
11096
|
-
this.observer =
|
11096
|
+
this.observer = undefined;
|
11097
11097
|
this.observer = observer;
|
11098
11098
|
}
|
11099
11099
|
resetInitSegment(initSegment, audioCodec, videoCodec, trackDuration) {
|
@@ -11233,7 +11233,7 @@ class MP3Demuxer extends BaseAudioDemuxer {
|
|
11233
11233
|
// Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
|
11234
11234
|
// More info http://www.mp3-tech.org/programmer/frame_header.html
|
11235
11235
|
const id3Data = getId3Data(data, 0);
|
11236
|
-
let offset = (id3Data == null ?
|
11236
|
+
let offset = (id3Data == null ? undefined : id3Data.length) || 0;
|
11237
11237
|
|
11238
11238
|
// Check for ac-3|ec-3 sync bytes and return false if present
|
11239
11239
|
if (id3Data && data[offset] === 0x0b && data[offset + 1] === 0x77 && getId3Timestamp(id3Data) !== undefined &&
|
@@ -11265,11 +11265,11 @@ class MP4Demuxer {
|
|
11265
11265
|
constructor(observer, config) {
|
11266
11266
|
this.remainderData = null;
|
11267
11267
|
this.timeOffset = 0;
|
11268
|
-
this.config =
|
11269
|
-
this.videoTrack =
|
11270
|
-
this.audioTrack =
|
11271
|
-
this.id3Track =
|
11272
|
-
this.txtTrack =
|
11268
|
+
this.config = undefined;
|
11269
|
+
this.videoTrack = undefined;
|
11270
|
+
this.audioTrack = undefined;
|
11271
|
+
this.id3Track = undefined;
|
11272
|
+
this.txtTrack = undefined;
|
11273
11273
|
this.config = config;
|
11274
11274
|
}
|
11275
11275
|
resetTimeStamp() {}
|
@@ -11415,8 +11415,8 @@ function getEmsgStartTime(emsgInfo, timeOffset) {
|
|
11415
11415
|
|
11416
11416
|
class SampleAesDecrypter {
|
11417
11417
|
constructor(observer, config, keyData) {
|
11418
|
-
this.keyData =
|
11419
|
-
this.decrypter =
|
11418
|
+
this.keyData = undefined;
|
11419
|
+
this.decrypter = undefined;
|
11420
11420
|
this.keyData = keyData;
|
11421
11421
|
this.decrypter = new Decrypter(config, {
|
11422
11422
|
removePKCS7Padding: false
|
@@ -11674,10 +11674,10 @@ class BaseVideoParser {
|
|
11674
11674
|
|
11675
11675
|
class ExpGolomb {
|
11676
11676
|
constructor(data) {
|
11677
|
-
this.data =
|
11678
|
-
this.bytesAvailable =
|
11679
|
-
this.word =
|
11680
|
-
this.bitsAvailable =
|
11677
|
+
this.data = undefined;
|
11678
|
+
this.bytesAvailable = undefined;
|
11679
|
+
this.word = undefined;
|
11680
|
+
this.bitsAvailable = undefined;
|
11681
11681
|
this.data = data;
|
11682
11682
|
// the number of bytes left to examine in this.data
|
11683
11683
|
this.bytesAvailable = data.byteLength;
|
@@ -11892,7 +11892,7 @@ class AvcVideoParser extends BaseVideoParser {
|
|
11892
11892
|
spsfound = true;
|
11893
11893
|
const sps = unit.data;
|
11894
11894
|
const config = this.readSPS(sps);
|
11895
|
-
if (!track.sps || track.width !== config.width || track.height !== config.height || ((_track$pixelRatio = track.pixelRatio) == null ?
|
11895
|
+
if (!track.sps || track.width !== config.width || track.height !== config.height || ((_track$pixelRatio = track.pixelRatio) == null ? undefined : _track$pixelRatio[0]) !== config.pixelRatio[0] || ((_track$pixelRatio2 = track.pixelRatio) == null ? undefined : _track$pixelRatio2[1]) !== config.pixelRatio[1]) {
|
11896
11896
|
track.width = config.width;
|
11897
11897
|
track.height = config.height;
|
11898
11898
|
track.pixelRatio = config.pixelRatio;
|
@@ -12740,22 +12740,22 @@ class HevcVideoParser extends BaseVideoParser {
|
|
12740
12740
|
const PACKET_LENGTH = 188;
|
12741
12741
|
class TSDemuxer {
|
12742
12742
|
constructor(observer, config, typeSupported, logger) {
|
12743
|
-
this.logger =
|
12744
|
-
this.observer =
|
12745
|
-
this.config =
|
12746
|
-
this.typeSupported =
|
12743
|
+
this.logger = undefined;
|
12744
|
+
this.observer = undefined;
|
12745
|
+
this.config = undefined;
|
12746
|
+
this.typeSupported = undefined;
|
12747
12747
|
this.sampleAes = null;
|
12748
12748
|
this.pmtParsed = false;
|
12749
|
-
this.audioCodec =
|
12750
|
-
this.videoCodec =
|
12749
|
+
this.audioCodec = undefined;
|
12750
|
+
this.videoCodec = undefined;
|
12751
12751
|
this._pmtId = -1;
|
12752
|
-
this._videoTrack =
|
12753
|
-
this._audioTrack =
|
12754
|
-
this._id3Track =
|
12755
|
-
this._txtTrack =
|
12752
|
+
this._videoTrack = undefined;
|
12753
|
+
this._audioTrack = undefined;
|
12754
|
+
this._id3Track = undefined;
|
12755
|
+
this._txtTrack = undefined;
|
12756
12756
|
this.aacOverFlow = null;
|
12757
12757
|
this.remainderData = null;
|
12758
|
-
this.videoParser =
|
12758
|
+
this.videoParser = undefined;
|
12759
12759
|
this.observer = observer;
|
12760
12760
|
this.config = config;
|
12761
12761
|
this.typeSupported = typeSupported;
|
@@ -14292,17 +14292,17 @@ class MP4 {
|
|
14292
14292
|
vSpacing >> 16 & 0xff, vSpacing >> 8 & 0xff, vSpacing & 0xff])));
|
14293
14293
|
}
|
14294
14294
|
}
|
14295
|
-
MP4.types =
|
14296
|
-
MP4.HDLR_TYPES =
|
14297
|
-
MP4.STTS =
|
14298
|
-
MP4.STSC =
|
14299
|
-
MP4.STCO =
|
14300
|
-
MP4.STSZ =
|
14301
|
-
MP4.VMHD =
|
14302
|
-
MP4.SMHD =
|
14303
|
-
MP4.STSD =
|
14304
|
-
MP4.FTYP =
|
14305
|
-
MP4.DINF =
|
14295
|
+
MP4.types = undefined;
|
14296
|
+
MP4.HDLR_TYPES = undefined;
|
14297
|
+
MP4.STTS = undefined;
|
14298
|
+
MP4.STSC = undefined;
|
14299
|
+
MP4.STCO = undefined;
|
14300
|
+
MP4.STSZ = undefined;
|
14301
|
+
MP4.VMHD = undefined;
|
14302
|
+
MP4.SMHD = undefined;
|
14303
|
+
MP4.STSD = undefined;
|
14304
|
+
MP4.FTYP = undefined;
|
14305
|
+
MP4.DINF = undefined;
|
14306
14306
|
|
14307
14307
|
const MPEG_TS_CLOCK_FREQ_HZ = 90000;
|
14308
14308
|
function toTimescaleFromBase(baseTime, destScale, srcBase = 1, round = false) {
|
@@ -14342,10 +14342,10 @@ function createMp4Sample(isKeyframe, duration, size, cts) {
|
|
14342
14342
|
}
|
14343
14343
|
class MP4Remuxer {
|
14344
14344
|
constructor(observer, config, typeSupported, logger) {
|
14345
|
-
this.logger =
|
14346
|
-
this.observer =
|
14347
|
-
this.config =
|
14348
|
-
this.typeSupported =
|
14345
|
+
this.logger = undefined;
|
14346
|
+
this.observer = undefined;
|
14347
|
+
this.config = undefined;
|
14348
|
+
this.typeSupported = undefined;
|
14349
14349
|
this.ISGenerated = false;
|
14350
14350
|
this._initPTS = null;
|
14351
14351
|
this._initDTS = null;
|
@@ -14354,7 +14354,7 @@ class MP4Remuxer {
|
|
14354
14354
|
this.videoSampleDuration = null;
|
14355
14355
|
this.isAudioContiguous = false;
|
14356
14356
|
this.isVideoContiguous = false;
|
14357
|
-
this.videoTrackConfig =
|
14357
|
+
this.videoTrackConfig = undefined;
|
14358
14358
|
this.observer = observer;
|
14359
14359
|
this.config = config;
|
14360
14360
|
this.typeSupported = typeSupported;
|
@@ -14436,7 +14436,7 @@ class MP4Remuxer {
|
|
14436
14436
|
if (this.ISGenerated) {
|
14437
14437
|
var _videoTrack$pixelRati, _config$pixelRatio, _videoTrack$pixelRati2, _config$pixelRatio2;
|
14438
14438
|
const config = this.videoTrackConfig;
|
14439
|
-
if (config && (videoTrack.width !== config.width || videoTrack.height !== config.height || ((_videoTrack$pixelRati = videoTrack.pixelRatio) == null ?
|
14439
|
+
if (config && (videoTrack.width !== config.width || videoTrack.height !== config.height || ((_videoTrack$pixelRati = videoTrack.pixelRatio) == null ? undefined : _videoTrack$pixelRati[0]) !== ((_config$pixelRatio = config.pixelRatio) == null ? undefined : _config$pixelRatio[0]) || ((_videoTrack$pixelRati2 = videoTrack.pixelRatio) == null ? undefined : _videoTrack$pixelRati2[1]) !== ((_config$pixelRatio2 = config.pixelRatio) == null ? undefined : _config$pixelRatio2[1])) || !config && enoughVideoSamples || this.nextAudioPts === null && enoughAudioSamples) {
|
14440
14440
|
this.resetInitSegment();
|
14441
14441
|
}
|
14442
14442
|
}
|
@@ -15186,13 +15186,13 @@ function flushTextTrackUserdataCueSamples(track, timeOffset, initPTS) {
|
|
15186
15186
|
|
15187
15187
|
class PassThroughRemuxer {
|
15188
15188
|
constructor(observer, config, typeSupported, logger) {
|
15189
|
-
this.logger =
|
15189
|
+
this.logger = undefined;
|
15190
15190
|
this.emitInitSegment = false;
|
15191
|
-
this.audioCodec =
|
15192
|
-
this.videoCodec =
|
15193
|
-
this.initData =
|
15191
|
+
this.audioCodec = undefined;
|
15192
|
+
this.videoCodec = undefined;
|
15193
|
+
this.initData = undefined;
|
15194
15194
|
this.initPTS = null;
|
15195
|
-
this.initTracks =
|
15195
|
+
this.initTracks = undefined;
|
15196
15196
|
this.lastEndTime = null;
|
15197
15197
|
this.logger = logger;
|
15198
15198
|
}
|
@@ -15364,7 +15364,7 @@ function isInvalidInitPts(initPTS, startDTS, timeOffset, duration) {
|
|
15364
15364
|
return Math.abs(startTime - timeOffset) > minDuration;
|
15365
15365
|
}
|
15366
15366
|
function getParsedTrackCodec(track, type) {
|
15367
|
-
const parsedCodec = track == null ?
|
15367
|
+
const parsedCodec = track == null ? undefined : track.codec;
|
15368
15368
|
if (parsedCodec && parsedCodec.length > 4) {
|
15369
15369
|
return parsedCodec;
|
15370
15370
|
}
|
@@ -15415,18 +15415,18 @@ const muxConfig = [{
|
|
15415
15415
|
class Transmuxer {
|
15416
15416
|
constructor(observer, typeSupported, config, vendor, id, logger) {
|
15417
15417
|
this.asyncResult = false;
|
15418
|
-
this.logger =
|
15419
|
-
this.observer =
|
15420
|
-
this.typeSupported =
|
15421
|
-
this.config =
|
15422
|
-
this.id =
|
15423
|
-
this.demuxer =
|
15424
|
-
this.remuxer =
|
15425
|
-
this.decrypter =
|
15426
|
-
this.probe =
|
15418
|
+
this.logger = undefined;
|
15419
|
+
this.observer = undefined;
|
15420
|
+
this.typeSupported = undefined;
|
15421
|
+
this.config = undefined;
|
15422
|
+
this.id = undefined;
|
15423
|
+
this.demuxer = undefined;
|
15424
|
+
this.remuxer = undefined;
|
15425
|
+
this.decrypter = undefined;
|
15426
|
+
this.probe = undefined;
|
15427
15427
|
this.decryptionPromise = null;
|
15428
|
-
this.transmuxConfig =
|
15429
|
-
this.currentTransmuxState =
|
15428
|
+
this.transmuxConfig = undefined;
|
15429
|
+
this.currentTransmuxState = undefined;
|
15430
15430
|
this.observer = observer;
|
15431
15431
|
this.typeSupported = typeSupported;
|
15432
15432
|
this.config = config;
|
@@ -15731,7 +15731,7 @@ class Transmuxer {
|
|
15731
15731
|
}
|
15732
15732
|
function getEncryptionType(data, decryptData) {
|
15733
15733
|
let encryptionType = null;
|
15734
|
-
if (data.byteLength > 0 && (decryptData == null ?
|
15734
|
+
if (data.byteLength > 0 && (decryptData == null ? undefined : decryptData.key) != null && decryptData.iv !== null && decryptData.method != null) {
|
15735
15735
|
encryptionType = decryptData;
|
15736
15736
|
}
|
15737
15737
|
return encryptionType;
|
@@ -15745,11 +15745,11 @@ function isPromise(p) {
|
|
15745
15745
|
}
|
15746
15746
|
class TransmuxConfig {
|
15747
15747
|
constructor(audioCodec, videoCodec, initSegmentData, duration, defaultInitPts) {
|
15748
|
-
this.audioCodec =
|
15749
|
-
this.videoCodec =
|
15750
|
-
this.initSegmentData =
|
15751
|
-
this.duration =
|
15752
|
-
this.defaultInitPts =
|
15748
|
+
this.audioCodec = undefined;
|
15749
|
+
this.videoCodec = undefined;
|
15750
|
+
this.initSegmentData = undefined;
|
15751
|
+
this.duration = undefined;
|
15752
|
+
this.defaultInitPts = undefined;
|
15753
15753
|
this.audioCodec = audioCodec;
|
15754
15754
|
this.videoCodec = videoCodec;
|
15755
15755
|
this.initSegmentData = initSegmentData;
|
@@ -15759,12 +15759,12 @@ class TransmuxConfig {
|
|
15759
15759
|
}
|
15760
15760
|
class TransmuxState {
|
15761
15761
|
constructor(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange) {
|
15762
|
-
this.discontinuity =
|
15763
|
-
this.contiguous =
|
15764
|
-
this.accurateTimeOffset =
|
15765
|
-
this.trackSwitch =
|
15766
|
-
this.timeOffset =
|
15767
|
-
this.initSegmentChange =
|
15762
|
+
this.discontinuity = undefined;
|
15763
|
+
this.contiguous = undefined;
|
15764
|
+
this.accurateTimeOffset = undefined;
|
15765
|
+
this.trackSwitch = undefined;
|
15766
|
+
this.timeOffset = undefined;
|
15767
|
+
this.initSegmentChange = undefined;
|
15768
15768
|
this.discontinuity = discontinuity;
|
15769
15769
|
this.contiguous = contiguous;
|
15770
15770
|
this.accurateTimeOffset = accurateTimeOffset;
|
@@ -15778,17 +15778,17 @@ let transmuxerInstanceCount = 0;
|
|
15778
15778
|
class TransmuxerInterface {
|
15779
15779
|
constructor(_hls, id, onTransmuxComplete, onFlush) {
|
15780
15780
|
this.error = null;
|
15781
|
-
this.hls =
|
15782
|
-
this.id =
|
15781
|
+
this.hls = undefined;
|
15782
|
+
this.id = undefined;
|
15783
15783
|
this.instanceNo = transmuxerInstanceCount++;
|
15784
|
-
this.observer =
|
15784
|
+
this.observer = undefined;
|
15785
15785
|
this.frag = null;
|
15786
15786
|
this.part = null;
|
15787
|
-
this.useWorker =
|
15787
|
+
this.useWorker = undefined;
|
15788
15788
|
this.workerContext = null;
|
15789
15789
|
this.transmuxer = null;
|
15790
|
-
this.onTransmuxComplete =
|
15791
|
-
this.onFlush =
|
15790
|
+
this.onTransmuxComplete = undefined;
|
15791
|
+
this.onFlush = undefined;
|
15792
15792
|
this.onWorkerMessage = event => {
|
15793
15793
|
const data = event.data;
|
15794
15794
|
const hls = this.hls;
|
@@ -15799,7 +15799,7 @@ class TransmuxerInterface {
|
|
15799
15799
|
case 'init':
|
15800
15800
|
{
|
15801
15801
|
var _this$workerContext;
|
15802
|
-
const objectURL = (_this$workerContext = this.workerContext) == null ?
|
15802
|
+
const objectURL = (_this$workerContext = this.workerContext) == null ? undefined : _this$workerContext.objectURL;
|
15803
15803
|
if (objectURL) {
|
15804
15804
|
// revoke the Object URL that was used to create transmuxer worker, so as not to leak it
|
15805
15805
|
self.URL.revokeObjectURL(objectURL);
|
@@ -15976,7 +15976,7 @@ class TransmuxerInterface {
|
|
15976
15976
|
const trackSwitch = !(lastFrag && chunkMeta.level === lastFrag.level);
|
15977
15977
|
const snDiff = lastFrag ? chunkMeta.sn - lastFrag.sn : -1;
|
15978
15978
|
const partDiff = this.part ? chunkMeta.part - this.part.index : -1;
|
15979
|
-
const progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag == null ?
|
15979
|
+
const progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag == null ? undefined : lastFrag.stats.chunkCount);
|
15980
15980
|
const contiguous = !trackSwitch && (snDiff === 1 || snDiff === 0 && (partDiff === 1 || progressive && partDiff <= 0));
|
15981
15981
|
const now = self.performance.now();
|
15982
15982
|
if (trackSwitch || snDiff || frag.stats.parsing.start === 0) {
|
@@ -15985,7 +15985,7 @@ class TransmuxerInterface {
|
|
15985
15985
|
if (part && (partDiff || !contiguous)) {
|
15986
15986
|
part.stats.parsing.start = now;
|
15987
15987
|
}
|
15988
|
-
const initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) == null ?
|
15988
|
+
const initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.url) === ((_lastFrag$initSegment = lastFrag.initSegment) == null ? undefined : _lastFrag$initSegment.url));
|
15989
15989
|
const state = new TransmuxState(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange);
|
15990
15990
|
if (!contiguous || discontinuity || initSegmentChange) {
|
15991
15991
|
this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${frag.type} sn: ${chunkMeta.sn}${chunkMeta.part > -1 ? ' part: ' + chunkMeta.part : ''} ${this.id === PlaylistLevelType.MAIN ? 'level' : 'track'}: ${chunkMeta.level} id: ${chunkMeta.id}
|
@@ -16252,8 +16252,8 @@ class AudioStreamController extends BaseStreamController {
|
|
16252
16252
|
levels,
|
16253
16253
|
trackId
|
16254
16254
|
} = this;
|
16255
|
-
const currenTrack = levels == null ?
|
16256
|
-
const details = currenTrack == null ?
|
16255
|
+
const currenTrack = levels == null ? undefined : levels[trackId];
|
16256
|
+
const details = currenTrack == null ? undefined : currenTrack.details;
|
16257
16257
|
if (details && !this.waitForLive(currenTrack)) {
|
16258
16258
|
if (this.waitForCdnTuneIn(details)) {
|
16259
16259
|
break;
|
@@ -16274,7 +16274,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16274
16274
|
trackId
|
16275
16275
|
} = this;
|
16276
16276
|
this.log('RetryDate reached, switch back to IDLE state');
|
16277
|
-
this.resetStartWhenNotLoaded((levels == null ?
|
16277
|
+
this.resetStartWhenNotLoaded((levels == null ? undefined : levels[trackId]) || null);
|
16278
16278
|
this.state = State.IDLE;
|
16279
16279
|
}
|
16280
16280
|
break;
|
@@ -16429,7 +16429,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16429
16429
|
}
|
16430
16430
|
|
16431
16431
|
// Request audio segments up to one fragment ahead of main stream-controller
|
16432
|
-
const mainFragLoading = (_this$mainFragLoading = this.mainFragLoading) == null ?
|
16432
|
+
const mainFragLoading = (_this$mainFragLoading = this.mainFragLoading) == null ? undefined : _this$mainFragLoading.frag;
|
16433
16433
|
if (!this.audioOnly && this.startFragRequested && mainFragLoading && isMediaFragment(mainFragLoading) && isMediaFragment(frag) && !frag.endList && (!trackDetails.live || !this.loadingParts && targetBufferTime < this.hls.liveSyncPosition)) {
|
16434
16434
|
let mainFrag = mainFragLoading;
|
16435
16435
|
if (frag.start > mainFrag.end) {
|
@@ -16541,7 +16541,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16541
16541
|
}
|
16542
16542
|
if (trackLevel.details) {
|
16543
16543
|
var _this$levelLastLoaded;
|
16544
|
-
sliding = this.alignPlaylists(newDetails, trackLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ?
|
16544
|
+
sliding = this.alignPlaylists(newDetails, trackLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
|
16545
16545
|
}
|
16546
16546
|
if (!newDetails.alignedSliding) {
|
16547
16547
|
// Align audio rendition with the "main" playlist on discontinuity change
|
@@ -16610,7 +16610,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16610
16610
|
// Check if we have video initPTS
|
16611
16611
|
// If not we need to wait for it
|
16612
16612
|
const initPTS = this.initPTS[frag.cc];
|
16613
|
-
const initSegmentData = (_frag$initSegment = frag.initSegment) == null ?
|
16613
|
+
const initSegmentData = (_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.data;
|
16614
16614
|
if (initPTS !== undefined) {
|
16615
16615
|
// this.log(`Transmuxing ${sn} of [${details.startSN} ,${details.endSN}],track ${trackId}`);
|
16616
16616
|
// time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
|
@@ -16714,7 +16714,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16714
16714
|
case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:
|
16715
16715
|
case ErrorDetails.LEVEL_PARSING_ERROR:
|
16716
16716
|
// in case of non fatal error while loading track, if not retrying to load track, switch back to IDLE
|
16717
|
-
if (!data.levelRetry && this.state === State.WAITING_TRACK && ((_data$context = data.context) == null ?
|
16717
|
+
if (!data.levelRetry && this.state === State.WAITING_TRACK && ((_data$context = data.context) == null ? undefined : _data$context.type) === PlaylistContextType.AUDIO_TRACK) {
|
16718
16718
|
this.state = State.IDLE;
|
16719
16719
|
}
|
16720
16720
|
break;
|
@@ -16913,7 +16913,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16913
16913
|
media,
|
16914
16914
|
bufferedTrack
|
16915
16915
|
} = this;
|
16916
|
-
const bufferedAttributes = bufferedTrack == null ?
|
16916
|
+
const bufferedAttributes = bufferedTrack == null ? undefined : bufferedTrack.attrs;
|
16917
16917
|
const switchAttributes = switchingTrack.attrs;
|
16918
16918
|
if (media && bufferedAttributes && (bufferedAttributes.CHANNELS !== switchAttributes.CHANNELS || bufferedTrack.name !== switchingTrack.name || bufferedTrack.lang !== switchingTrack.lang)) {
|
16919
16919
|
if (useAlternateAudio(switchingTrack.url, this.hls)) {
|
@@ -16940,7 +16940,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16940
16940
|
class BasePlaylistController extends Logger {
|
16941
16941
|
constructor(hls, logPrefix) {
|
16942
16942
|
super(logPrefix, hls.logger);
|
16943
|
-
this.hls =
|
16943
|
+
this.hls = undefined;
|
16944
16944
|
this.canLoad = false;
|
16945
16945
|
this.timer = -1;
|
16946
16946
|
this.hls = hls;
|
@@ -16965,7 +16965,7 @@ class BasePlaylistController extends Logger {
|
|
16965
16965
|
this.clearTimer();
|
16966
16966
|
}
|
16967
16967
|
switchParams(playlistUri, previous, current) {
|
16968
|
-
const renditionReports = previous == null ?
|
16968
|
+
const renditionReports = previous == null ? undefined : previous.renditionReports;
|
16969
16969
|
if (renditionReports) {
|
16970
16970
|
let foundIndex = -1;
|
16971
16971
|
for (let i = 0; i < renditionReports.length; i++) {
|
@@ -16988,8 +16988,8 @@ class BasePlaylistController extends Logger {
|
|
16988
16988
|
}
|
16989
16989
|
if (foundIndex !== -1) {
|
16990
16990
|
const attr = renditionReports[foundIndex];
|
16991
|
-
const msn = parseInt(attr['LAST-MSN']) || (previous == null ?
|
16992
|
-
let part = parseInt(attr['LAST-PART']) || (previous == null ?
|
16991
|
+
const msn = parseInt(attr['LAST-MSN']) || (previous == null ? undefined : previous.lastPartSn);
|
16992
|
+
let part = parseInt(attr['LAST-PART']) || (previous == null ? undefined : previous.lastPartIndex);
|
16993
16993
|
if (this.hls.config.lowLatencyMode) {
|
16994
16994
|
const currentGoal = Math.min(previous.age - previous.partTarget, previous.targetduration);
|
16995
16995
|
if (part >= 0 && currentGoal > previous.partTarget) {
|
@@ -17253,7 +17253,7 @@ class AudioTrackController extends BasePlaylistController {
|
|
17253
17253
|
} = data;
|
17254
17254
|
const trackInActiveGroup = this.tracksInGroup[id];
|
17255
17255
|
if (!trackInActiveGroup || trackInActiveGroup.groupId !== groupId) {
|
17256
|
-
this.warn(`Audio track with id:${id} and group:${groupId} not found in active group ${trackInActiveGroup == null ?
|
17256
|
+
this.warn(`Audio track with id:${id} and group:${groupId} not found in active group ${trackInActiveGroup == null ? undefined : trackInActiveGroup.groupId}`);
|
17257
17257
|
return;
|
17258
17258
|
}
|
17259
17259
|
const curDetails = trackInActiveGroup.details;
|
@@ -17277,7 +17277,7 @@ class AudioTrackController extends BasePlaylistController {
|
|
17277
17277
|
const audioGroups = levelInfo.audioGroups || null;
|
17278
17278
|
const currentGroups = this.groupIds;
|
17279
17279
|
let currentTrack = this.currentTrack;
|
17280
|
-
if (!audioGroups || (currentGroups == null ?
|
17280
|
+
if (!audioGroups || (currentGroups == null ? undefined : currentGroups.length) !== (audioGroups == null ? undefined : audioGroups.length) || audioGroups != null && audioGroups.some(groupId => (currentGroups == null ? undefined : currentGroups.indexOf(groupId)) === -1)) {
|
17281
17281
|
this.groupIds = audioGroups;
|
17282
17282
|
this.trackId = -1;
|
17283
17283
|
this.currentTrack = null;
|
@@ -17319,14 +17319,14 @@ class AudioTrackController extends BasePlaylistController {
|
|
17319
17319
|
const audioTracksUpdated = {
|
17320
17320
|
audioTracks
|
17321
17321
|
};
|
17322
|
-
this.log(`Updating audio tracks, ${audioTracks.length} track(s) found in group(s): ${audioGroups == null ?
|
17322
|
+
this.log(`Updating audio tracks, ${audioTracks.length} track(s) found in group(s): ${audioGroups == null ? undefined : audioGroups.join(',')}`);
|
17323
17323
|
this.hls.trigger(Events.AUDIO_TRACKS_UPDATED, audioTracksUpdated);
|
17324
17324
|
const selectedTrackId = this.trackId;
|
17325
17325
|
if (trackId !== -1 && selectedTrackId === -1) {
|
17326
17326
|
this.setAudioTrack(trackId);
|
17327
17327
|
} else if (audioTracks.length && selectedTrackId === -1) {
|
17328
17328
|
var _this$groupIds;
|
17329
|
-
const error = new Error(`No audio track selected for current audio group-ID(s): ${(_this$groupIds = this.groupIds) == null ?
|
17329
|
+
const error = new Error(`No audio track selected for current audio group-ID(s): ${(_this$groupIds = this.groupIds) == null ? undefined : _this$groupIds.join(',')} track count: ${audioTracks.length}`);
|
17330
17330
|
this.warn(error.message);
|
17331
17331
|
this.hls.trigger(Events.ERROR, {
|
17332
17332
|
type: ErrorTypes.MEDIA_ERROR,
|
@@ -17426,7 +17426,7 @@ class AudioTrackController extends BasePlaylistController {
|
|
17426
17426
|
if (trackLoaded) {
|
17427
17427
|
return;
|
17428
17428
|
}
|
17429
|
-
const hlsUrlParameters = this.switchParams(track.url, lastTrack == null ?
|
17429
|
+
const hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? undefined : lastTrack.details, track.details);
|
17430
17430
|
this.loadPlaylist(hlsUrlParameters);
|
17431
17431
|
}
|
17432
17432
|
findTrackId(currentTrack) {
|
@@ -17494,8 +17494,8 @@ class AudioTrackController extends BasePlaylistController {
|
|
17494
17494
|
const groupId = audioTrack.groupId;
|
17495
17495
|
const url = this.getUrlWithDirectives(audioTrack.url, hlsUrlParameters);
|
17496
17496
|
const details = audioTrack.details;
|
17497
|
-
const age = details == null ?
|
17498
|
-
this.log(`Loading audio-track ${id} "${audioTrack.name}" lang:${audioTrack.lang} group:${groupId}${(hlsUrlParameters == null ?
|
17497
|
+
const age = details == null ? undefined : details.age;
|
17498
|
+
this.log(`Loading audio-track ${id} "${audioTrack.name}" lang:${audioTrack.lang} group:${groupId}${(hlsUrlParameters == null ? undefined : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
|
17499
17499
|
this.hls.trigger(Events.AUDIO_TRACK_LOADING, {
|
17500
17500
|
url,
|
17501
17501
|
id,
|
@@ -17508,7 +17508,7 @@ class AudioTrackController extends BasePlaylistController {
|
|
17508
17508
|
|
17509
17509
|
class BufferOperationQueue {
|
17510
17510
|
constructor(sourceBufferReference) {
|
17511
|
-
this.tracks =
|
17511
|
+
this.tracks = undefined;
|
17512
17512
|
this.queues = {
|
17513
17513
|
video: [],
|
17514
17514
|
audio: [],
|
@@ -17561,7 +17561,7 @@ class BufferOperationQueue {
|
|
17561
17561
|
}
|
17562
17562
|
[this.queues.video, this.queues.audio, this.queues.audiovideo].forEach(queue => {
|
17563
17563
|
var _queue$;
|
17564
|
-
const label = (_queue$ = queue[0]) == null ?
|
17564
|
+
const label = (_queue$ = queue[0]) == null ? undefined : _queue$.label;
|
17565
17565
|
if (label === 'async-blocker' || label === 'async-blocker-prepend') {
|
17566
17566
|
queue[0].execute();
|
17567
17567
|
queue.splice(0, 1);
|
@@ -17596,7 +17596,7 @@ class BufferOperationQueue {
|
|
17596
17596
|
}
|
17597
17597
|
|
17598
17598
|
// Only shift the current operation off, otherwise the updateend handler will do this for us
|
17599
|
-
const sb = (_this$tracks$type = this.tracks[type]) == null ?
|
17599
|
+
const sb = (_this$tracks$type = this.tracks[type]) == null ? undefined : _this$tracks$type.buffer;
|
17600
17600
|
if (!(sb != null && sb.updating)) {
|
17601
17601
|
this.shiftAndExecuteNext(type);
|
17602
17602
|
}
|
@@ -17612,7 +17612,7 @@ class BufferOperationQueue {
|
|
17612
17612
|
}
|
17613
17613
|
current(type) {
|
17614
17614
|
var _this$queues;
|
17615
|
-
return ((_this$queues = this.queues) == null ?
|
17615
|
+
return ((_this$queues = this.queues) == null ? undefined : _this$queues[type][0]) || null;
|
17616
17616
|
}
|
17617
17617
|
toString() {
|
17618
17618
|
const {
|
@@ -17633,8 +17633,8 @@ ${this.list('audiovideo')}}`;
|
|
17633
17633
|
}
|
17634
17634
|
listSbInfo(type) {
|
17635
17635
|
var _this$tracks2;
|
17636
|
-
const track = (_this$tracks2 = this.tracks) == null ?
|
17637
|
-
const sb = track == null ?
|
17636
|
+
const track = (_this$tracks2 = this.tracks) == null ? undefined : _this$tracks2[type];
|
17637
|
+
const sb = track == null ? undefined : track.buffer;
|
17638
17638
|
if (!sb) {
|
17639
17639
|
return 'none';
|
17640
17640
|
}
|
@@ -17642,7 +17642,7 @@ ${this.list('audiovideo')}}`;
|
|
17642
17642
|
}
|
17643
17643
|
listOps(type) {
|
17644
17644
|
var _this$queues3;
|
17645
|
-
return ((_this$queues3 = this.queues) == null ?
|
17645
|
+
return ((_this$queues3 = this.queues) == null ? undefined : _this$queues3[type].map(op => op.label).join(', ')) || '';
|
17646
17646
|
}
|
17647
17647
|
}
|
17648
17648
|
|
@@ -17657,8 +17657,8 @@ class HlsJsTrackRemovedError extends Error {
|
|
17657
17657
|
class BufferController extends Logger {
|
17658
17658
|
constructor(hls, fragmentTracker) {
|
17659
17659
|
super('buffer-controller', hls.logger);
|
17660
|
-
this.hls =
|
17661
|
-
this.fragmentTracker =
|
17660
|
+
this.hls = undefined;
|
17661
|
+
this.fragmentTracker = undefined;
|
17662
17662
|
// The level details used to determine duration, target-duration and live
|
17663
17663
|
this.details = null;
|
17664
17664
|
// cache the self generated object url to detect hijack of video tag
|
@@ -17678,11 +17678,11 @@ class BufferController extends Logger {
|
|
17678
17678
|
// Keep track of video append position for unblocking audio
|
17679
17679
|
this.lastVideoAppendEnd = 0;
|
17680
17680
|
// Whether or not to use ManagedMediaSource API and append source element to media element.
|
17681
|
-
this.appendSource =
|
17681
|
+
this.appendSource = undefined;
|
17682
17682
|
// Transferred MediaSource information used to detmerine if duration end endstream may be appended
|
17683
|
-
this.transferData =
|
17683
|
+
this.transferData = undefined;
|
17684
17684
|
// Directives used to override default MediaSource handling
|
17685
|
-
this.overrides =
|
17685
|
+
this.overrides = undefined;
|
17686
17686
|
// Error counters
|
17687
17687
|
this.appendErrors = {
|
17688
17688
|
audio: 0,
|
@@ -17698,7 +17698,7 @@ class BufferController extends Logger {
|
|
17698
17698
|
if (!this.hls) {
|
17699
17699
|
return;
|
17700
17700
|
}
|
17701
|
-
if (((_this$mediaSource = this.mediaSource) == null ?
|
17701
|
+
if (((_this$mediaSource = this.mediaSource) == null ? undefined : _this$mediaSource.readyState) !== 'open') {
|
17702
17702
|
return;
|
17703
17703
|
}
|
17704
17704
|
this.hls.pauseBuffering();
|
@@ -17871,7 +17871,7 @@ class BufferController extends Logger {
|
|
17871
17871
|
// in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
|
17872
17872
|
// it will contain the expected nb of source buffers, no need to compute it
|
17873
17873
|
let codecEvents = 2;
|
17874
|
-
if (data.audio && !data.video || !data.altAudio ||
|
17874
|
+
if (data.audio && !data.video || !data.altAudio || false) {
|
17875
17875
|
codecEvents = 1;
|
17876
17876
|
}
|
17877
17877
|
this.bufferCodecEventsTotal = codecEvents;
|
@@ -17920,7 +17920,7 @@ class BufferController extends Logger {
|
|
17920
17920
|
}
|
17921
17921
|
assignMediaSource(ms) {
|
17922
17922
|
var _this$transferData2, _ms$constructor;
|
17923
|
-
this.log(`${((_this$transferData2 = this.transferData) == null ?
|
17923
|
+
this.log(`${((_this$transferData2 = this.transferData) == null ? undefined : _this$transferData2.mediaSource) === ms ? 'transferred' : 'created'} media source: ${(_ms$constructor = ms.constructor) == null ? undefined : _ms$constructor.name}`);
|
17924
17924
|
// MediaSource listeners are arrow functions with a lexical scope, and do not need to be bound
|
17925
17925
|
ms.addEventListener('sourceopen', this._onMediaSourceOpen);
|
17926
17926
|
ms.addEventListener('sourceended', this._onMediaSourceEnded);
|
@@ -17961,7 +17961,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
17961
17961
|
data.tracks = undefined;
|
17962
17962
|
const currentTime = media.currentTime;
|
17963
17963
|
const details = this.details;
|
17964
|
-
const startTime = Math.max(currentTime, (details == null ?
|
17964
|
+
const startTime = Math.max(currentTime, (details == null ? undefined : details.fragments[0].start) || 0);
|
17965
17965
|
if (startTime - currentTime > 1) {
|
17966
17966
|
this.log(`attachTransferred: waiting for playback to reach new tracks start time ${currentTime} -> ${startTime}`);
|
17967
17967
|
return;
|
@@ -18006,7 +18006,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18006
18006
|
}
|
18007
18007
|
get mediaSourceOpenOrEnded() {
|
18008
18008
|
var _this$mediaSource2;
|
18009
|
-
const readyState = (_this$mediaSource2 = this.mediaSource) == null ?
|
18009
|
+
const readyState = (_this$mediaSource2 = this.mediaSource) == null ? undefined : _this$mediaSource2.readyState;
|
18010
18010
|
return readyState === 'open' || readyState === 'ended';
|
18011
18011
|
}
|
18012
18012
|
onMediaDetaching(event, data) {
|
@@ -18101,7 +18101,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18101
18101
|
}
|
18102
18102
|
resetBuffer(type) {
|
18103
18103
|
var _this$tracks$type;
|
18104
|
-
const sb = (_this$tracks$type = this.tracks[type]) == null ?
|
18104
|
+
const sb = (_this$tracks$type = this.tracks[type]) == null ? undefined : _this$tracks$type.buffer;
|
18105
18105
|
this.removeBuffer(type);
|
18106
18106
|
if (sb) {
|
18107
18107
|
try {
|
@@ -18153,10 +18153,10 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18153
18153
|
metadata
|
18154
18154
|
} = parsedTrack;
|
18155
18155
|
let track = tracks[trackName];
|
18156
|
-
const transferredTrack = (_this$transferData3 = this.transferData) == null ?
|
18156
|
+
const transferredTrack = (_this$transferData3 = this.transferData) == null ? undefined : (_this$transferData3$t = _this$transferData3.tracks) == null ? undefined : _this$transferData3$t[trackName];
|
18157
18157
|
const sbTrack = transferredTrack != null && transferredTrack.buffer ? transferredTrack : track;
|
18158
|
-
const sbCodec = (sbTrack == null ?
|
18159
|
-
const trackLevelCodec = sbTrack == null ?
|
18158
|
+
const sbCodec = (sbTrack == null ? undefined : sbTrack.pendingCodec) || (sbTrack == null ? undefined : sbTrack.codec);
|
18159
|
+
const trackLevelCodec = sbTrack == null ? undefined : sbTrack.levelCodec;
|
18160
18160
|
const forceChangeType = !sbTrack || !!this.hls.config.assetPlayerId;
|
18161
18161
|
if (!track) {
|
18162
18162
|
track = tracks[trackName] = {
|
@@ -18171,9 +18171,9 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18171
18171
|
}
|
18172
18172
|
// check if SourceBuffer codec needs to change
|
18173
18173
|
const currentCodecFull = pickMostCompleteCodecName(sbCodec, trackLevelCodec);
|
18174
|
-
const currentCodec = currentCodecFull == null ?
|
18174
|
+
const currentCodec = currentCodecFull == null ? undefined : currentCodecFull.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
|
18175
18175
|
let trackCodec = pickMostCompleteCodecName(codec, levelCodec);
|
18176
|
-
const nextCodec = (_trackCodec = trackCodec) == null ?
|
18176
|
+
const nextCodec = (_trackCodec = trackCodec) == null ? undefined : _trackCodec.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
|
18177
18177
|
if (trackCodec && (currentCodec !== nextCodec || forceChangeType)) {
|
18178
18178
|
if (trackName.slice(0, 5) === 'audio') {
|
18179
18179
|
trackCodec = getCodecCompatibleName(trackCodec, this.appendSource);
|
@@ -18239,7 +18239,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18239
18239
|
var _this$fragmentTracker;
|
18240
18240
|
const pStart = partOrFrag.start;
|
18241
18241
|
const pTime = pStart + partOrFrag.duration * 0.05;
|
18242
|
-
const atGap = ((_this$fragmentTracker = this.fragmentTracker.getAppendedFrag(pStart, PlaylistLevelType.MAIN)) == null ?
|
18242
|
+
const atGap = ((_this$fragmentTracker = this.fragmentTracker.getAppendedFrag(pStart, PlaylistLevelType.MAIN)) == null ? undefined : _this$fragmentTracker.gap) === true;
|
18243
18243
|
if (atGap) {
|
18244
18244
|
return;
|
18245
18245
|
}
|
@@ -18248,7 +18248,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18248
18248
|
execute: () => {
|
18249
18249
|
var _this$fragmentTracker2;
|
18250
18250
|
const videoTrack = this.tracks.video;
|
18251
|
-
if (this.lastVideoAppendEnd > pTime || videoTrack != null && videoTrack.buffer && BufferHelper.isBuffered(videoTrack.buffer, pTime) || ((_this$fragmentTracker2 = this.fragmentTracker.getAppendedFrag(pTime, PlaylistLevelType.MAIN)) == null ?
|
18251
|
+
if (this.lastVideoAppendEnd > pTime || videoTrack != null && videoTrack.buffer && BufferHelper.isBuffered(videoTrack.buffer, pTime) || ((_this$fragmentTracker2 = this.fragmentTracker.getAppendedFrag(pTime, PlaylistLevelType.MAIN)) == null ? undefined : _this$fragmentTracker2.gap) === true) {
|
18252
18252
|
this.blockedAudioAppend = null;
|
18253
18253
|
this.shiftAndExecuteNext('audio');
|
18254
18254
|
}
|
@@ -18307,14 +18307,14 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18307
18307
|
// More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486
|
18308
18308
|
const audioTrack = tracks.audio;
|
18309
18309
|
let checkTimestampOffset = false;
|
18310
|
-
if (type === 'audio' && (audioTrack == null ?
|
18310
|
+
if (type === 'audio' && (audioTrack == null ? undefined : audioTrack.container) === 'audio/mpeg') {
|
18311
18311
|
checkTimestampOffset = !this.lastMpegAudioChunk || chunkMeta.id === 1 || this.lastMpegAudioChunk.sn !== chunkMeta.sn;
|
18312
18312
|
this.lastMpegAudioChunk = chunkMeta;
|
18313
18313
|
}
|
18314
18314
|
|
18315
18315
|
// Block audio append until overlapping video append
|
18316
18316
|
const videoTrack = this.tracks.video;
|
18317
|
-
const videoSb = videoTrack == null ?
|
18317
|
+
const videoSb = videoTrack == null ? undefined : videoTrack.buffer;
|
18318
18318
|
if (videoSb && sn !== 'initSegment') {
|
18319
18319
|
const partOrFrag = part || frag;
|
18320
18320
|
const blockedAudioAppend = this.blockedAudioAppend;
|
@@ -18519,7 +18519,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18519
18519
|
get bufferedToEnd() {
|
18520
18520
|
return this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
|
18521
18521
|
var _this$tracks$type2, _this$tracks$type3;
|
18522
|
-
return type && (!((_this$tracks$type2 = this.tracks[type]) != null && _this$tracks$type2.ended) || ((_this$tracks$type3 = this.tracks[type]) == null ?
|
18522
|
+
return type && (!((_this$tracks$type2 = this.tracks[type]) != null && _this$tracks$type2.ended) || ((_this$tracks$type3 = this.tracks[type]) == null ? undefined : _this$tracks$type3.ending));
|
18523
18523
|
});
|
18524
18524
|
}
|
18525
18525
|
|
@@ -18539,7 +18539,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18539
18539
|
}
|
18540
18540
|
}
|
18541
18541
|
});
|
18542
|
-
const allowEndOfStream = ((_this$overrides = this.overrides) == null ?
|
18542
|
+
const allowEndOfStream = ((_this$overrides = this.overrides) == null ? undefined : _this$overrides.endOfStream) !== false;
|
18543
18543
|
const allTracksEnding = this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
|
18544
18544
|
var _this$tracks$type4;
|
18545
18545
|
return type && !((_this$tracks$type4 = this.tracks[type]) != null && _this$tracks$type4.ended);
|
@@ -18592,7 +18592,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18592
18592
|
onError(event, data) {
|
18593
18593
|
if (data.details === ErrorDetails.BUFFER_APPEND_ERROR && data.frag) {
|
18594
18594
|
var _data$errorAction;
|
18595
|
-
const nextAutoLevel = (_data$errorAction = data.errorAction) == null ?
|
18595
|
+
const nextAutoLevel = (_data$errorAction = data.errorAction) == null ? undefined : _data$errorAction.nextAutoLevel;
|
18596
18596
|
if (isFiniteNumber(nextAutoLevel) && nextAutoLevel !== data.frag.level) {
|
18597
18597
|
this.resetAppendErrors();
|
18598
18598
|
}
|
@@ -18700,7 +18700,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18700
18700
|
details,
|
18701
18701
|
mediaSource
|
18702
18702
|
} = this;
|
18703
|
-
if (!details || !this.media || (mediaSource == null ?
|
18703
|
+
if (!details || !this.media || (mediaSource == null ? undefined : mediaSource.readyState) !== 'open') {
|
18704
18704
|
return null;
|
18705
18705
|
}
|
18706
18706
|
const playlistEnd = details.edge;
|
@@ -18721,7 +18721,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18721
18721
|
duration: Infinity
|
18722
18722
|
};
|
18723
18723
|
}
|
18724
|
-
const overrideDuration = (_this$overrides2 = this.overrides) == null ?
|
18724
|
+
const overrideDuration = (_this$overrides2 = this.overrides) == null ? undefined : _this$overrides2.duration;
|
18725
18725
|
if (overrideDuration) {
|
18726
18726
|
return {
|
18727
18727
|
duration: overrideDuration
|
@@ -18773,7 +18773,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18773
18773
|
// 2 tracks is the max (one for audio, one for video). If we've reach this max go ahead and create the buffers.
|
18774
18774
|
if (this.tracksReady) {
|
18775
18775
|
var _this$transferData4;
|
18776
|
-
const transferredTracks = (_this$transferData4 = this.transferData) == null ?
|
18776
|
+
const transferredTracks = (_this$transferData4 = this.transferData) == null ? undefined : _this$transferData4.tracks;
|
18777
18777
|
if (transferredTracks && Object.keys(transferredTracks).length) {
|
18778
18778
|
this.attachTransferred();
|
18779
18779
|
} else {
|
@@ -18899,8 +18899,8 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18899
18899
|
}
|
18900
18900
|
get mediaSrc() {
|
18901
18901
|
var _this$media2, _this$media2$querySel;
|
18902
|
-
const media = ((_this$media2 = this.media) == null ?
|
18903
|
-
return media == null ?
|
18902
|
+
const media = ((_this$media2 = this.media) == null ? undefined : (_this$media2$querySel = _this$media2.querySelector) == null ? undefined : _this$media2$querySel.call(_this$media2, 'source')) || this.media;
|
18903
|
+
return media == null ? undefined : media.src;
|
18904
18904
|
}
|
18905
18905
|
onSBUpdateStart(type) {
|
18906
18906
|
const operation = this.currentOp(type);
|
@@ -18911,7 +18911,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18911
18911
|
}
|
18912
18912
|
onSBUpdateEnd(type) {
|
18913
18913
|
var _this$mediaSource4;
|
18914
|
-
if (((_this$mediaSource4 = this.mediaSource) == null ?
|
18914
|
+
if (((_this$mediaSource4 = this.mediaSource) == null ? undefined : _this$mediaSource4.readyState) === 'closed') {
|
18915
18915
|
this.resetBuffer(type);
|
18916
18916
|
return;
|
18917
18917
|
}
|
@@ -18924,7 +18924,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18924
18924
|
}
|
18925
18925
|
onSBUpdateError(type, event) {
|
18926
18926
|
var _this$mediaSource5;
|
18927
|
-
const error = new Error(`${type} SourceBuffer error. MediaSource readyState: ${(_this$mediaSource5 = this.mediaSource) == null ?
|
18927
|
+
const error = new Error(`${type} SourceBuffer error. MediaSource readyState: ${(_this$mediaSource5 = this.mediaSource) == null ? undefined : _this$mediaSource5.readyState}`);
|
18928
18928
|
this.error(`${error}`, event);
|
18929
18929
|
// according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
|
18930
18930
|
// SourceBuffer errors are not necessarily fatal; if so, the HTMLMediaElement will fire an error event
|
@@ -18949,7 +18949,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18949
18949
|
mediaSource
|
18950
18950
|
} = this;
|
18951
18951
|
const track = this.tracks[type];
|
18952
|
-
const sb = track == null ?
|
18952
|
+
const sb = track == null ? undefined : track.buffer;
|
18953
18953
|
if (!media || !mediaSource || !sb) {
|
18954
18954
|
this.warn(`Attempting to remove from the ${type} SourceBuffer, but it does not exist`);
|
18955
18955
|
this.shiftAndExecuteNext(type);
|
@@ -18972,7 +18972,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
18972
18972
|
// This method must result in an updateend event; if append is not called, onSBUpdateEnd must be called manually
|
18973
18973
|
appendExecutor(data, type) {
|
18974
18974
|
const track = this.tracks[type];
|
18975
|
-
const sb = track == null ?
|
18975
|
+
const sb = track == null ? undefined : track.buffer;
|
18976
18976
|
if (!sb) {
|
18977
18977
|
throw new HlsJsTrackRemovedError(`Attempting to append to the ${type} SourceBuffer, but it does not exist`);
|
18978
18978
|
}
|
@@ -19028,7 +19028,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
|
|
19028
19028
|
stepOperationQueue(bufferNames) {
|
19029
19029
|
bufferNames.forEach(type => {
|
19030
19030
|
var _this$tracks$type5;
|
19031
|
-
const sb = (_this$tracks$type5 = this.tracks[type]) == null ?
|
19031
|
+
const sb = (_this$tracks$type5 = this.tracks[type]) == null ? undefined : _this$tracks$type5.buffer;
|
19032
19032
|
// Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
|
19033
19033
|
// true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
|
19034
19034
|
// While this is a workaround, it's probably useful to have around
|
@@ -19122,14 +19122,14 @@ function sourceBufferNameToIndex(type) {
|
|
19122
19122
|
|
19123
19123
|
class CapLevelController {
|
19124
19124
|
constructor(hls) {
|
19125
|
-
this.hls =
|
19126
|
-
this.autoLevelCapping =
|
19127
|
-
this.firstLevel =
|
19128
|
-
this.media =
|
19129
|
-
this.restrictedLevels =
|
19130
|
-
this.timer =
|
19131
|
-
this.clientRect =
|
19132
|
-
this.streamController =
|
19125
|
+
this.hls = undefined;
|
19126
|
+
this.autoLevelCapping = undefined;
|
19127
|
+
this.firstLevel = undefined;
|
19128
|
+
this.media = undefined;
|
19129
|
+
this.restrictedLevels = undefined;
|
19130
|
+
this.timer = undefined;
|
19131
|
+
this.clientRect = undefined;
|
19132
|
+
this.streamController = undefined;
|
19133
19133
|
this.hls = hls;
|
19134
19134
|
this.autoLevelCapping = Number.POSITIVE_INFINITY;
|
19135
19135
|
this.firstLevel = -1;
|
@@ -20000,7 +20000,7 @@ function serializeDict(dict, options = {
|
|
20000
20000
|
throw serializeError(dict, DICT);
|
20001
20001
|
}
|
20002
20002
|
const entries = dict instanceof Map ? dict.entries() : Object.entries(dict);
|
20003
|
-
const optionalWhiteSpace = (options === null || options ===
|
20003
|
+
const optionalWhiteSpace = (options === null || options === undefined ? undefined : options.whitespace) ? ' ' : '';
|
20004
20004
|
return Array.from(entries).map(([key, item]) => {
|
20005
20005
|
if (item instanceof SfItem === false) {
|
20006
20006
|
item = new SfItem(item);
|
@@ -20067,7 +20067,7 @@ function isValid(value) {
|
|
20067
20067
|
|
20068
20068
|
const toRounded = value => Math.round(value);
|
20069
20069
|
const toUrlSafe = (value, options) => {
|
20070
|
-
if (options === null || options ===
|
20070
|
+
if (options === null || options === undefined ? undefined : options.baseUrl) {
|
20071
20071
|
value = urlToRelativePath(value, options.baseUrl);
|
20072
20072
|
}
|
20073
20073
|
return encodeURIComponent(value);
|
@@ -20132,10 +20132,10 @@ function processCmcd(obj, options) {
|
|
20132
20132
|
return results;
|
20133
20133
|
}
|
20134
20134
|
const keys = Object.keys(obj).sort();
|
20135
|
-
const formatters = _extends({}, CmcdFormatters, options === null || options ===
|
20136
|
-
const filter = options === null || options ===
|
20135
|
+
const formatters = _extends({}, CmcdFormatters, options === null || options === undefined ? undefined : options.formatters);
|
20136
|
+
const filter = options === null || options === undefined ? undefined : options.filter;
|
20137
20137
|
keys.forEach(key => {
|
20138
|
-
if (filter === null || filter ===
|
20138
|
+
if (filter === null || filter === undefined ? undefined : filter(key)) {
|
20139
20139
|
return;
|
20140
20140
|
}
|
20141
20141
|
let value = obj[key];
|
@@ -20202,12 +20202,12 @@ function toCmcdHeaders(cmcd, options = {}) {
|
|
20202
20202
|
return result;
|
20203
20203
|
}
|
20204
20204
|
const entries = Object.entries(cmcd);
|
20205
|
-
const headerMap = Object.entries(CmcdHeaderMap).concat(Object.entries((options === null || options ===
|
20205
|
+
const headerMap = Object.entries(CmcdHeaderMap).concat(Object.entries((options === null || options === undefined ? undefined : options.customHeaderMap) || {}));
|
20206
20206
|
const shards = entries.reduce((acc, entry) => {
|
20207
20207
|
var _a, _b;
|
20208
20208
|
const [key, value] = entry;
|
20209
|
-
const field = ((_a = headerMap.find(entry => entry[1].includes(key))) === null || _a ===
|
20210
|
-
(_b = acc[field]) !== null && _b !==
|
20209
|
+
const field = ((_a = headerMap.find(entry => entry[1].includes(key))) === null || _a === undefined ? undefined : _a[0]) || CmcdHeaderField.REQUEST;
|
20210
|
+
(_b = acc[field]) !== null && _b !== undefined ? _b : acc[field] = {};
|
20211
20211
|
acc[field][key] = value;
|
20212
20212
|
return acc;
|
20213
20213
|
}, {});
|
@@ -20297,18 +20297,18 @@ function appendCmcdQuery(url, cmcd, options) {
|
|
20297
20297
|
*/
|
20298
20298
|
class CMCDController {
|
20299
20299
|
constructor(hls) {
|
20300
|
-
this.hls =
|
20301
|
-
this.config =
|
20302
|
-
this.media =
|
20303
|
-
this.sid =
|
20304
|
-
this.cid =
|
20300
|
+
this.hls = undefined;
|
20301
|
+
this.config = undefined;
|
20302
|
+
this.media = undefined;
|
20303
|
+
this.sid = undefined;
|
20304
|
+
this.cid = undefined;
|
20305
20305
|
this.useHeaders = false;
|
20306
|
-
this.includeKeys =
|
20306
|
+
this.includeKeys = undefined;
|
20307
20307
|
this.initialized = false;
|
20308
20308
|
this.starved = false;
|
20309
20309
|
this.buffering = true;
|
20310
|
-
this.audioBuffer =
|
20311
|
-
this.videoBuffer =
|
20310
|
+
this.audioBuffer = undefined;
|
20311
|
+
this.videoBuffer = undefined;
|
20312
20312
|
this.onWaiting = () => {
|
20313
20313
|
if (this.initialized) {
|
20314
20314
|
this.starved = true;
|
@@ -20416,8 +20416,8 @@ class CMCDController {
|
|
20416
20416
|
}
|
20417
20417
|
onBufferCreated(event, data) {
|
20418
20418
|
var _data$tracks$audio, _data$tracks$video;
|
20419
|
-
this.audioBuffer = (_data$tracks$audio = data.tracks.audio) == null ?
|
20420
|
-
this.videoBuffer = (_data$tracks$video = data.tracks.video) == null ?
|
20419
|
+
this.audioBuffer = (_data$tracks$audio = data.tracks.audio) == null ? undefined : _data$tracks$audio.buffer;
|
20420
|
+
this.videoBuffer = (_data$tracks$video = data.tracks.video) == null ? undefined : _data$tracks$video.buffer;
|
20421
20421
|
}
|
20422
20422
|
/**
|
20423
20423
|
* Create baseline CMCD data
|
@@ -20429,7 +20429,7 @@ class CMCDController {
|
|
20429
20429
|
sf: CmcdStreamingFormat.HLS,
|
20430
20430
|
sid: this.sid,
|
20431
20431
|
cid: this.cid,
|
20432
|
-
pr: (_this$media = this.media) == null ?
|
20432
|
+
pr: (_this$media = this.media) == null ? undefined : _this$media.playbackRate,
|
20433
20433
|
mtp: this.hls.bandwidthEstimate / 1000
|
20434
20434
|
};
|
20435
20435
|
}
|
@@ -20475,7 +20475,7 @@ class CMCDController {
|
|
20475
20475
|
}
|
20476
20476
|
getNextFrag(fragment) {
|
20477
20477
|
var _this$hls$levels$frag;
|
20478
|
-
const levelDetails = (_this$hls$levels$frag = this.hls.levels[fragment.level]) == null ?
|
20478
|
+
const levelDetails = (_this$hls$levels$frag = this.hls.levels[fragment.level]) == null ? undefined : _this$hls$levels$frag.details;
|
20479
20479
|
if (levelDetails) {
|
20480
20480
|
const index = fragment.sn - levelDetails.startSN;
|
20481
20481
|
return levelDetails.fragments[index + 1];
|
@@ -20488,7 +20488,7 @@ class CMCDController {
|
|
20488
20488
|
index,
|
20489
20489
|
fragment
|
20490
20490
|
} = part;
|
20491
|
-
const partList = (_this$hls$levels$frag2 = this.hls.levels[fragment.level]) == null ?
|
20491
|
+
const partList = (_this$hls$levels$frag2 = this.hls.levels[fragment.level]) == null ? undefined : (_this$hls$levels$frag3 = _this$hls$levels$frag2.details) == null ? undefined : _this$hls$levels$frag3.partList;
|
20492
20492
|
if (partList) {
|
20493
20493
|
const {
|
20494
20494
|
sn
|
@@ -20574,7 +20574,7 @@ class CMCDController {
|
|
20574
20574
|
const Ctor = pLoader || this.config.loader;
|
20575
20575
|
return class CmcdPlaylistLoader {
|
20576
20576
|
constructor(config) {
|
20577
|
-
this.loader =
|
20577
|
+
this.loader = undefined;
|
20578
20578
|
this.loader = new Ctor(config);
|
20579
20579
|
}
|
20580
20580
|
get stats() {
|
@@ -20607,7 +20607,7 @@ class CMCDController {
|
|
20607
20607
|
const Ctor = fLoader || this.config.loader;
|
20608
20608
|
return class CmcdFragmentLoader {
|
20609
20609
|
constructor(config) {
|
20610
|
-
this.loader =
|
20610
|
+
this.loader = undefined;
|
20611
20611
|
this.loader = new Ctor(config);
|
20612
20612
|
}
|
20613
20613
|
get stats() {
|
@@ -20634,7 +20634,7 @@ const PATHWAY_PENALTY_DURATION_MS = 300000;
|
|
20634
20634
|
class ContentSteeringController extends Logger {
|
20635
20635
|
constructor(hls) {
|
20636
20636
|
super('content-steering', hls.logger);
|
20637
|
-
this.hls =
|
20637
|
+
this.hls = undefined;
|
20638
20638
|
this.loader = null;
|
20639
20639
|
this.uri = null;
|
20640
20640
|
this.pathwayId = '.';
|
@@ -20753,7 +20753,7 @@ class ContentSteeringController extends Logger {
|
|
20753
20753
|
const {
|
20754
20754
|
errorAction
|
20755
20755
|
} = data;
|
20756
|
-
if ((errorAction == null ?
|
20756
|
+
if ((errorAction == null ? undefined : errorAction.action) === NetworkErrorAction.SendAlternateToPenaltyBox && errorAction.flags === ErrorActionFlags.MoveAllAlternatesMatchingHost) {
|
20757
20757
|
const levels = this.levels;
|
20758
20758
|
let pathwayPriority = this._pathwayPriority;
|
20759
20759
|
let errorPathway = this.pathwayId;
|
@@ -20951,7 +20951,7 @@ class ContentSteeringController extends Logger {
|
|
20951
20951
|
onSuccess: (response, stats, context, networkDetails) => {
|
20952
20952
|
this.log(`Loaded steering manifest: "${url}"`);
|
20953
20953
|
const steeringData = response.data;
|
20954
|
-
if ((steeringData == null ?
|
20954
|
+
if ((steeringData == null ? undefined : steeringData.VERSION) !== 1) {
|
20955
20955
|
this.log(`Steering VERSION ${steeringData.VERSION} not supported!`);
|
20956
20956
|
return;
|
20957
20957
|
}
|
@@ -20995,7 +20995,7 @@ class ContentSteeringController extends Logger {
|
|
20995
20995
|
let ttl = this.timeToLoad * 1000;
|
20996
20996
|
if (error.code === 429) {
|
20997
20997
|
const loader = this.loader;
|
20998
|
-
if (typeof (loader == null ?
|
20998
|
+
if (typeof (loader == null ? undefined : loader.getResponseHeader) === 'function') {
|
20999
20999
|
const retryAfter = loader.getResponseHeader('Retry-After');
|
21000
21000
|
if (retryAfter) {
|
21001
21001
|
ttl = parseFloat(retryAfter) * 1000;
|
@@ -21018,7 +21018,7 @@ class ContentSteeringController extends Logger {
|
|
21018
21018
|
this.clearTimeout();
|
21019
21019
|
this.reloadTimer = self.setTimeout(() => {
|
21020
21020
|
var _this$hls;
|
21021
|
-
const media = (_this$hls = this.hls) == null ?
|
21021
|
+
const media = (_this$hls = this.hls) == null ? undefined : _this$hls.media;
|
21022
21022
|
if (media && !media.ended) {
|
21023
21023
|
this.loadSteeringManifest(uri);
|
21024
21024
|
return;
|
@@ -21052,7 +21052,7 @@ function performUriReplacement(uri, stableId, perOptionKey, uriReplacement) {
|
|
21052
21052
|
} = uriReplacement;
|
21053
21053
|
let perVariantUri;
|
21054
21054
|
if (stableId) {
|
21055
|
-
perVariantUri = perOptionUris == null ?
|
21055
|
+
perVariantUri = perOptionUris == null ? undefined : perOptionUris[stableId];
|
21056
21056
|
if (perVariantUri) {
|
21057
21057
|
uri = perVariantUri;
|
21058
21058
|
}
|
@@ -21081,8 +21081,8 @@ function performUriReplacement(uri, stableId, perOptionKey, uriReplacement) {
|
|
21081
21081
|
class EMEController extends Logger {
|
21082
21082
|
constructor(hls) {
|
21083
21083
|
super('eme', hls.logger);
|
21084
|
-
this.hls =
|
21085
|
-
this.config =
|
21084
|
+
this.hls = undefined;
|
21085
|
+
this.config = undefined;
|
21086
21086
|
this.media = null;
|
21087
21087
|
this.keyFormatPromise = null;
|
21088
21088
|
this.keySystemAccessPromises = {};
|
@@ -21338,7 +21338,7 @@ class EMEController extends Logger {
|
|
21338
21338
|
// This can throw, but is caught in event handler callpath
|
21339
21339
|
const mediaKeySystemConfigs = getSupportedMediaKeySystemConfigurations(keySystem, audioCodecs, videoCodecs, this.config.drmSystemOptions);
|
21340
21340
|
const keySystemAccessPromises = this.keySystemAccessPromises[keySystem];
|
21341
|
-
let keySystemAccess = keySystemAccessPromises == null ?
|
21341
|
+
let keySystemAccess = keySystemAccessPromises == null ? undefined : keySystemAccessPromises.keySystemAccess;
|
21342
21342
|
if (!keySystemAccess) {
|
21343
21343
|
this.log(`Requesting encrypted media "${keySystem}" key-system access with config: ${JSON.stringify(mediaKeySystemConfigs)}`);
|
21344
21344
|
keySystemAccess = this.requestMediaKeySystemAccess(keySystem, mediaKeySystemConfigs);
|
@@ -21410,7 +21410,7 @@ class EMEController extends Logger {
|
|
21410
21410
|
updateKeySession(mediaKeySessionContext, data) {
|
21411
21411
|
var _mediaKeySessionConte;
|
21412
21412
|
const keySession = mediaKeySessionContext.mediaKeysSession;
|
21413
|
-
this.log(`Updating key-session "${keySession.sessionId}" for keyID ${Hex.hexDump(((_mediaKeySessionConte = mediaKeySessionContext.decryptdata) == null ?
|
21413
|
+
this.log(`Updating key-session "${keySession.sessionId}" for keyID ${Hex.hexDump(((_mediaKeySessionConte = mediaKeySessionContext.decryptdata) == null ? undefined : _mediaKeySessionConte.keyId) || [])}
|
21414
21414
|
} (data length: ${data ? data.byteLength : data})`);
|
21415
21415
|
return keySession.update(data);
|
21416
21416
|
}
|
@@ -21535,7 +21535,7 @@ class EMEController extends Logger {
|
|
21535
21535
|
}
|
21536
21536
|
generateRequestWithPreferredKeySession(context, initDataType, initData, reason) {
|
21537
21537
|
var _this$config$drmSyste, _this$config$drmSyste2;
|
21538
|
-
const generateRequestFilter = (_this$config$drmSyste = this.config.drmSystems) == null ?
|
21538
|
+
const generateRequestFilter = (_this$config$drmSyste = this.config.drmSystems) == null ? undefined : (_this$config$drmSyste2 = _this$config$drmSyste[context.keySystem]) == null ? undefined : _this$config$drmSyste2.generateRequest;
|
21539
21539
|
if (generateRequestFilter) {
|
21540
21540
|
try {
|
21541
21541
|
const mappedInitData = generateRequestFilter.call(this.hls, initDataType, initData, context);
|
@@ -21630,7 +21630,7 @@ class EMEController extends Logger {
|
|
21630
21630
|
});
|
21631
21631
|
return context.mediaKeysSession.generateRequest(initDataType, initData).then(() => {
|
21632
21632
|
var _context$mediaKeysSes;
|
21633
|
-
this.log(`Request generated for key-session "${(_context$mediaKeysSes = context.mediaKeysSession) == null ?
|
21633
|
+
this.log(`Request generated for key-session "${(_context$mediaKeysSes = context.mediaKeysSession) == null ? undefined : _context$mediaKeysSes.sessionId}" keyId: ${keyId}`);
|
21634
21634
|
}).catch(error => {
|
21635
21635
|
throw new EMEKeyError({
|
21636
21636
|
type: ErrorTypes.KEY_SYSTEM_ERROR,
|
@@ -21713,7 +21713,7 @@ class EMEController extends Logger {
|
|
21713
21713
|
setMediaKeysServerCertificate(mediaKeys, keySystem, cert) {
|
21714
21714
|
return new Promise((resolve, reject) => {
|
21715
21715
|
mediaKeys.setServerCertificate(cert).then(success => {
|
21716
|
-
this.log(`setServerCertificate ${success ? 'success' : 'not supported by CDM'} (${cert == null ?
|
21716
|
+
this.log(`setServerCertificate ${success ? 'success' : 'not supported by CDM'} (${cert == null ? undefined : cert.byteLength}) on "${keySystem}"`);
|
21717
21717
|
resolve(mediaKeys);
|
21718
21718
|
}).catch(error => {
|
21719
21719
|
reject(new EMEKeyError({
|
@@ -21760,15 +21760,15 @@ class EMEController extends Logger {
|
|
21760
21760
|
for (let i = 0, len = headers.length; i < len; i++) {
|
21761
21761
|
var _header$querySelector, _header$querySelector2;
|
21762
21762
|
header = headers[i];
|
21763
|
-
const name = (_header$querySelector = header.querySelector('name')) == null ?
|
21764
|
-
const value = (_header$querySelector2 = header.querySelector('value')) == null ?
|
21763
|
+
const name = (_header$querySelector = header.querySelector('name')) == null ? undefined : _header$querySelector.textContent;
|
21764
|
+
const value = (_header$querySelector2 = header.querySelector('value')) == null ? undefined : _header$querySelector2.textContent;
|
21765
21765
|
if (name && value) {
|
21766
21766
|
xhr.setRequestHeader(name, value);
|
21767
21767
|
}
|
21768
21768
|
}
|
21769
21769
|
}
|
21770
21770
|
const challengeElement = keyMessageXml.querySelector('Challenge');
|
21771
|
-
const challengeText = challengeElement == null ?
|
21771
|
+
const challengeText = challengeElement == null ? undefined : challengeElement.textContent;
|
21772
21772
|
if (!challengeText) {
|
21773
21773
|
throw new Error(`Cannot find <Challenge> in key message`);
|
21774
21774
|
}
|
@@ -21903,10 +21903,10 @@ class EMEController extends Logger {
|
|
21903
21903
|
|
21904
21904
|
// Close all sessions and remove media keys from the video element.
|
21905
21905
|
const keySessionCount = mediaKeysList.length;
|
21906
|
-
EMEController.CDMCleanupPromise = Promise.all(mediaKeysList.map(mediaKeySessionContext => this.removeSession(mediaKeySessionContext)).concat(media == null ?
|
21906
|
+
EMEController.CDMCleanupPromise = Promise.all(mediaKeysList.map(mediaKeySessionContext => this.removeSession(mediaKeySessionContext)).concat(media == null ? undefined : (_media$setMediaKeys = media.setMediaKeys(null)) == null ? undefined : _media$setMediaKeys.catch(error => {
|
21907
21907
|
var _this$hls2;
|
21908
21908
|
this.log(`Could not clear media keys: ${error}`);
|
21909
|
-
(_this$hls2 = this.hls) == null ?
|
21909
|
+
(_this$hls2 = this.hls) == null ? undefined : _this$hls2.trigger(Events.ERROR, {
|
21910
21910
|
type: ErrorTypes.OTHER_ERROR,
|
21911
21911
|
details: ErrorDetails.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,
|
21912
21912
|
fatal: false,
|
@@ -21920,7 +21920,7 @@ class EMEController extends Logger {
|
|
21920
21920
|
}).catch(error => {
|
21921
21921
|
var _this$hls3;
|
21922
21922
|
this.log(`Could not close sessions and clear media keys: ${error}`);
|
21923
|
-
(_this$hls3 = this.hls) == null ?
|
21923
|
+
(_this$hls3 = this.hls) == null ? undefined : _this$hls3.trigger(Events.ERROR, {
|
21924
21924
|
type: ErrorTypes.OTHER_ERROR,
|
21925
21925
|
details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
|
21926
21926
|
fatal: false,
|
@@ -21974,7 +21974,7 @@ class EMEController extends Logger {
|
|
21974
21974
|
return mediaKeysSession.remove().catch(error => {
|
21975
21975
|
var _this$hls4;
|
21976
21976
|
this.log(`Could not remove session: ${error}`);
|
21977
|
-
(_this$hls4 = this.hls) == null ?
|
21977
|
+
(_this$hls4 = this.hls) == null ? undefined : _this$hls4.trigger(Events.ERROR, {
|
21978
21978
|
type: ErrorTypes.OTHER_ERROR,
|
21979
21979
|
details: ErrorDetails.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,
|
21980
21980
|
fatal: false,
|
@@ -21985,7 +21985,7 @@ class EMEController extends Logger {
|
|
21985
21985
|
}).catch(error => {
|
21986
21986
|
var _this$hls5;
|
21987
21987
|
this.log(`Could not close session: ${error}`);
|
21988
|
-
(_this$hls5 = this.hls) == null ?
|
21988
|
+
(_this$hls5 = this.hls) == null ? undefined : _this$hls5.trigger(Events.ERROR, {
|
21989
21989
|
type: ErrorTypes.OTHER_ERROR,
|
21990
21990
|
details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
|
21991
21991
|
fatal: false,
|
@@ -21995,11 +21995,11 @@ class EMEController extends Logger {
|
|
21995
21995
|
}
|
21996
21996
|
}
|
21997
21997
|
}
|
21998
|
-
EMEController.CDMCleanupPromise =
|
21998
|
+
EMEController.CDMCleanupPromise = undefined;
|
21999
21999
|
class EMEKeyError extends Error {
|
22000
22000
|
constructor(data, message) {
|
22001
22001
|
super(message);
|
22002
|
-
this.data =
|
22002
|
+
this.data = undefined;
|
22003
22003
|
data.error || (data.error = new Error(message));
|
22004
22004
|
this.data = data;
|
22005
22005
|
data.err = data.error;
|
@@ -22008,15 +22008,15 @@ class EMEKeyError extends Error {
|
|
22008
22008
|
|
22009
22009
|
class FPSController {
|
22010
22010
|
constructor(hls) {
|
22011
|
-
this.hls =
|
22011
|
+
this.hls = undefined;
|
22012
22012
|
this.isVideoPlaybackQualityAvailable = false;
|
22013
|
-
this.timer =
|
22013
|
+
this.timer = undefined;
|
22014
22014
|
this.media = null;
|
22015
|
-
this.lastTime =
|
22015
|
+
this.lastTime = undefined;
|
22016
22016
|
this.lastDroppedFrames = 0;
|
22017
22017
|
this.lastDecodedFrames = 0;
|
22018
22018
|
// stream controller must be provided as a dependency!
|
22019
|
-
this.streamController =
|
22019
|
+
this.streamController = undefined;
|
22020
22020
|
this.hls = hls;
|
22021
22021
|
this.registerListeners();
|
22022
22022
|
}
|
@@ -22395,7 +22395,7 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22395
22395
|
} = data;
|
22396
22396
|
const trackInActiveGroup = this.tracksInGroup[id];
|
22397
22397
|
if (!trackInActiveGroup || trackInActiveGroup.groupId !== groupId) {
|
22398
|
-
this.warn(`Subtitle track with id:${id} and group:${groupId} not found in active group ${trackInActiveGroup == null ?
|
22398
|
+
this.warn(`Subtitle track with id:${id} and group:${groupId} not found in active group ${trackInActiveGroup == null ? undefined : trackInActiveGroup.groupId}`);
|
22399
22399
|
return;
|
22400
22400
|
}
|
22401
22401
|
const curDetails = trackInActiveGroup.details;
|
@@ -22419,7 +22419,7 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22419
22419
|
const subtitleGroups = levelInfo.subtitleGroups || null;
|
22420
22420
|
const currentGroups = this.groupIds;
|
22421
22421
|
let currentTrack = this.currentTrack;
|
22422
|
-
if (!subtitleGroups || (currentGroups == null ?
|
22422
|
+
if (!subtitleGroups || (currentGroups == null ? undefined : currentGroups.length) !== (subtitleGroups == null ? undefined : subtitleGroups.length) || subtitleGroups != null && subtitleGroups.some(groupId => (currentGroups == null ? undefined : currentGroups.indexOf(groupId)) === -1)) {
|
22423
22423
|
this.groupIds = subtitleGroups;
|
22424
22424
|
this.trackId = -1;
|
22425
22425
|
this.currentTrack = null;
|
@@ -22462,7 +22462,7 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22462
22462
|
const subtitleTracksUpdated = {
|
22463
22463
|
subtitleTracks
|
22464
22464
|
};
|
22465
|
-
this.log(`Updating subtitle tracks, ${subtitleTracks.length} track(s) found in "${subtitleGroups == null ?
|
22465
|
+
this.log(`Updating subtitle tracks, ${subtitleTracks.length} track(s) found in "${subtitleGroups == null ? undefined : subtitleGroups.join(',')}" group-id`);
|
22466
22466
|
this.hls.trigger(Events.SUBTITLE_TRACKS_UPDATED, subtitleTracksUpdated);
|
22467
22467
|
if (trackId !== -1 && this.trackId === -1) {
|
22468
22468
|
this.setSubtitleTrack(trackId);
|
@@ -22582,8 +22582,8 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22582
22582
|
const groupId = currentTrack.groupId;
|
22583
22583
|
const url = this.getUrlWithDirectives(currentTrack.url, hlsUrlParameters);
|
22584
22584
|
const details = currentTrack.details;
|
22585
|
-
const age = details == null ?
|
22586
|
-
this.log(`Loading subtitle ${id} "${currentTrack.name}" lang:${currentTrack.lang} group:${groupId}${(hlsUrlParameters == null ?
|
22585
|
+
const age = details == null ? undefined : details.age;
|
22586
|
+
this.log(`Loading subtitle ${id} "${currentTrack.name}" lang:${currentTrack.lang} group:${groupId}${(hlsUrlParameters == null ? undefined : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
|
22587
22587
|
this.hls.trigger(Events.SUBTITLE_TRACK_LOADING, {
|
22588
22588
|
url,
|
22589
22589
|
id,
|
@@ -22680,7 +22680,7 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22680
22680
|
type,
|
22681
22681
|
url
|
22682
22682
|
});
|
22683
|
-
const hlsUrlParameters = this.switchParams(track.url, lastTrack == null ?
|
22683
|
+
const hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? undefined : lastTrack.details, track.details);
|
22684
22684
|
this.loadPlaylist(hlsUrlParameters);
|
22685
22685
|
}
|
22686
22686
|
}
|
@@ -22706,12 +22706,12 @@ function generateAssetIdentifier(interstitial, uri, assetListIndex) {
|
|
22706
22706
|
}
|
22707
22707
|
class InterstitialEvent {
|
22708
22708
|
constructor(dateRange, base) {
|
22709
|
-
this.base =
|
22709
|
+
this.base = undefined;
|
22710
22710
|
this._duration = null;
|
22711
22711
|
this._timelineStart = null;
|
22712
|
-
this.appendInPlaceDisabled =
|
22713
|
-
this.appendInPlaceStarted =
|
22714
|
-
this.dateRange =
|
22712
|
+
this.appendInPlaceDisabled = undefined;
|
22713
|
+
this.appendInPlaceStarted = undefined;
|
22714
|
+
this.dateRange = undefined;
|
22715
22715
|
this.hasPlayed = false;
|
22716
22716
|
this.cumulativeDuration = 0;
|
22717
22717
|
this.resumeOffset = NaN;
|
@@ -22725,10 +22725,10 @@ class InterstitialEvent {
|
|
22725
22725
|
in: false
|
22726
22726
|
};
|
22727
22727
|
this.assetList = [];
|
22728
|
-
this.assetListLoader =
|
22728
|
+
this.assetListLoader = undefined;
|
22729
22729
|
this.assetListResponse = null;
|
22730
|
-
this.resumeAnchor =
|
22731
|
-
this.error =
|
22730
|
+
this.resumeAnchor = undefined;
|
22731
|
+
this.error = undefined;
|
22732
22732
|
this.base = base;
|
22733
22733
|
this.dateRange = dateRange;
|
22734
22734
|
this.setDateRange(dateRange);
|
@@ -22742,7 +22742,7 @@ class InterstitialEvent {
|
|
22742
22742
|
}
|
22743
22743
|
reset() {
|
22744
22744
|
var _this$assetListLoader;
|
22745
|
-
(_this$assetListLoader = this.assetListLoader) == null ?
|
22745
|
+
(_this$assetListLoader = this.assetListLoader) == null ? undefined : _this$assetListLoader.destroy();
|
22746
22746
|
this.assetListLoader = this.error = undefined;
|
22747
22747
|
}
|
22748
22748
|
isAssetPastPlayoutLimit(assetIndex) {
|
@@ -22891,9 +22891,9 @@ function eventAssetToString(asset) {
|
|
22891
22891
|
|
22892
22892
|
class HlsAssetPlayer {
|
22893
22893
|
constructor(HlsPlayerClass, userConfig, _interstitial, assetItem) {
|
22894
|
-
this.hls =
|
22895
|
-
this.interstitial =
|
22896
|
-
this.assetItem =
|
22894
|
+
this.hls = undefined;
|
22895
|
+
this.interstitial = undefined;
|
22896
|
+
this.assetItem = undefined;
|
22897
22897
|
this.tracks = null;
|
22898
22898
|
this.hasDetails = false;
|
22899
22899
|
this.mediaAttached = null;
|
@@ -22930,7 +22930,7 @@ class HlsAssetPlayer {
|
|
22930
22930
|
const event = this.interstitial;
|
22931
22931
|
if (event.playoutLimit) {
|
22932
22932
|
var _event$assetList$even;
|
22933
|
-
this.playoutOffset = ((_event$assetList$even = event.assetList[event.assetList.indexOf(assetItem)]) == null ?
|
22933
|
+
this.playoutOffset = ((_event$assetList$even = event.assetList[event.assetList.indexOf(assetItem)]) == null ? undefined : _event$assetList$even.startOffset) || 0;
|
22934
22934
|
media.addEventListener('timeupdate', this.checkPlayout);
|
22935
22935
|
}
|
22936
22936
|
});
|
@@ -22965,7 +22965,7 @@ class HlsAssetPlayer {
|
|
22965
22965
|
}
|
22966
22966
|
get duration() {
|
22967
22967
|
var _this$assetItem;
|
22968
|
-
const duration = (_this$assetItem = this.assetItem) == null ?
|
22968
|
+
const duration = (_this$assetItem = this.assetItem) == null ? undefined : _this$assetItem.duration;
|
22969
22969
|
if (!duration) {
|
22970
22970
|
return 0;
|
22971
22971
|
}
|
@@ -23046,7 +23046,7 @@ const ABUTTING_THRESHOLD_SECONDS = 0.033;
|
|
23046
23046
|
class InterstitialsSchedule extends Logger {
|
23047
23047
|
constructor(onScheduleUpdate, logger) {
|
23048
23048
|
super('interstitials-sched', logger);
|
23049
|
-
this.onScheduleUpdate =
|
23049
|
+
this.onScheduleUpdate = undefined;
|
23050
23050
|
this.eventMap = {};
|
23051
23051
|
this.events = null;
|
23052
23052
|
this.items = null;
|
@@ -23146,7 +23146,7 @@ class InterstitialsSchedule extends Logger {
|
|
23146
23146
|
if (items) {
|
23147
23147
|
for (let i = items.length; i--;) {
|
23148
23148
|
var _items$i$event;
|
23149
|
-
if (((_items$i$event = items[i].event) == null ?
|
23149
|
+
if (((_items$i$event = items[i].event) == null ? undefined : _items$i$event.identifier) === identifier) {
|
23150
23150
|
return i;
|
23151
23151
|
}
|
23152
23152
|
}
|
@@ -23171,7 +23171,7 @@ class InterstitialsSchedule extends Logger {
|
|
23171
23171
|
}
|
23172
23172
|
get assetIdAtEnd() {
|
23173
23173
|
var _this$items, _this$items2;
|
23174
|
-
const interstitialAtEnd = (_this$items = this.items) == null ?
|
23174
|
+
const interstitialAtEnd = (_this$items = this.items) == null ? undefined : (_this$items2 = _this$items[this.length - 1]) == null ? undefined : _this$items2.event;
|
23175
23175
|
if (interstitialAtEnd) {
|
23176
23176
|
const assetList = interstitialAtEnd.assetList;
|
23177
23177
|
const assetAtEnd = assetList[assetList.length - 1];
|
@@ -23235,7 +23235,7 @@ class InterstitialsSchedule extends Logger {
|
|
23235
23235
|
if (events.length || removedInterstitials.length || this.length < 2) {
|
23236
23236
|
const currentItems = this.items;
|
23237
23237
|
const updatedItems = this.parseSchedule(events, mediaSelection);
|
23238
|
-
const updated = removedInterstitials.length || (currentItems == null ?
|
23238
|
+
const updated = removedInterstitials.length || (currentItems == null ? undefined : currentItems.length) !== updatedItems.length || updatedItems.some((item, i) => {
|
23239
23239
|
return Math.abs(item.playout.start - currentItems[i].playout.start) > 0.005 || Math.abs(item.playout.end - currentItems[i].playout.end) > 0.005;
|
23240
23240
|
});
|
23241
23241
|
if (updated) {
|
@@ -23290,7 +23290,7 @@ class InterstitialsSchedule extends Logger {
|
|
23290
23290
|
const interstitialDuration = interstitial.duration;
|
23291
23291
|
const timelineDuration = interstitial.timelineOccupancy === TimelineOccupancy.Range ? interstitialDuration : 0;
|
23292
23292
|
const resumptionOffset = interstitial.resumptionOffset;
|
23293
|
-
const inSameStartTimeSequence = (previousEvent == null ?
|
23293
|
+
const inSameStartTimeSequence = (previousEvent == null ? undefined : previousEvent.startTime) === eventStart;
|
23294
23294
|
const start = eventStart + interstitial.cumulativeDuration;
|
23295
23295
|
let end = appendInPlace ? start + interstitialDuration : eventStart + resumptionOffset;
|
23296
23296
|
if (preroll || !postroll && eventStart <= 0) {
|
@@ -23388,7 +23388,7 @@ class InterstitialsSchedule extends Logger {
|
|
23388
23388
|
const playoutStart = playoutDuration;
|
23389
23389
|
playoutDuration += segmentDuration;
|
23390
23390
|
schedule.push({
|
23391
|
-
previousEvent: ((_schedule = schedule[schedule.length - 1]) == null ?
|
23391
|
+
previousEvent: ((_schedule = schedule[schedule.length - 1]) == null ? undefined : _schedule.event) || null,
|
23392
23392
|
nextEvent: null,
|
23393
23393
|
start: primaryPosition,
|
23394
23394
|
end: timelineStart + segmentDuration,
|
@@ -23541,7 +23541,7 @@ function segmentToString(segment) {
|
|
23541
23541
|
|
23542
23542
|
class AssetListLoader {
|
23543
23543
|
constructor(hls) {
|
23544
|
-
this.hls =
|
23544
|
+
this.hls = undefined;
|
23545
23545
|
this.hls = hls;
|
23546
23546
|
}
|
23547
23547
|
destroy() {
|
@@ -23582,7 +23582,7 @@ class AssetListLoader {
|
|
23582
23582
|
const callbacks = {
|
23583
23583
|
onSuccess: (response, stats, context, networkDetails) => {
|
23584
23584
|
const assetListResponse = response.data;
|
23585
|
-
const assets = assetListResponse == null ?
|
23585
|
+
const assets = assetListResponse == null ? undefined : assetListResponse.ASSETS;
|
23586
23586
|
if (!Array.isArray(assets)) {
|
23587
23587
|
const errorData = this.assignAssetListError(interstitial, ErrorDetails.ASSET_LIST_PARSING_ERROR, new Error(`Invalid interstitial asset list`), context.url, stats, networkDetails);
|
23588
23588
|
this.hls.trigger(Events.ERROR, errorData);
|
@@ -23626,16 +23626,16 @@ class AssetListLoader {
|
|
23626
23626
|
}
|
23627
23627
|
|
23628
23628
|
function playWithCatch(media) {
|
23629
|
-
media == null ?
|
23629
|
+
media == null ? undefined : media.play().catch(() => {
|
23630
23630
|
/* no-op */
|
23631
23631
|
});
|
23632
23632
|
}
|
23633
23633
|
class InterstitialsController extends Logger {
|
23634
23634
|
constructor(hls, HlsPlayerClass) {
|
23635
23635
|
super('interstitials', hls.logger);
|
23636
|
-
this.HlsPlayerClass =
|
23637
|
-
this.hls =
|
23638
|
-
this.assetListLoader =
|
23636
|
+
this.HlsPlayerClass = undefined;
|
23637
|
+
this.hls = undefined;
|
23638
|
+
this.assetListLoader = undefined;
|
23639
23639
|
// Last updated LevelDetails
|
23640
23640
|
this.mediaSelection = null;
|
23641
23641
|
this.altSelection = null;
|
@@ -23651,7 +23651,7 @@ class InterstitialsController extends Logger {
|
|
23651
23651
|
this.bufferedPos = -1;
|
23652
23652
|
this.timelinePos = -1;
|
23653
23653
|
// Schedule
|
23654
|
-
this.schedule =
|
23654
|
+
this.schedule = undefined;
|
23655
23655
|
// Schedule playback and buffering state
|
23656
23656
|
this.playingItem = null;
|
23657
23657
|
this.bufferingItem = null;
|
@@ -24002,7 +24002,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24002
24002
|
if (interstitial) {
|
24003
24003
|
if (timelineType === 'playout' || interstitial.timelineOccupancy !== TimelineOccupancy.Point) {
|
24004
24004
|
const assetPlayer = getAssetPlayer(asset);
|
24005
|
-
if ((assetPlayer == null ?
|
24005
|
+
if ((assetPlayer == null ? undefined : assetPlayer.interstitial) === interstitial) {
|
24006
24006
|
time += assetPlayer.assetItem.startOffset + assetPlayer[assetPlayerField];
|
24007
24007
|
}
|
24008
24008
|
}
|
@@ -24018,7 +24018,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24018
24018
|
if (primaryTime !== 0 && timelineType !== 'primary' && c.schedule.length) {
|
24019
24019
|
var _c$schedule$items;
|
24020
24020
|
const index = c.schedule.findItemIndexAtTime(primaryTime);
|
24021
|
-
const item = (_c$schedule$items = c.schedule.items) == null ?
|
24021
|
+
const item = (_c$schedule$items = c.schedule.items) == null ? undefined : _c$schedule$items[index];
|
24022
24022
|
if (item) {
|
24023
24023
|
const diff = item[timelineType].start - item.start;
|
24024
24024
|
return primaryTime + diff;
|
@@ -24050,14 +24050,14 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24050
24050
|
c.log(`seek to ${time} "${timelineType}"`);
|
24051
24051
|
const playingItem = effectivePlayingItem();
|
24052
24052
|
const targetIndex = c.schedule.findItemIndexAtTime(time, timelineType);
|
24053
|
-
const targetItem = (_c$schedule$items2 = c.schedule.items) == null ?
|
24054
|
-
const playingInterstitial = playingItem == null ?
|
24055
|
-
const appendInPlace = playingInterstitial == null ?
|
24053
|
+
const targetItem = (_c$schedule$items2 = c.schedule.items) == null ? undefined : _c$schedule$items2[targetIndex];
|
24054
|
+
const playingInterstitial = playingItem == null ? undefined : playingItem.event;
|
24055
|
+
const appendInPlace = playingInterstitial == null ? undefined : playingInterstitial.appendInPlace;
|
24056
24056
|
const seekInItem = playingItem && c.itemsMatch(playingItem, targetItem);
|
24057
24057
|
if (playingItem && (appendInPlace || seekInItem)) {
|
24058
24058
|
// seek in asset player or primary media (appendInPlace)
|
24059
24059
|
const assetPlayer = getAssetPlayer(c.playingAsset);
|
24060
|
-
const media = (assetPlayer == null ?
|
24060
|
+
const media = (assetPlayer == null ? undefined : assetPlayer.media) || c.hls.media;
|
24061
24061
|
if (media) {
|
24062
24062
|
const currentTime = timelineType === 'primary' ? media.currentTime : getMappedTime(playingItem, timelineType, c.playingAsset, 'timelinePos', 'currentTime');
|
24063
24063
|
const diff = time - currentTime;
|
@@ -24097,7 +24097,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24097
24097
|
c.timelinePos = seekToTime;
|
24098
24098
|
} else {
|
24099
24099
|
var _targetItem$event;
|
24100
|
-
const assetList = targetItem == null ?
|
24100
|
+
const assetList = targetItem == null ? undefined : (_targetItem$event = targetItem.event) == null ? undefined : _targetItem$event.assetList;
|
24101
24101
|
if (assetList) {
|
24102
24102
|
const eventTime = time - (targetItem[timelineType] || targetItem).start;
|
24103
24103
|
for (let i = assetList.length; i--;) {
|
@@ -24116,11 +24116,11 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24116
24116
|
this.manager = {
|
24117
24117
|
get events() {
|
24118
24118
|
var _c$schedule, _c$schedule$events;
|
24119
|
-
return ((_c$schedule = c.schedule) == null ?
|
24119
|
+
return ((_c$schedule = c.schedule) == null ? undefined : (_c$schedule$events = _c$schedule.events) == null ? undefined : _c$schedule$events.slice(0)) || [];
|
24120
24120
|
},
|
24121
24121
|
get schedule() {
|
24122
24122
|
var _c$schedule2, _c$schedule2$items;
|
24123
|
-
return ((_c$schedule2 = c.schedule) == null ?
|
24123
|
+
return ((_c$schedule2 = c.schedule) == null ? undefined : (_c$schedule2$items = _c$schedule2.items) == null ? undefined : _c$schedule2$items.slice(0)) || [];
|
24124
24124
|
},
|
24125
24125
|
get playerQueue() {
|
24126
24126
|
return c.playerQueue.slice(0);
|
@@ -24164,7 +24164,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24164
24164
|
},
|
24165
24165
|
get seekableStart() {
|
24166
24166
|
var _c$primaryDetails2;
|
24167
|
-
return ((_c$primaryDetails2 = c.primaryDetails) == null ?
|
24167
|
+
return ((_c$primaryDetails2 = c.primaryDetails) == null ? undefined : _c$primaryDetails2.fragmentStart) || 0;
|
24168
24168
|
},
|
24169
24169
|
seekTo: time => seekTo(time, 'primary')
|
24170
24170
|
},
|
@@ -24180,7 +24180,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24180
24180
|
},
|
24181
24181
|
get seekableStart() {
|
24182
24182
|
var _c$primaryDetails3;
|
24183
|
-
return findMappedTime(((_c$primaryDetails3 = c.primaryDetails) == null ?
|
24183
|
+
return findMappedTime(((_c$primaryDetails3 = c.primaryDetails) == null ? undefined : _c$primaryDetails3.fragmentStart) || 0, 'playout');
|
24184
24184
|
},
|
24185
24185
|
seekTo: time => seekTo(time, 'playout')
|
24186
24186
|
},
|
@@ -24196,13 +24196,13 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24196
24196
|
},
|
24197
24197
|
get seekableStart() {
|
24198
24198
|
var _c$primaryDetails4;
|
24199
|
-
return findMappedTime(((_c$primaryDetails4 = c.primaryDetails) == null ?
|
24199
|
+
return findMappedTime(((_c$primaryDetails4 = c.primaryDetails) == null ? undefined : _c$primaryDetails4.fragmentStart) || 0, 'integrated');
|
24200
24200
|
},
|
24201
24201
|
seekTo: time => seekTo(time, 'integrated')
|
24202
24202
|
},
|
24203
24203
|
skip: () => {
|
24204
24204
|
const item = effectivePlayingItem();
|
24205
|
-
const event = item == null ?
|
24205
|
+
const event = item == null ? undefined : item.event;
|
24206
24206
|
if (event && !event.restrictions.skip) {
|
24207
24207
|
const index = c.findItemIndex(item);
|
24208
24208
|
if (event.appendInPlace) {
|
@@ -24225,7 +24225,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24225
24225
|
if (!this.playbackStarted || !playingItem) {
|
24226
24226
|
return false;
|
24227
24227
|
}
|
24228
|
-
const items = (_this$schedule = this.schedule) == null ?
|
24228
|
+
const items = (_this$schedule = this.schedule) == null ? undefined : _this$schedule.items;
|
24229
24229
|
return this.itemsMatch(playingItem, items ? items[items.length - 1] : null);
|
24230
24230
|
}
|
24231
24231
|
get playbackStarted() {
|
@@ -24249,7 +24249,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24249
24249
|
// Observe detached media currentTime when appending in place
|
24250
24250
|
media = this.primaryMedia;
|
24251
24251
|
}
|
24252
|
-
const currentTime = (_media = media) == null ?
|
24252
|
+
const currentTime = (_media = media) == null ? undefined : _media.currentTime;
|
24253
24253
|
if (currentTime === undefined || !isFiniteNumber(currentTime)) {
|
24254
24254
|
return undefined;
|
24255
24255
|
}
|
@@ -24257,7 +24257,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24257
24257
|
}
|
24258
24258
|
get primaryMedia() {
|
24259
24259
|
var _this$detachedData;
|
24260
|
-
return this.media || ((_this$detachedData = this.detachedData) == null ?
|
24260
|
+
return this.media || ((_this$detachedData = this.detachedData) == null ? undefined : _this$detachedData.media) || null;
|
24261
24261
|
}
|
24262
24262
|
isInterstitial(item) {
|
24263
24263
|
return !!(item != null && item.event);
|
@@ -24296,7 +24296,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
24296
24296
|
const primaryPlayer = this.hls;
|
24297
24297
|
const isAssetPlayer = player !== primaryPlayer;
|
24298
24298
|
const appendInPlace = isAssetPlayer && player.interstitial.appendInPlace;
|
24299
|
-
const detachedMediaSource = (_this$detachedData2 = this.detachedData) == null ?
|
24299
|
+
const detachedMediaSource = (_this$detachedData2 = this.detachedData) == null ? undefined : _this$detachedData2.mediaSource;
|
24300
24300
|
let logFromSource;
|
24301
24301
|
if (primaryPlayer.media && appendInPlace) {
|
24302
24302
|
attachMediaSourceData = primaryPlayer.transferMedia();
|
@@ -24325,7 +24325,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
24325
24325
|
};
|
24326
24326
|
}
|
24327
24327
|
}
|
24328
|
-
const transferring = attachMediaSourceData && 'mediaSource' in attachMediaSourceData && ((_attachMediaSourceDat = attachMediaSourceData.mediaSource) == null ?
|
24328
|
+
const transferring = attachMediaSourceData && 'mediaSource' in attachMediaSourceData && ((_attachMediaSourceDat = attachMediaSourceData.mediaSource) == null ? undefined : _attachMediaSourceDat.readyState) !== 'closed';
|
24329
24329
|
const dataToAttach = transferring && attachMediaSourceData ? attachMediaSourceData : media;
|
24330
24330
|
this.log(`${transferring ? 'transfering MediaSource' : 'attaching media'} to ${isAssetPlayer ? player : 'Primary'}`);
|
24331
24331
|
if (dataToAttach === attachMediaSourceData) {
|
@@ -24416,9 +24416,9 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
24416
24416
|
var _interstitial$assetLi;
|
24417
24417
|
const interstitial = currentItem.event;
|
24418
24418
|
const playingAsset = this.playingAsset;
|
24419
|
-
const assetId = playingAsset == null ?
|
24419
|
+
const assetId = playingAsset == null ? undefined : playingAsset.identifier;
|
24420
24420
|
const player = assetId ? this.getAssetPlayer(assetId) : null;
|
24421
|
-
if (player && assetId && (!this.eventItemsMatch(currentItem, scheduledItem) || assetListIndex !== undefined && assetId !== ((_interstitial$assetLi = interstitial.assetList) == null ?
|
24421
|
+
if (player && assetId && (!this.eventItemsMatch(currentItem, scheduledItem) || assetListIndex !== undefined && assetId !== ((_interstitial$assetLi = interstitial.assetList) == null ? undefined : _interstitial$assetLi[assetListIndex].identifier))) {
|
24422
24422
|
this.playingAsset = null;
|
24423
24423
|
const _assetListIndex = interstitial.findAssetIndex(playingAsset);
|
24424
24424
|
this.log(`INTERSTITIAL_ASSET_ENDED ${_assetListIndex + 1}/${interstitial.assetList.length} ${eventAssetToString(playingAsset)}`);
|
@@ -24567,7 +24567,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
24567
24567
|
}
|
24568
24568
|
get primaryDetails() {
|
24569
24569
|
var _this$mediaSelection, _this$mediaSelection$;
|
24570
|
-
return (_this$mediaSelection = this.mediaSelection) == null ?
|
24570
|
+
return (_this$mediaSelection = this.mediaSelection) == null ? undefined : (_this$mediaSelection$ = _this$mediaSelection.main) == null ? undefined : _this$mediaSelection$.details;
|
24571
24571
|
}
|
24572
24572
|
get primaryLive() {
|
24573
24573
|
var _this$primaryDetails;
|
@@ -24746,7 +24746,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
24746
24746
|
if (interstitial.cue.post) {
|
24747
24747
|
var _this$schedule$items;
|
24748
24748
|
const scheduleIndex = this.schedule.findEventIndex(interstitial.identifier);
|
24749
|
-
const item = (_this$schedule$items = this.schedule.items) == null ?
|
24749
|
+
const item = (_this$schedule$items = this.schedule.items) == null ? undefined : _this$schedule$items[scheduleIndex];
|
24750
24750
|
if (this.isInterstitial(item) && this.eventItemsMatch(item, this.bufferingItem)) {
|
24751
24751
|
this.bufferedToItem(item, 0);
|
24752
24752
|
}
|
@@ -24774,11 +24774,11 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
24774
24774
|
}
|
24775
24775
|
itemsMatch(a, b) {
|
24776
24776
|
var _a$nextEvent, _b$nextEvent;
|
24777
|
-
return !!b && (a === b || a.event && b.event && this.eventItemsMatch(a, b) || !a.event && !b.event && ((_a$nextEvent = a.nextEvent) == null ?
|
24777
|
+
return !!b && (a === b || a.event && b.event && this.eventItemsMatch(a, b) || !a.event && !b.event && ((_a$nextEvent = a.nextEvent) == null ? undefined : _a$nextEvent.identifier) === ((_b$nextEvent = b.nextEvent) == null ? undefined : _b$nextEvent.identifier));
|
24778
24778
|
}
|
24779
24779
|
eventItemsMatch(a, b) {
|
24780
24780
|
var _b$event;
|
24781
|
-
return !!b && (a === b || a.event.identifier === ((_b$event = b.event) == null ?
|
24781
|
+
return !!b && (a === b || a.event.identifier === ((_b$event = b.event) == null ? undefined : _b$event.identifier));
|
24782
24782
|
}
|
24783
24783
|
findItemIndex(item, time) {
|
24784
24784
|
return item ? this.schedule.findItemIndex(item, time) : -1;
|
@@ -24822,7 +24822,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
24822
24822
|
if (bufferEndIndex === -1 && bufferingItem && bufferEnd >= bufferingItem.end) {
|
24823
24823
|
bufferEndIndex = nextToBufferIndex;
|
24824
24824
|
}
|
24825
|
-
if (nextToBufferIndex - playingIndex > 1 && (bufferingItem == null ?
|
24825
|
+
if (nextToBufferIndex - playingIndex > 1 && (bufferingItem == null ? undefined : (_bufferingItem$event = bufferingItem.event) == null ? undefined : _bufferingItem$event.appendInPlace) === false) {
|
24826
24826
|
// do not advance buffering item past Interstitial that requires source reset
|
24827
24827
|
return;
|
24828
24828
|
}
|
@@ -25128,13 +25128,13 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
25128
25128
|
const scheduleIndex = this.schedule.findEventIndex(interstitial.identifier);
|
25129
25129
|
const assetListIndex = interstitial.findAssetIndex(assetItem);
|
25130
25130
|
const nextAssetIndex = assetListIndex + 1;
|
25131
|
-
const item = (_this$schedule$items2 = this.schedule.items) == null ?
|
25131
|
+
const item = (_this$schedule$items2 = this.schedule.items) == null ? undefined : _this$schedule$items2[scheduleIndex];
|
25132
25132
|
if (this.isInterstitial(item)) {
|
25133
25133
|
if (assetListIndex !== -1 && !interstitial.isAssetPastPlayoutLimit(nextAssetIndex) && !interstitial.assetList[nextAssetIndex].error) {
|
25134
25134
|
this.bufferedToItem(item, assetListIndex + 1);
|
25135
25135
|
} else {
|
25136
25136
|
var _this$schedule$items3;
|
25137
|
-
const nextItem = (_this$schedule$items3 = this.schedule.items) == null ?
|
25137
|
+
const nextItem = (_this$schedule$items3 = this.schedule.items) == null ? undefined : _this$schedule$items3[scheduleIndex + 1];
|
25138
25138
|
if (nextItem) {
|
25139
25139
|
this.bufferedToItem(nextItem);
|
25140
25140
|
}
|
@@ -25246,7 +25246,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
25246
25246
|
assetId
|
25247
25247
|
} = player;
|
25248
25248
|
const scheduleIndex = this.schedule.findEventIndex(interstitial.identifier);
|
25249
|
-
const item = (_this$schedule$items4 = this.schedule.items) == null ?
|
25249
|
+
const item = (_this$schedule$items4 = this.schedule.items) == null ? undefined : _this$schedule$items4[scheduleIndex];
|
25250
25250
|
if (!item) {
|
25251
25251
|
return;
|
25252
25252
|
}
|
@@ -25256,7 +25256,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
25256
25256
|
if (bufferingPlayer === player) {
|
25257
25257
|
return;
|
25258
25258
|
}
|
25259
|
-
const activeTracks = (bufferingPlayer == null ?
|
25259
|
+
const activeTracks = (bufferingPlayer == null ? undefined : bufferingPlayer.tracks) || ((_this$detachedData4 = this.detachedData) == null ? undefined : _this$detachedData4.tracks) || this.requiredTracks;
|
25260
25260
|
if (interstitial.appendInPlace && assetItem !== this.playingAsset) {
|
25261
25261
|
// Do not buffer another item if tracks are unknown or incompatible
|
25262
25262
|
if (!player.tracks) {
|
@@ -25366,23 +25366,23 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
25366
25366
|
});
|
25367
25367
|
interstitial.duration = sumDuration;
|
25368
25368
|
const waitingItem = this.waitingItem;
|
25369
|
-
const waitingForItem = (waitingItem == null ?
|
25369
|
+
const waitingForItem = (waitingItem == null ? undefined : waitingItem.event.identifier) === interstitialId;
|
25370
25370
|
|
25371
25371
|
// Update schedule now that asset.DURATION(s) are parsed
|
25372
25372
|
this.updateSchedule();
|
25373
|
-
const bufferingEvent = (_this$bufferingItem2 = this.bufferingItem) == null ?
|
25373
|
+
const bufferingEvent = (_this$bufferingItem2 = this.bufferingItem) == null ? undefined : _this$bufferingItem2.event;
|
25374
25374
|
|
25375
25375
|
// If buffer reached Interstitial, start buffering first asset
|
25376
25376
|
if (waitingForItem) {
|
25377
25377
|
var _this$schedule$items5;
|
25378
25378
|
// Advance schedule when waiting for asset list data to play
|
25379
25379
|
const scheduleIndex = this.schedule.findEventIndex(interstitialId);
|
25380
|
-
const item = (_this$schedule$items5 = this.schedule.items) == null ?
|
25380
|
+
const item = (_this$schedule$items5 = this.schedule.items) == null ? undefined : _this$schedule$items5[scheduleIndex];
|
25381
25381
|
if (item) {
|
25382
25382
|
this.setBufferingItem(item);
|
25383
25383
|
}
|
25384
25384
|
this.setSchedulePosition(scheduleIndex);
|
25385
|
-
} else if ((bufferingEvent == null ?
|
25385
|
+
} else if ((bufferingEvent == null ? undefined : bufferingEvent.identifier) === interstitialId && bufferingEvent.appendInPlace) {
|
25386
25386
|
// If buffering (but not playback) has reached this item transfer media-source
|
25387
25387
|
const assetItem = interstitial.assetList[0];
|
25388
25388
|
const player = this.getAssetPlayer(assetItem.identifier);
|
@@ -25538,7 +25538,7 @@ class SubtitleStreamController extends BaseStreamController {
|
|
25538
25538
|
// If something goes wrong, proceed to next frag, if we were processing one.
|
25539
25539
|
onError(event, data) {
|
25540
25540
|
const frag = data.frag;
|
25541
|
-
if ((frag == null ?
|
25541
|
+
if ((frag == null ? undefined : frag.type) === PlaylistLevelType.SUBTITLE) {
|
25542
25542
|
if (data.details === ErrorDetails.FRAG_GAP) {
|
25543
25543
|
this.fragmentTracker.fragBuffered(frag, true);
|
25544
25544
|
}
|
@@ -25628,7 +25628,7 @@ class SubtitleStreamController extends BaseStreamController {
|
|
25628
25628
|
}
|
25629
25629
|
} else {
|
25630
25630
|
var _this$levelLastLoaded;
|
25631
|
-
sliding = this.alignPlaylists(newDetails, track.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ?
|
25631
|
+
sliding = this.alignPlaylists(newDetails, track.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
|
25632
25632
|
if (sliding === 0 && mainSlidingStartFragment) {
|
25633
25633
|
// realign with main when there is no overlap with last refresh
|
25634
25634
|
sliding = mainSlidingStartFragment.start;
|
@@ -25709,7 +25709,7 @@ class SubtitleStreamController extends BaseStreamController {
|
|
25709
25709
|
currentTrackId,
|
25710
25710
|
levels
|
25711
25711
|
} = this;
|
25712
|
-
const track = levels == null ?
|
25712
|
+
const track = levels == null ? undefined : levels[currentTrackId];
|
25713
25713
|
if (!track || !levels.length || !track.details) {
|
25714
25714
|
return;
|
25715
25715
|
}
|
@@ -25776,7 +25776,7 @@ class SubtitleStreamController extends BaseStreamController {
|
|
25776
25776
|
}
|
25777
25777
|
class BufferableInstance {
|
25778
25778
|
constructor(timeranges) {
|
25779
|
-
this.buffered =
|
25779
|
+
this.buffered = undefined;
|
25780
25780
|
const getRange = (name, index, length) => {
|
25781
25781
|
index = index >>> 0;
|
25782
25782
|
if (index > length - 1) {
|
@@ -26177,7 +26177,7 @@ class Row {
|
|
26177
26177
|
this.pos = 0;
|
26178
26178
|
this.currPenState = new PenState();
|
26179
26179
|
this.cueStartTime = null;
|
26180
|
-
this.logger =
|
26180
|
+
this.logger = undefined;
|
26181
26181
|
for (let i = 0; i < NR_COLS; i++) {
|
26182
26182
|
this.chars.push(new StyledUnicodeChar());
|
26183
26183
|
}
|
@@ -26303,7 +26303,7 @@ class CaptionScreen {
|
|
26303
26303
|
this.currRow = NR_ROWS - 1;
|
26304
26304
|
this.nrRollUpRows = null;
|
26305
26305
|
this.lastOutputScreen = null;
|
26306
|
-
this.logger =
|
26306
|
+
this.logger = undefined;
|
26307
26307
|
for (let i = 0; i < NR_ROWS; i++) {
|
26308
26308
|
this.rows.push(new Row(logger));
|
26309
26309
|
}
|
@@ -26480,17 +26480,17 @@ class CaptionScreen {
|
|
26480
26480
|
|
26481
26481
|
class Cea608Channel {
|
26482
26482
|
constructor(channelNumber, outputFilter, logger) {
|
26483
|
-
this.chNr =
|
26484
|
-
this.outputFilter =
|
26485
|
-
this.mode =
|
26486
|
-
this.verbose =
|
26487
|
-
this.displayedMemory =
|
26488
|
-
this.nonDisplayedMemory =
|
26489
|
-
this.lastOutputScreen =
|
26490
|
-
this.currRollUpRow =
|
26491
|
-
this.writeScreen =
|
26492
|
-
this.cueStartTime =
|
26493
|
-
this.logger =
|
26483
|
+
this.chNr = undefined;
|
26484
|
+
this.outputFilter = undefined;
|
26485
|
+
this.mode = undefined;
|
26486
|
+
this.verbose = undefined;
|
26487
|
+
this.displayedMemory = undefined;
|
26488
|
+
this.nonDisplayedMemory = undefined;
|
26489
|
+
this.lastOutputScreen = undefined;
|
26490
|
+
this.currRollUpRow = undefined;
|
26491
|
+
this.writeScreen = undefined;
|
26492
|
+
this.cueStartTime = undefined;
|
26493
|
+
this.logger = undefined;
|
26494
26494
|
this.chNr = channelNumber;
|
26495
26495
|
this.outputFilter = outputFilter;
|
26496
26496
|
this.mode = null;
|
@@ -26701,10 +26701,10 @@ class Cea608Channel {
|
|
26701
26701
|
|
26702
26702
|
class Cea608Parser {
|
26703
26703
|
constructor(field, out1, out2) {
|
26704
|
-
this.channels =
|
26704
|
+
this.channels = undefined;
|
26705
26705
|
this.currentChannel = 0;
|
26706
26706
|
this.cmdHistory = createCmdHistory();
|
26707
|
-
this.logger =
|
26707
|
+
this.logger = undefined;
|
26708
26708
|
const logger = this.logger = new CaptionsLogger();
|
26709
26709
|
this.channels = [null, new Cea608Channel(field, out1, logger), new Cea608Channel(field + 1, out2, logger)];
|
26710
26710
|
}
|
@@ -27505,9 +27505,9 @@ class VTTParser {
|
|
27505
27505
|
this.decoder = new StringDecoder();
|
27506
27506
|
this.regionList = [];
|
27507
27507
|
this.cue = null;
|
27508
|
-
this.oncue =
|
27509
|
-
this.onparsingerror =
|
27510
|
-
this.onflush =
|
27508
|
+
this.oncue = undefined;
|
27509
|
+
this.onparsingerror = undefined;
|
27510
|
+
this.onflush = undefined;
|
27511
27511
|
}
|
27512
27512
|
parse(data) {
|
27513
27513
|
const _this = this;
|
@@ -28042,9 +28042,9 @@ function parseTimeUnits(timeAttributeValue, rateInfo) {
|
|
28042
28042
|
|
28043
28043
|
class OutputFilter {
|
28044
28044
|
constructor(timelineController, trackName) {
|
28045
|
-
this.timelineController =
|
28045
|
+
this.timelineController = undefined;
|
28046
28046
|
this.cueRanges = [];
|
28047
|
-
this.trackName =
|
28047
|
+
this.trackName = undefined;
|
28048
28048
|
this.startTime = null;
|
28049
28049
|
this.endTime = null;
|
28050
28050
|
this.screen = null;
|
@@ -28074,19 +28074,19 @@ class OutputFilter {
|
|
28074
28074
|
|
28075
28075
|
class TimelineController {
|
28076
28076
|
constructor(hls) {
|
28077
|
-
this.hls =
|
28077
|
+
this.hls = undefined;
|
28078
28078
|
this.media = null;
|
28079
|
-
this.config =
|
28079
|
+
this.config = undefined;
|
28080
28080
|
this.enabled = true;
|
28081
|
-
this.Cues =
|
28081
|
+
this.Cues = undefined;
|
28082
28082
|
this.textTracks = [];
|
28083
28083
|
this.tracks = [];
|
28084
28084
|
this.initPTS = [];
|
28085
28085
|
this.unparsedVttFrags = [];
|
28086
28086
|
this.captionsTracks = {};
|
28087
28087
|
this.nonNativeCaptionsTracks = {};
|
28088
|
-
this.cea608Parser1 =
|
28089
|
-
this.cea608Parser2 =
|
28088
|
+
this.cea608Parser1 = undefined;
|
28089
|
+
this.cea608Parser2 = undefined;
|
28090
28090
|
this.lastCc = -1;
|
28091
28091
|
// Last video (CEA-608) fragment CC
|
28092
28092
|
this.lastSn = -1;
|
@@ -28096,7 +28096,7 @@ class TimelineController {
|
|
28096
28096
|
this.prevCC = -1;
|
28097
28097
|
// Last subtitle fragment CC
|
28098
28098
|
this.vttCCs = newVTTCCs();
|
28099
|
-
this.captionsProperties =
|
28099
|
+
this.captionsProperties = undefined;
|
28100
28100
|
this.hls = hls;
|
28101
28101
|
this.config = hls.config;
|
28102
28102
|
this.Cues = hls.config.cueHandler;
|
@@ -28445,7 +28445,7 @@ class TimelineController {
|
|
28445
28445
|
}
|
28446
28446
|
closedCaptionsForLevel(frag) {
|
28447
28447
|
const level = this.hls.levels[frag.level];
|
28448
|
-
return level == null ?
|
28448
|
+
return level == null ? undefined : level.attrs['CLOSED-CAPTIONS'];
|
28449
28449
|
}
|
28450
28450
|
onFragLoading(event, data) {
|
28451
28451
|
// if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack
|
@@ -28460,7 +28460,7 @@ class TimelineController {
|
|
28460
28460
|
cc,
|
28461
28461
|
sn
|
28462
28462
|
} = data.frag;
|
28463
|
-
const partIndex = (_data$part$index = (_data$part = data.part) == null ?
|
28463
|
+
const partIndex = (_data$part$index = (_data$part = data.part) == null ? undefined : _data$part.index) != null ? _data$part$index : -1;
|
28464
28464
|
if (cea608Parser1 && cea608Parser2) {
|
28465
28465
|
if (sn !== lastSn + 1 || sn === lastSn && partIndex !== this.lastPartIndex + 1 || cc !== this.lastCc) {
|
28466
28466
|
cea608Parser1.reset();
|
@@ -28814,15 +28814,15 @@ function fetchSupported() {
|
|
28814
28814
|
const BYTERANGE = /(\d+)-(\d+)\/(\d+)/;
|
28815
28815
|
class FetchLoader {
|
28816
28816
|
constructor(config) {
|
28817
|
-
this.fetchSetup =
|
28818
|
-
this.requestTimeout =
|
28817
|
+
this.fetchSetup = undefined;
|
28818
|
+
this.requestTimeout = undefined;
|
28819
28819
|
this.request = null;
|
28820
28820
|
this.response = null;
|
28821
|
-
this.controller =
|
28821
|
+
this.controller = undefined;
|
28822
28822
|
this.context = null;
|
28823
28823
|
this.config = null;
|
28824
28824
|
this.callbacks = null;
|
28825
|
-
this.stats =
|
28825
|
+
this.stats = undefined;
|
28826
28826
|
this.loader = null;
|
28827
28827
|
this.fetchSetup = config.fetchSetup || getRequest;
|
28828
28828
|
this.controller = new self.AbortController();
|
@@ -28895,7 +28895,7 @@ class FetchLoader {
|
|
28895
28895
|
}
|
28896
28896
|
stats.loading.first = first;
|
28897
28897
|
stats.total = getContentLength(response.headers) || stats.total;
|
28898
|
-
const onProgress = (_this$callbacks2 = this.callbacks) == null ?
|
28898
|
+
const onProgress = (_this$callbacks2 = this.callbacks) == null ? undefined : _this$callbacks2.onProgress;
|
28899
28899
|
if (onProgress && isFiniteNumber(config.highWaterMark)) {
|
28900
28900
|
return this.loadProgressively(response, stats, context, config.highWaterMark, onProgress);
|
28901
28901
|
}
|
@@ -28923,11 +28923,11 @@ class FetchLoader {
|
|
28923
28923
|
data: responseData,
|
28924
28924
|
code: response.status
|
28925
28925
|
};
|
28926
|
-
const onProgress = (_this$callbacks3 = this.callbacks) == null ?
|
28926
|
+
const onProgress = (_this$callbacks3 = this.callbacks) == null ? undefined : _this$callbacks3.onProgress;
|
28927
28927
|
if (onProgress && !isFiniteNumber(config.highWaterMark)) {
|
28928
28928
|
onProgress(stats, context, responseData, response);
|
28929
28929
|
}
|
28930
|
-
(_this$callbacks4 = this.callbacks) == null ?
|
28930
|
+
(_this$callbacks4 = this.callbacks) == null ? undefined : _this$callbacks4.onSuccess(loaderResponse, stats, context, response);
|
28931
28931
|
}).catch(error => {
|
28932
28932
|
var _this$callbacks5;
|
28933
28933
|
self.clearTimeout(this.requestTimeout);
|
@@ -28938,7 +28938,7 @@ class FetchLoader {
|
|
28938
28938
|
// when destroying, 'error' itself can be undefined
|
28939
28939
|
const code = !error ? 0 : error.code || 0;
|
28940
28940
|
const text = !error ? null : error.message;
|
28941
|
-
(_this$callbacks5 = this.callbacks) == null ?
|
28941
|
+
(_this$callbacks5 = this.callbacks) == null ? undefined : _this$callbacks5.onError({
|
28942
28942
|
code,
|
28943
28943
|
text
|
28944
28944
|
}, context, error ? error.details : null, stats);
|
@@ -29029,8 +29029,8 @@ function getRequest(context, initParams) {
|
|
29029
29029
|
class FetchError extends Error {
|
29030
29030
|
constructor(message, code, details) {
|
29031
29031
|
super(message);
|
29032
|
-
this.code =
|
29033
|
-
this.details =
|
29032
|
+
this.code = undefined;
|
29033
|
+
this.details = undefined;
|
29034
29034
|
this.code = code;
|
29035
29035
|
this.details = details;
|
29036
29036
|
}
|
@@ -29039,15 +29039,15 @@ class FetchError extends Error {
|
|
29039
29039
|
const AGE_HEADER_LINE_REGEX = /^age:\s*[\d.]+\s*$/im;
|
29040
29040
|
class XhrLoader {
|
29041
29041
|
constructor(config) {
|
29042
|
-
this.xhrSetup =
|
29043
|
-
this.requestTimeout =
|
29044
|
-
this.retryTimeout =
|
29045
|
-
this.retryDelay =
|
29042
|
+
this.xhrSetup = undefined;
|
29043
|
+
this.requestTimeout = undefined;
|
29044
|
+
this.retryTimeout = undefined;
|
29045
|
+
this.retryDelay = undefined;
|
29046
29046
|
this.config = null;
|
29047
29047
|
this.callbacks = null;
|
29048
29048
|
this.context = null;
|
29049
29049
|
this.loader = null;
|
29050
|
-
this.stats =
|
29050
|
+
this.stats = undefined;
|
29051
29051
|
this.xhrSetup = config ? config.xhrSetup || null : null;
|
29052
29052
|
this.stats = new LoadStats();
|
29053
29053
|
this.retryDelay = 0;
|
@@ -29118,7 +29118,7 @@ class XhrLoader {
|
|
29118
29118
|
}).catch(error => {
|
29119
29119
|
var _this$callbacks2;
|
29120
29120
|
// IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
|
29121
|
-
(_this$callbacks2 = this.callbacks) == null ?
|
29121
|
+
(_this$callbacks2 = this.callbacks) == null ? undefined : _this$callbacks2.onError({
|
29122
29122
|
code: xhr.status,
|
29123
29123
|
text: error.message
|
29124
29124
|
}, context, xhr, stats);
|
@@ -29197,7 +29197,7 @@ class XhrLoader {
|
|
29197
29197
|
const len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
|
29198
29198
|
stats.loaded = stats.total = len;
|
29199
29199
|
stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
|
29200
|
-
const onProgress = (_this$callbacks3 = this.callbacks) == null ?
|
29200
|
+
const onProgress = (_this$callbacks3 = this.callbacks) == null ? undefined : _this$callbacks3.onProgress;
|
29201
29201
|
if (onProgress) {
|
29202
29202
|
onProgress(stats, context, data, xhr);
|
29203
29203
|
}
|
@@ -29206,7 +29206,7 @@ class XhrLoader {
|
|
29206
29206
|
data: data,
|
29207
29207
|
code: status
|
29208
29208
|
};
|
29209
|
-
(_this$callbacks4 = this.callbacks) == null ?
|
29209
|
+
(_this$callbacks4 = this.callbacks) == null ? undefined : _this$callbacks4.onSuccess(_response, stats, context, xhr);
|
29210
29210
|
return;
|
29211
29211
|
}
|
29212
29212
|
}
|
@@ -29225,7 +29225,7 @@ class XhrLoader {
|
|
29225
29225
|
} else {
|
29226
29226
|
var _this$callbacks5;
|
29227
29227
|
logger.error(`${status} while loading ${context.url}`);
|
29228
|
-
(_this$callbacks5 = this.callbacks) == null ?
|
29228
|
+
(_this$callbacks5 = this.callbacks) == null ? undefined : _this$callbacks5.onError({
|
29229
29229
|
code: status,
|
29230
29230
|
text: xhr.statusText
|
29231
29231
|
}, context, xhr, stats);
|
@@ -29241,7 +29241,7 @@ class XhrLoader {
|
|
29241
29241
|
this.retry(retryConfig);
|
29242
29242
|
} else {
|
29243
29243
|
var _this$context;
|
29244
|
-
logger.warn(`timeout while loading ${(_this$context = this.context) == null ?
|
29244
|
+
logger.warn(`timeout while loading ${(_this$context = this.context) == null ? undefined : _this$context.url}`);
|
29245
29245
|
const callbacks = this.callbacks;
|
29246
29246
|
if (callbacks) {
|
29247
29247
|
this.abortInternal();
|
@@ -29256,7 +29256,7 @@ class XhrLoader {
|
|
29256
29256
|
} = this;
|
29257
29257
|
this.retryDelay = getRetryDelay(retryConfig, stats.retry);
|
29258
29258
|
stats.retry++;
|
29259
|
-
logger.warn(`${status ? 'HTTP Status ' + status : 'Timeout'} while loading ${context == null ?
|
29259
|
+
logger.warn(`${status ? 'HTTP Status ' + status : 'Timeout'} while loading ${context == null ? undefined : context.url}, retrying ${stats.retry}/${retryConfig.maxNumRetry} in ${this.retryDelay}ms`);
|
29260
29260
|
// abort and reset internal state
|
29261
29261
|
this.abortInternal();
|
29262
29262
|
this.loader = null;
|
@@ -29733,7 +29733,7 @@ function hexToArrayBuffer(str) {
|
|
29733
29733
|
}
|
29734
29734
|
class ID3TrackController {
|
29735
29735
|
constructor(hls) {
|
29736
|
-
this.hls =
|
29736
|
+
this.hls = undefined;
|
29737
29737
|
this.id3Track = null;
|
29738
29738
|
this.media = null;
|
29739
29739
|
this.dateRangeCuesAppended = {};
|
@@ -29785,7 +29785,7 @@ class ID3TrackController {
|
|
29785
29785
|
onMediaAttaching(event, data) {
|
29786
29786
|
var _data$overrides;
|
29787
29787
|
this.media = data.media;
|
29788
|
-
if (((_data$overrides = data.overrides) == null ?
|
29788
|
+
if (((_data$overrides = data.overrides) == null ? undefined : _data$overrides.cueRemoval) === false) {
|
29789
29789
|
this.removeCues = false;
|
29790
29790
|
}
|
29791
29791
|
}
|
@@ -29892,7 +29892,7 @@ class ID3TrackController {
|
|
29892
29892
|
}
|
29893
29893
|
updateId3CueEnds(startTime, type) {
|
29894
29894
|
var _this$id3Track;
|
29895
|
-
const cues = (_this$id3Track = this.id3Track) == null ?
|
29895
|
+
const cues = (_this$id3Track = this.id3Track) == null ? undefined : _this$id3Track.cues;
|
29896
29896
|
if (cues) {
|
29897
29897
|
for (let i = cues.length; i--;) {
|
29898
29898
|
const cue = cues[i];
|
@@ -29979,7 +29979,7 @@ class ID3TrackController {
|
|
29979
29979
|
}
|
29980
29980
|
// Exit if the playlist does not have Date Ranges or does not have Program Date Time
|
29981
29981
|
const lastFragment = details.fragments[details.fragments.length - 1];
|
29982
|
-
if (ids.length === 0 || !isFiniteNumber(lastFragment == null ?
|
29982
|
+
if (ids.length === 0 || !isFiniteNumber(lastFragment == null ? undefined : lastFragment.programDateTime)) {
|
29983
29983
|
return;
|
29984
29984
|
}
|
29985
29985
|
if (!this.id3Track) {
|
@@ -29993,8 +29993,8 @@ class ID3TrackController {
|
|
29993
29993
|
|
29994
29994
|
// Process DateRanges to determine end-time (known DURATION, END-DATE, or END-ON-NEXT)
|
29995
29995
|
const appendedDateRangeCues = dateRangeCuesAppended[id];
|
29996
|
-
const cues = (appendedDateRangeCues == null ?
|
29997
|
-
let durationKnown = (appendedDateRangeCues == null ?
|
29996
|
+
const cues = (appendedDateRangeCues == null ? undefined : appendedDateRangeCues.cues) || {};
|
29997
|
+
let durationKnown = (appendedDateRangeCues == null ? undefined : appendedDateRangeCues.durationKnown) || false;
|
29998
29998
|
let endTime = MAX_CUE_ENDTIME;
|
29999
29999
|
const {
|
30000
30000
|
duration,
|
@@ -30070,8 +30070,8 @@ class ID3TrackController {
|
|
30070
30070
|
|
30071
30071
|
class LatencyController {
|
30072
30072
|
constructor(hls) {
|
30073
|
-
this.hls =
|
30074
|
-
this.config =
|
30073
|
+
this.hls = undefined;
|
30074
|
+
this.config = undefined;
|
30075
30075
|
this.media = null;
|
30076
30076
|
this.currentTime = 0;
|
30077
30077
|
this.stallCount = 0;
|
@@ -30133,7 +30133,7 @@ class LatencyController {
|
|
30133
30133
|
if (config.liveMaxLatencyDuration !== undefined) {
|
30134
30134
|
return config.liveMaxLatencyDuration;
|
30135
30135
|
}
|
30136
|
-
const levelDetails = (_this$hls = this.hls) == null ?
|
30136
|
+
const levelDetails = (_this$hls = this.hls) == null ? undefined : _this$hls.latestLevelDetails;
|
30137
30137
|
return levelDetails ? config.liveMaxLatencyDurationCount * levelDetails.targetduration : 0;
|
30138
30138
|
}
|
30139
30139
|
get targetLatency() {
|
@@ -30282,12 +30282,12 @@ class LevelController extends BasePlaylistController {
|
|
30282
30282
|
this._levels = [];
|
30283
30283
|
this._firstLevel = -1;
|
30284
30284
|
this._maxAutoLevel = -1;
|
30285
|
-
this._startLevel =
|
30285
|
+
this._startLevel = undefined;
|
30286
30286
|
this.currentLevel = null;
|
30287
30287
|
this.currentLevelIndex = -1;
|
30288
30288
|
this.manualLevelIndex = -1;
|
30289
|
-
this.steering =
|
30290
|
-
this.onParsedComplete =
|
30289
|
+
this.steering = undefined;
|
30290
|
+
this.onParsedComplete = undefined;
|
30291
30291
|
this.steering = contentSteeringController;
|
30292
30292
|
this._registerListeners();
|
30293
30293
|
}
|
@@ -30359,7 +30359,7 @@ class LevelController extends BasePlaylistController {
|
|
30359
30359
|
// Returns empty and set to undefined for 'mp4a.40.34' with fallback to 'audio/mpeg' SourceBuffer
|
30360
30360
|
levelParsed.audioCodec = audioCodec = getCodecCompatibleName(audioCodec, preferManagedMediaSource) || undefined;
|
30361
30361
|
}
|
30362
|
-
if (((_videoCodec = videoCodec) == null ?
|
30362
|
+
if (((_videoCodec = videoCodec) == null ? undefined : _videoCodec.indexOf('avc1')) === 0) {
|
30363
30363
|
videoCodec = levelParsed.videoCodec = convertAVC1ToAVCOTI(videoCodec);
|
30364
30364
|
}
|
30365
30365
|
|
@@ -30530,7 +30530,7 @@ class LevelController extends BasePlaylistController {
|
|
30530
30530
|
const bandwidthEstimate = this.hls.bandwidthEstimate;
|
30531
30531
|
this.log(`manifest loaded, ${levels.length} level(s) found, first bitrate: ${firstLevelBitrate}`);
|
30532
30532
|
// Update default bwe to first variant bitrate as long it has not been configured or set
|
30533
|
-
if (((_this$hls$userConfig = this.hls.userConfig) == null ?
|
30533
|
+
if (((_this$hls$userConfig = this.hls.userConfig) == null ? undefined : _this$hls$userConfig.abrEwmaDefaultEstimate) === undefined) {
|
30534
30534
|
const startingBwEstimate = Math.min(firstLevelBitrate, this.hls.config.abrEwmaDefaultEstimateMax);
|
30535
30535
|
if (startingBwEstimate > bandwidthEstimate && bandwidthEstimate === this.hls.abrEwmaDefaultEstimate) {
|
30536
30536
|
this.hls.bandwidthEstimate = startingBwEstimate;
|
@@ -30631,7 +30631,7 @@ class LevelController extends BasePlaylistController {
|
|
30631
30631
|
const levelDetails = level.details;
|
30632
30632
|
if (!levelDetails || levelDetails.live) {
|
30633
30633
|
// level not retrieved yet, or live playlist we need to (re)load it
|
30634
|
-
const hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ?
|
30634
|
+
const hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? undefined : lastLevel.details, levelDetails);
|
30635
30635
|
this.loadPlaylist(hlsUrlParameters);
|
30636
30636
|
}
|
30637
30637
|
}
|
@@ -30756,8 +30756,8 @@ class LevelController extends BasePlaylistController {
|
|
30756
30756
|
const currentLevelIndex = this.currentLevelIndex;
|
30757
30757
|
const pathwayId = currentLevel.attrs['PATHWAY-ID'];
|
30758
30758
|
const details = currentLevel.details;
|
30759
|
-
const age = details == null ?
|
30760
|
-
this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters == null ?
|
30759
|
+
const age = details == null ? undefined : details.age;
|
30760
|
+
this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters == null ? undefined : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${pathwayId ? ' Pathway ' + pathwayId : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
|
30761
30761
|
this.hls.trigger(Events.LEVEL_LOADING, {
|
30762
30762
|
url,
|
30763
30763
|
level: currentLevelIndex,
|
@@ -30858,10 +30858,10 @@ const SKIP_BUFFER_RANGE_START = 0.05;
|
|
30858
30858
|
class GapController extends Logger {
|
30859
30859
|
constructor(config, media, fragmentTracker, hls) {
|
30860
30860
|
super('gap-controller', hls.logger);
|
30861
|
-
this.config =
|
30861
|
+
this.config = undefined;
|
30862
30862
|
this.media = null;
|
30863
|
-
this.fragmentTracker =
|
30864
|
-
this.hls =
|
30863
|
+
this.fragmentTracker = undefined;
|
30864
|
+
this.hls = undefined;
|
30865
30865
|
this.nudgeRetry = 0;
|
30866
30866
|
this.stallReported = false;
|
30867
30867
|
this.stalled = null;
|
@@ -30989,7 +30989,7 @@ class GapController extends Logger {
|
|
30989
30989
|
const stalledDuration = tnow - stalled;
|
30990
30990
|
if (!seeking && stalledDuration >= STALL_MINIMUM_DURATION_MS) {
|
30991
30991
|
// Dispatch MEDIA_ENDED when media.ended/ended event is not signalled at end of stream
|
30992
|
-
if (state === State.ENDED && !(levelDetails != null && levelDetails.live) && Math.abs(currentTime - ((levelDetails == null ?
|
30992
|
+
if (state === State.ENDED && !(levelDetails != null && levelDetails.live) && Math.abs(currentTime - ((levelDetails == null ? undefined : levelDetails.edge) || 0)) < 1) {
|
30993
30993
|
if (stalledDuration < 1000 || this.ended) {
|
30994
30994
|
return;
|
30995
30995
|
}
|
@@ -31215,12 +31215,12 @@ function isSupported() {
|
|
31215
31215
|
return false;
|
31216
31216
|
}
|
31217
31217
|
const mediaSource = getMediaSource();
|
31218
|
-
return typeof (mediaSource == null ?
|
31218
|
+
return typeof (mediaSource == null ? undefined : mediaSource.isTypeSupported) === 'function' && (['avc1.42E01E,mp4a.40.2', 'av01.0.01M.08', 'vp09.00.50.08'].some(codecsForVideoContainer => mediaSource.isTypeSupported(mimeTypeForCodec(codecsForVideoContainer, 'video'))) || ['mp4a.40.2', 'fLaC'].some(codecForAudioContainer => mediaSource.isTypeSupported(mimeTypeForCodec(codecForAudioContainer, 'audio'))));
|
31219
31219
|
}
|
31220
31220
|
function changeTypeSupported() {
|
31221
31221
|
var _sourceBuffer$prototy;
|
31222
31222
|
const sourceBuffer = getSourceBuffer();
|
31223
|
-
return typeof (sourceBuffer == null ?
|
31223
|
+
return typeof (sourceBuffer == null ? undefined : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? undefined : _sourceBuffer$prototy.changeType) === 'function';
|
31224
31224
|
}
|
31225
31225
|
|
31226
31226
|
const TICK_INTERVAL = 100; // how often to tick in ms
|
@@ -31358,8 +31358,8 @@ class StreamController extends BaseStreamController {
|
|
31358
31358
|
levels,
|
31359
31359
|
level
|
31360
31360
|
} = this;
|
31361
|
-
const currentLevel = levels == null ?
|
31362
|
-
const details = currentLevel == null ?
|
31361
|
+
const currentLevel = levels == null ? undefined : levels[level];
|
31362
|
+
const details = currentLevel == null ? undefined : currentLevel.details;
|
31363
31363
|
if (details && (!details.live || this.levelLastLoaded === currentLevel && !this.waitForLive(currentLevel))) {
|
31364
31364
|
if (this.waitForCdnTuneIn(details)) {
|
31365
31365
|
break;
|
@@ -31383,7 +31383,7 @@ class StreamController extends BaseStreamController {
|
|
31383
31383
|
levels,
|
31384
31384
|
level
|
31385
31385
|
} = this;
|
31386
|
-
const currentLevel = levels == null ?
|
31386
|
+
const currentLevel = levels == null ? undefined : levels[level];
|
31387
31387
|
this.resetStartWhenNotLoaded(currentLevel || null);
|
31388
31388
|
this.state = State.IDLE;
|
31389
31389
|
}
|
@@ -31664,7 +31664,7 @@ class StreamController extends BaseStreamController {
|
|
31664
31664
|
if (gapController.ended) {
|
31665
31665
|
return;
|
31666
31666
|
}
|
31667
|
-
gapController.ended = ((_this$media2 = this.media) == null ?
|
31667
|
+
gapController.ended = ((_this$media2 = this.media) == null ? undefined : _this$media2.currentTime) || 1;
|
31668
31668
|
}
|
31669
31669
|
this.hls.trigger(Events.MEDIA_ENDED, {
|
31670
31670
|
stalled: false
|
@@ -31739,7 +31739,7 @@ class StreamController extends BaseStreamController {
|
|
31739
31739
|
if (newDetails.deltaUpdateFailed) {
|
31740
31740
|
return;
|
31741
31741
|
}
|
31742
|
-
sliding = this.alignPlaylists(newDetails, curLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ?
|
31742
|
+
sliding = this.alignPlaylists(newDetails, curLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
|
31743
31743
|
}
|
31744
31744
|
// override level info
|
31745
31745
|
curLevel.details = newDetails;
|
@@ -31825,7 +31825,7 @@ class StreamController extends BaseStreamController {
|
|
31825
31825
|
|
31826
31826
|
// time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
|
31827
31827
|
const accurateTimeOffset = details.PTSKnown || !details.live;
|
31828
|
-
const initSegmentData = (_frag$initSegment = frag.initSegment) == null ?
|
31828
|
+
const initSegmentData = (_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.data;
|
31829
31829
|
const audioCodec = this._getAudioCodec(currentLevel);
|
31830
31830
|
|
31831
31831
|
// transmux the MPEG-TS data to ISO-BMFF segments
|
@@ -31869,7 +31869,7 @@ class StreamController extends BaseStreamController {
|
|
31869
31869
|
this.fragmentTracker.removeAllFragments();
|
31870
31870
|
hls.once(Events.BUFFER_FLUSHED, () => {
|
31871
31871
|
var _this$hls;
|
31872
|
-
(_this$hls = this.hls) == null ?
|
31872
|
+
(_this$hls = this.hls) == null ? undefined : _this$hls.trigger(Events.AUDIO_TRACK_SWITCHED, data);
|
31873
31873
|
});
|
31874
31874
|
hls.trigger(Events.BUFFER_FLUSHING, {
|
31875
31875
|
startOffset: 0,
|
@@ -31982,7 +31982,7 @@ class StreamController extends BaseStreamController {
|
|
31982
31982
|
case ErrorDetails.LEVEL_LOAD_TIMEOUT:
|
31983
31983
|
case ErrorDetails.LEVEL_PARSING_ERROR:
|
31984
31984
|
// in case of non fatal error while loading level, if level controller is not retrying to load level, switch back to IDLE
|
31985
|
-
if (!data.levelRetry && this.state === State.WAITING_LEVEL && ((_data$context = data.context) == null ?
|
31985
|
+
if (!data.levelRetry && this.state === State.WAITING_LEVEL && ((_data$context = data.context) == null ? undefined : _data$context.type) === PlaylistContextType.LEVEL) {
|
31986
31986
|
this.state = State.IDLE;
|
31987
31987
|
}
|
31988
31988
|
break;
|
@@ -32080,13 +32080,13 @@ class StreamController extends BaseStreamController {
|
|
32080
32080
|
const details = this.getLevelDetails();
|
32081
32081
|
const configuredTimelineOffset = this.config.timelineOffset;
|
32082
32082
|
if (configuredTimelineOffset && startPosition) {
|
32083
|
-
startPosition += (details == null ?
|
32083
|
+
startPosition += (details == null ? undefined : details.appliedTimelineOffset) || configuredTimelineOffset;
|
32084
32084
|
}
|
32085
32085
|
const buffered = BufferHelper.getBuffered(media);
|
32086
32086
|
const bufferStart = buffered.length ? buffered.start(0) : 0;
|
32087
32087
|
const delta = bufferStart - startPosition;
|
32088
32088
|
const skipTolerance = Math.max(this.config.maxBufferHole, this.config.maxFragLookUpTolerance);
|
32089
|
-
if (delta > 0 && (delta < skipTolerance || this.loadingParts && delta < 2 * ((details == null ?
|
32089
|
+
if (delta > 0 && (delta < skipTolerance || this.loadingParts && delta < 2 * ((details == null ? undefined : details.partTarget) || 0))) {
|
32090
32090
|
this.log(`adjusting start position by ${delta} to match buffer start`);
|
32091
32091
|
startPosition += delta;
|
32092
32092
|
this.startPosition = startPosition;
|
@@ -32115,7 +32115,7 @@ class StreamController extends BaseStreamController {
|
|
32115
32115
|
const {
|
32116
32116
|
hls
|
32117
32117
|
} = this;
|
32118
|
-
const frag = data == null ?
|
32118
|
+
const frag = data == null ? undefined : data.frag;
|
32119
32119
|
if (!frag || this.fragContextChanged(frag)) {
|
32120
32120
|
return;
|
32121
32121
|
}
|
@@ -32349,7 +32349,7 @@ class StreamController extends BaseStreamController {
|
|
32349
32349
|
video.levelCodec = currentLevel.videoCodec;
|
32350
32350
|
video.id = 'main';
|
32351
32351
|
const parsedVideoCodec = video.codec;
|
32352
|
-
if ((parsedVideoCodec == null ?
|
32352
|
+
if ((parsedVideoCodec == null ? undefined : parsedVideoCodec.length) === 4) {
|
32353
32353
|
// Make up for passthrough-remuxer not being able to parse full codec
|
32354
32354
|
// (logger warning "Unhandled video codec...")
|
32355
32355
|
switch (parsedVideoCodec) {
|
@@ -32407,7 +32407,7 @@ class StreamController extends BaseStreamController {
|
|
32407
32407
|
levels,
|
32408
32408
|
level
|
32409
32409
|
} = this;
|
32410
|
-
const levelInfo = levels == null ?
|
32410
|
+
const levelInfo = levels == null ? undefined : levels[level];
|
32411
32411
|
if (!levelInfo) {
|
32412
32412
|
return this.config.maxBufferLength;
|
32413
32413
|
}
|
@@ -32476,7 +32476,7 @@ class StreamController extends BaseStreamController {
|
|
32476
32476
|
if (this.fragPlaying) {
|
32477
32477
|
return this.fragPlaying;
|
32478
32478
|
}
|
32479
|
-
const currentTime = ((_this$media3 = this.media) == null ?
|
32479
|
+
const currentTime = ((_this$media3 = this.media) == null ? undefined : _this$media3.currentTime) || this.lastCurrentTime;
|
32480
32480
|
if (isFiniteNumber(currentTime)) {
|
32481
32481
|
return this.getAppendedFrag(currentTime);
|
32482
32482
|
}
|
@@ -32484,7 +32484,7 @@ class StreamController extends BaseStreamController {
|
|
32484
32484
|
}
|
32485
32485
|
get currentProgramDateTime() {
|
32486
32486
|
var _this$media4;
|
32487
|
-
const currentTime = ((_this$media4 = this.media) == null ?
|
32487
|
+
const currentTime = ((_this$media4 = this.media) == null ? undefined : _this$media4.currentTime) || this.lastCurrentTime;
|
32488
32488
|
if (isFiniteNumber(currentTime)) {
|
32489
32489
|
const details = this.getLevelDetails();
|
32490
32490
|
const frag = this.currentFrag || (details ? findFragmentByPTS(null, details.fragments, currentTime) : null);
|
@@ -32519,7 +32519,7 @@ class StreamController extends BaseStreamController {
|
|
32519
32519
|
|
32520
32520
|
class KeyLoader {
|
32521
32521
|
constructor(config) {
|
32522
|
-
this.config =
|
32522
|
+
this.config = undefined;
|
32523
32523
|
this.keyUriToKeyInfo = {};
|
32524
32524
|
this.emeController = null;
|
32525
32525
|
this.config = config;
|
@@ -32529,7 +32529,7 @@ class KeyLoader {
|
|
32529
32529
|
const loader = this.keyUriToKeyInfo[uri].loader;
|
32530
32530
|
if (loader) {
|
32531
32531
|
var _loader$context;
|
32532
|
-
if (type && type !== ((_loader$context = loader.context) == null ?
|
32532
|
+
if (type && type !== ((_loader$context = loader.context) == null ? undefined : _loader$context.frag.type)) {
|
32533
32533
|
return;
|
32534
32534
|
}
|
32535
32535
|
loader.abort();
|
@@ -32618,7 +32618,7 @@ class KeyLoader {
|
|
32618
32618
|
// Return key load promise as long as it does not have a mediakey session with an unusable key status
|
32619
32619
|
if ((_keyInfo2 = keyInfo) != null && _keyInfo2.keyLoadPromise) {
|
32620
32620
|
var _keyInfo$mediaKeySess;
|
32621
|
-
switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) == null ?
|
32621
|
+
switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) == null ? undefined : _keyInfo$mediaKeySess.keyStatus) {
|
32622
32622
|
case undefined:
|
32623
32623
|
case 'status-pending':
|
32624
32624
|
case 'usable':
|
@@ -32787,7 +32787,7 @@ function getResponseUrl(response, context) {
|
|
32787
32787
|
}
|
32788
32788
|
class PlaylistLoader {
|
32789
32789
|
constructor(hls) {
|
32790
|
-
this.hls =
|
32790
|
+
this.hls = undefined;
|
32791
32791
|
this.loaders = Object.create(null);
|
32792
32792
|
this.variableList = null;
|
32793
32793
|
this.onManifestLoaded = this.checkAutostartLoad;
|
@@ -32980,7 +32980,7 @@ class PlaylistLoader {
|
|
32980
32980
|
|
32981
32981
|
// Override level/track timeout for LL-HLS requests
|
32982
32982
|
// (the default of 10000ms is counter productive to blocking playlist reload requests)
|
32983
|
-
if (isFiniteNumber((_context$deliveryDire = context.deliveryDirectives) == null ?
|
32983
|
+
if (isFiniteNumber((_context$deliveryDire = context.deliveryDirectives) == null ? undefined : _context$deliveryDire.part)) {
|
32984
32984
|
let levelDetails;
|
32985
32985
|
if (context.type === PlaylistContextType.LEVEL && context.level !== null) {
|
32986
32986
|
levelDetails = this.hls.levels[context.level].details;
|
@@ -33223,7 +33223,7 @@ class PlaylistLoader {
|
|
33223
33223
|
stats
|
33224
33224
|
};
|
33225
33225
|
if (response) {
|
33226
|
-
const url = (networkDetails == null ?
|
33226
|
+
const url = (networkDetails == null ? undefined : networkDetails.url) || context.url;
|
33227
33227
|
errorData.response = _objectSpread2({
|
33228
33228
|
url,
|
33229
33229
|
data: undefined
|
@@ -33400,35 +33400,35 @@ class Hls {
|
|
33400
33400
|
/**
|
33401
33401
|
* The runtime configuration used by the player. At instantiation this is combination of `hls.userConfig` merged over `Hls.DefaultConfig`.
|
33402
33402
|
*/
|
33403
|
-
this.config =
|
33403
|
+
this.config = undefined;
|
33404
33404
|
/**
|
33405
33405
|
* The configuration object provided on player instantiation.
|
33406
33406
|
*/
|
33407
|
-
this.userConfig =
|
33407
|
+
this.userConfig = undefined;
|
33408
33408
|
/**
|
33409
33409
|
* The logger functions used by this player instance, configured on player instantiation.
|
33410
33410
|
*/
|
33411
|
-
this.logger =
|
33412
|
-
this.coreComponents =
|
33413
|
-
this.networkControllers =
|
33411
|
+
this.logger = undefined;
|
33412
|
+
this.coreComponents = undefined;
|
33413
|
+
this.networkControllers = undefined;
|
33414
33414
|
this._emitter = new EventEmitter();
|
33415
33415
|
this._autoLevelCapping = -1;
|
33416
33416
|
this._maxHdcpLevel = null;
|
33417
|
-
this.abrController =
|
33418
|
-
this.bufferController =
|
33419
|
-
this.capLevelController =
|
33420
|
-
this.latencyController =
|
33421
|
-
this.levelController =
|
33422
|
-
this.streamController =
|
33423
|
-
this.audioTrackController =
|
33424
|
-
this.subtitleTrackController =
|
33425
|
-
this.interstitialsController =
|
33426
|
-
this.emeController =
|
33427
|
-
this.cmcdController =
|
33417
|
+
this.abrController = undefined;
|
33418
|
+
this.bufferController = undefined;
|
33419
|
+
this.capLevelController = undefined;
|
33420
|
+
this.latencyController = undefined;
|
33421
|
+
this.levelController = undefined;
|
33422
|
+
this.streamController = undefined;
|
33423
|
+
this.audioTrackController = undefined;
|
33424
|
+
this.subtitleTrackController = undefined;
|
33425
|
+
this.interstitialsController = undefined;
|
33426
|
+
this.emeController = undefined;
|
33427
|
+
this.cmcdController = undefined;
|
33428
33428
|
this._media = null;
|
33429
33429
|
this._url = null;
|
33430
|
-
this._sessionId =
|
33431
|
-
this.triggeringException =
|
33430
|
+
this._sessionId = undefined;
|
33431
|
+
this.triggeringException = undefined;
|
33432
33432
|
this.started = false;
|
33433
33433
|
const logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance', userConfig.assetPlayerId);
|
33434
33434
|
const config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
|
@@ -33770,7 +33770,7 @@ class Hls {
|
|
33770
33770
|
recoverMediaError() {
|
33771
33771
|
this.logger.log('recoverMediaError');
|
33772
33772
|
const media = this._media;
|
33773
|
-
const time = media == null ?
|
33773
|
+
const time = media == null ? undefined : media.currentTime;
|
33774
33774
|
this.detachMedia();
|
33775
33775
|
if (media) {
|
33776
33776
|
this.attachMedia(media);
|
@@ -34109,7 +34109,7 @@ class Hls {
|
|
34109
34109
|
*/
|
34110
34110
|
setAudioOption(audioOption) {
|
34111
34111
|
var _this$audioTrackContr;
|
34112
|
-
return ((_this$audioTrackContr = this.audioTrackController) == null ?
|
34112
|
+
return ((_this$audioTrackContr = this.audioTrackController) == null ? undefined : _this$audioTrackContr.setAudioOption(audioOption)) || null;
|
34113
34113
|
}
|
34114
34114
|
/**
|
34115
34115
|
* Find and select the best matching subtitle track, making a level switch when a Group change is necessary.
|
@@ -34117,7 +34117,7 @@ class Hls {
|
|
34117
34117
|
*/
|
34118
34118
|
setSubtitleOption(subtitleOption) {
|
34119
34119
|
var _this$subtitleTrackCo;
|
34120
|
-
return ((_this$subtitleTrackCo = this.subtitleTrackController) == null ?
|
34120
|
+
return ((_this$subtitleTrackCo = this.subtitleTrackController) == null ? undefined : _this$subtitleTrackCo.setSubtitleOption(subtitleOption)) || null;
|
34121
34121
|
}
|
34122
34122
|
|
34123
34123
|
/**
|
@@ -34295,7 +34295,7 @@ class Hls {
|
|
34295
34295
|
*/
|
34296
34296
|
get interstitialsManager() {
|
34297
34297
|
var _this$interstitialsCo;
|
34298
|
-
return ((_this$interstitialsCo = this.interstitialsController) == null ?
|
34298
|
+
return ((_this$interstitialsCo = this.interstitialsController) == null ? undefined : _this$interstitialsCo.interstitialsManager) || null;
|
34299
34299
|
}
|
34300
34300
|
|
34301
34301
|
/**
|
@@ -34306,7 +34306,7 @@ class Hls {
|
|
34306
34306
|
return getMediaDecodingInfoPromise(level, audioTracksByGroup, navigator.mediaCapabilities);
|
34307
34307
|
}
|
34308
34308
|
}
|
34309
|
-
Hls.defaultConfig =
|
34309
|
+
Hls.defaultConfig = undefined;
|
34310
34310
|
|
34311
34311
|
export { AbrController, AttrList, AudioStreamController, AudioTrackController, BasePlaylistController, BaseSegment, BaseStreamController, BufferController, CMCDController, CapLevelController, ChunkMetadata, ContentSteeringController, Cues, DateRange, EMEController, ErrorActionFlags, ErrorController, ErrorDetails, ErrorTypes, Events, FPSController, FetchLoader, Fragment, Hls, HlsSkip, HlsUrlParameters, KeySystemFormats, KeySystems, Level, LevelDetails, LevelKey, LoadStats, MetadataSchema, NetworkErrorAction, Part, PlaylistLevelType, SubtitleStreamController, SubtitleTrackController, TimelineController, XhrLoader, Hls as default, fetchSupported, getMediaSource, isMSESupported, isSupported, requestMediaKeySystemAccess };
|
34312
34312
|
//# sourceMappingURL=hls.mjs.map
|