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