hls.js 1.6.0-beta.1.0.canary.10788 → 1.6.0-beta.1.0.canary.10791
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.d.mts +10 -6
- package/dist/hls.d.ts +10 -6
- package/dist/hls.js +135 -144
- package/dist/hls.js.d.ts +10 -6
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +94 -83
- 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 +91 -80
- 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 +132 -141
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +2 -2
- package/src/controller/audio-track-controller.ts +32 -46
- package/src/controller/base-playlist-controller.ts +97 -77
- package/src/controller/base-stream-controller.ts +1 -1
- package/src/controller/level-controller.ts +31 -46
- package/src/controller/subtitle-track-controller.ts +28 -39
- package/src/loader/level-details.ts +1 -0
- package/src/utils/level-helper.ts +3 -0
package/dist/hls.mjs
CHANGED
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
|
|
400
400
|
// Some browsers don't allow to use bind on console object anyway
|
401
401
|
// fallback to default if needed
|
402
402
|
try {
|
403
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.
|
403
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10791"}`);
|
404
404
|
} catch (e) {
|
405
405
|
/* log fn threw an exception. All logger methods are no-ops. */
|
406
406
|
return createLogger();
|
@@ -6283,6 +6283,7 @@ class LevelDetails {
|
|
6283
6283
|
this.dateRanges = void 0;
|
6284
6284
|
this.dateRangeTagCount = 0;
|
6285
6285
|
this.live = true;
|
6286
|
+
this.requestScheduled = -1;
|
6286
6287
|
this.ageHeader = 0;
|
6287
6288
|
this.advancedDateTime = void 0;
|
6288
6289
|
this.updated = true;
|
@@ -7678,6 +7679,9 @@ function mergeDetails(oldDetails, newDetails) {
|
|
7678
7679
|
newDetails.driftEnd = oldDetails.driftEnd;
|
7679
7680
|
newDetails.advancedDateTime = oldDetails.advancedDateTime;
|
7680
7681
|
}
|
7682
|
+
if (newDetails.requestScheduled === -1) {
|
7683
|
+
newDetails.requestScheduled = oldDetails.requestScheduled;
|
7684
|
+
}
|
7681
7685
|
}
|
7682
7686
|
function mergeDateRanges(oldDateRanges, newDetails) {
|
7683
7687
|
const {
|
@@ -9149,12 +9153,13 @@ class BaseStreamController extends TaskLoop {
|
|
9149
9153
|
this.nextLoadPosition = startPosition;
|
9150
9154
|
}
|
9151
9155
|
getLoadPosition() {
|
9156
|
+
var _this$hls;
|
9152
9157
|
const {
|
9153
9158
|
media
|
9154
9159
|
} = this;
|
9155
9160
|
// if we have not yet loaded any fragment, start loading from start position
|
9156
9161
|
let pos = 0;
|
9157
|
-
if (this.hls.hasEnoughToStart && media) {
|
9162
|
+
if ((_this$hls = this.hls) != null && _this$hls.hasEnoughToStart && media) {
|
9158
9163
|
pos = media.currentTime;
|
9159
9164
|
} else if (this.nextLoadPosition >= 0) {
|
9160
9165
|
pos = this.nextLoadPosition;
|
@@ -9808,7 +9813,7 @@ var eventemitter3 = {exports: {}};
|
|
9808
9813
|
var eventemitter3Exports = eventemitter3.exports;
|
9809
9814
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
9810
9815
|
|
9811
|
-
const version = "1.6.0-beta.1.0.canary.
|
9816
|
+
const version = "1.6.0-beta.1.0.canary.10791";
|
9812
9817
|
|
9813
9818
|
// ensure the worker ends up in the bundle
|
9814
9819
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -16878,7 +16883,6 @@ class BasePlaylistController extends Logger {
|
|
16878
16883
|
super(logPrefix, hls.logger);
|
16879
16884
|
this.hls = void 0;
|
16880
16885
|
this.timer = -1;
|
16881
|
-
this.requestScheduled = -1;
|
16882
16886
|
this.canLoad = false;
|
16883
16887
|
this.hls = hls;
|
16884
16888
|
}
|
@@ -16895,7 +16899,6 @@ class BasePlaylistController extends Logger {
|
|
16895
16899
|
}
|
16896
16900
|
startLoad() {
|
16897
16901
|
this.canLoad = true;
|
16898
|
-
this.requestScheduled = -1;
|
16899
16902
|
this.loadPlaylist();
|
16900
16903
|
}
|
16901
16904
|
stopLoad() {
|
@@ -16940,16 +16943,25 @@ class BasePlaylistController extends Logger {
|
|
16940
16943
|
}
|
16941
16944
|
}
|
16942
16945
|
loadPlaylist(hlsUrlParameters) {
|
16943
|
-
if (this.requestScheduled === -1) {
|
16944
|
-
this.requestScheduled = self.performance.now();
|
16945
|
-
}
|
16946
16946
|
// Loading is handled by the subclasses
|
16947
|
+
this.clearTimer();
|
16948
|
+
}
|
16949
|
+
loadingPlaylist(playlist, hlsUrlParameters) {
|
16950
|
+
// Loading is handled by the subclasses
|
16951
|
+
this.clearTimer();
|
16947
16952
|
}
|
16948
16953
|
shouldLoadPlaylist(playlist) {
|
16949
16954
|
return this.canLoad && !!playlist && !!playlist.url && (!playlist.details || playlist.details.live);
|
16950
16955
|
}
|
16951
|
-
|
16952
|
-
|
16956
|
+
getUrlWithDirectives(uri, hlsUrlParameters) {
|
16957
|
+
if (hlsUrlParameters) {
|
16958
|
+
try {
|
16959
|
+
return hlsUrlParameters.addDirectives(uri);
|
16960
|
+
} catch (error) {
|
16961
|
+
this.warn(`Could not construct new URL with HLS Delivery Directives: ${error}`);
|
16962
|
+
}
|
16963
|
+
}
|
16964
|
+
return uri;
|
16953
16965
|
}
|
16954
16966
|
playlistLoaded(index, data, previousDetails) {
|
16955
16967
|
const {
|
@@ -16974,10 +16986,9 @@ class BasePlaylistController extends Logger {
|
|
16974
16986
|
|
16975
16987
|
// if current playlist is a live playlist, arm a timer to reload it
|
16976
16988
|
if (details.live || previousDetails != null && previousDetails.live) {
|
16989
|
+
const levelOrTrack = 'levelInfo' in data ? data.levelInfo : data.track;
|
16977
16990
|
details.reloaded(previousDetails);
|
16978
|
-
|
16979
|
-
this.log(`live playlist ${index} ${details.advanced ? 'REFRESHED ' + details.lastPartSn + '-' + details.lastPartIndex : details.updated ? 'UPDATED' : 'MISSED'}`);
|
16980
|
-
}
|
16991
|
+
this.log(`live playlist ${index} ${details.advanced ? 'REFRESHED ' + details.lastPartSn + '-' + details.lastPartIndex : details.updated ? 'UPDATED' : 'MISSED'}`);
|
16981
16992
|
// Merge live playlists to adjust fragment starts and fill in delta playlist skipped segments
|
16982
16993
|
if (previousDetails && details.fragments.length > 0) {
|
16983
16994
|
mergeDetails(previousDetails, details);
|
@@ -17033,50 +17044,64 @@ class BasePlaylistController extends Logger {
|
|
17033
17044
|
}
|
17034
17045
|
deliveryDirectives = this.getDeliveryDirectives(details, data.deliveryDirectives, msn, part);
|
17035
17046
|
if (lowLatencyMode || !lastPart) {
|
17036
|
-
this.
|
17047
|
+
this.loadingPlaylist(levelOrTrack, deliveryDirectives);
|
17037
17048
|
return;
|
17038
17049
|
}
|
17039
17050
|
} else if (details.canBlockReload || details.canSkipUntil) {
|
17040
17051
|
deliveryDirectives = this.getDeliveryDirectives(details, data.deliveryDirectives, msn, part);
|
17041
17052
|
}
|
17053
|
+
if (details.requestScheduled === -1) {
|
17054
|
+
details.requestScheduled = stats.loading.start;
|
17055
|
+
}
|
17056
|
+
if (deliveryDirectives && msn !== undefined && details.canBlockReload) {
|
17057
|
+
details.requestScheduled -= details.partTarget * 1000 || 1000;
|
17058
|
+
}
|
17042
17059
|
const bufferInfo = this.hls.mainForwardBufferInfo;
|
17043
17060
|
const position = bufferInfo ? bufferInfo.end - bufferInfo.len : 0;
|
17044
17061
|
const distanceToLiveEdgeMs = (details.edge - position) * 1000;
|
17045
17062
|
const reloadInterval = computeReloadInterval(details, distanceToLiveEdgeMs);
|
17046
|
-
if (details.
|
17047
|
-
|
17048
|
-
}
|
17049
|
-
|
17050
|
-
|
17051
|
-
|
17052
|
-
this.requestScheduled = now;
|
17053
|
-
} else if (this.requestScheduled - now <= 0) {
|
17054
|
-
this.requestScheduled += reloadInterval;
|
17055
|
-
}
|
17056
|
-
let estimatedTimeUntilUpdate = this.requestScheduled - now;
|
17057
|
-
estimatedTimeUntilUpdate = Math.max(0, estimatedTimeUntilUpdate);
|
17058
|
-
this.log(`reload live playlist ${index} in ${Math.round(estimatedTimeUntilUpdate)} ms`);
|
17059
|
-
// this.log(
|
17060
|
-
// `live reload ${details.updated ? 'REFRESHED' : 'MISSED'}
|
17061
|
-
// reload in ${estimatedTimeUntilUpdate / 1000}
|
17062
|
-
// round trip ${(stats.loading.end - stats.loading.start) / 1000}
|
17063
|
-
// diff ${
|
17064
|
-
// (reloadInterval -
|
17065
|
-
// (estimatedTimeUntilUpdate +
|
17066
|
-
// stats.loading.end -
|
17067
|
-
// stats.loading.start)) /
|
17068
|
-
// 1000
|
17069
|
-
// }
|
17070
|
-
// reload interval ${reloadInterval / 1000}
|
17071
|
-
// target duration ${details.targetduration}
|
17072
|
-
// distance to edge ${distanceToLiveEdgeMs / 1000}`
|
17073
|
-
// );
|
17074
|
-
|
17075
|
-
this.timer = self.setTimeout(() => this.loadPlaylist(deliveryDirectives), estimatedTimeUntilUpdate);
|
17063
|
+
if (details.requestScheduled + reloadInterval < now) {
|
17064
|
+
details.requestScheduled = now;
|
17065
|
+
} else {
|
17066
|
+
details.requestScheduled += reloadInterval;
|
17067
|
+
}
|
17068
|
+
this.scheduleLoading(levelOrTrack, deliveryDirectives);
|
17076
17069
|
} else {
|
17077
17070
|
this.clearTimer();
|
17078
17071
|
}
|
17079
17072
|
}
|
17073
|
+
scheduleLoading(levelOrTrack, deliveryDirectives) {
|
17074
|
+
const details = levelOrTrack.details;
|
17075
|
+
if (!details) {
|
17076
|
+
this.loadingPlaylist(levelOrTrack, deliveryDirectives);
|
17077
|
+
return;
|
17078
|
+
}
|
17079
|
+
const now = self.performance.now();
|
17080
|
+
const requestScheduled = details.requestScheduled;
|
17081
|
+
if (now >= requestScheduled) {
|
17082
|
+
this.loadingPlaylist(levelOrTrack, deliveryDirectives);
|
17083
|
+
return;
|
17084
|
+
}
|
17085
|
+
const estimatedTimeUntilUpdate = requestScheduled - now;
|
17086
|
+
this.log(`reload live playlist ${levelOrTrack.name || levelOrTrack.bitrate + 'bps'} in ${Math.round(estimatedTimeUntilUpdate)} ms`);
|
17087
|
+
// this.log(
|
17088
|
+
// `live reload ${details.updated ? 'REFRESHED' : 'MISSED'}
|
17089
|
+
// reload in ${estimatedTimeUntilUpdate / 1000}
|
17090
|
+
// round trip ${(stats.loading.end - stats.loading.start) / 1000}
|
17091
|
+
// diff ${
|
17092
|
+
// (reloadInterval -
|
17093
|
+
// (estimatedTimeUntilUpdate +
|
17094
|
+
// stats.loading.end -
|
17095
|
+
// stats.loading.start)) /
|
17096
|
+
// 1000
|
17097
|
+
// }
|
17098
|
+
// reload interval ${reloadInterval / 1000}
|
17099
|
+
// target duration ${details.targetduration}
|
17100
|
+
// distance to edge ${distanceToLiveEdgeMs / 1000}`
|
17101
|
+
// );
|
17102
|
+
|
17103
|
+
this.timer = self.setTimeout(() => this.loadingPlaylist(levelOrTrack, deliveryDirectives), estimatedTimeUntilUpdate);
|
17104
|
+
}
|
17080
17105
|
getDeliveryDirectives(details, previousDeliveryDirectives, msn, part) {
|
17081
17106
|
let skip = getSkipValue(details);
|
17082
17107
|
if (previousDeliveryDirectives != null && previousDeliveryDirectives.skip && details.deltaUpdateFailed) {
|
@@ -17098,7 +17123,6 @@ class BasePlaylistController extends Logger {
|
|
17098
17123
|
const retry = !!errorAction && !!retryConfig && (action === NetworkErrorAction.RetryRequest || !errorAction.resolved && action === NetworkErrorAction.SendAlternateToPenaltyBox);
|
17099
17124
|
if (retry) {
|
17100
17125
|
var _errorEvent$context;
|
17101
|
-
this.requestScheduled = -1;
|
17102
17126
|
if (retryCount >= retryConfig.maxNumRetry) {
|
17103
17127
|
return false;
|
17104
17128
|
}
|
@@ -17261,9 +17285,6 @@ class AudioTrackController extends BasePlaylistController {
|
|
17261
17285
|
error
|
17262
17286
|
});
|
17263
17287
|
}
|
17264
|
-
} else if (this.shouldReloadPlaylist(currentTrack)) {
|
17265
|
-
// Retry playlist loading if no playlist is or has been loaded yet
|
17266
|
-
this.setAudioTrack(this.trackId);
|
17267
17288
|
}
|
17268
17289
|
}
|
17269
17290
|
onError(event, data) {
|
@@ -17271,7 +17292,6 @@ class AudioTrackController extends BasePlaylistController {
|
|
17271
17292
|
return;
|
17272
17293
|
}
|
17273
17294
|
if (data.context.type === PlaylistContextType.AUDIO_TRACK && data.context.id === this.trackId && (!this.groupIds || this.groupIds.indexOf(data.context.groupId) !== -1)) {
|
17274
|
-
this.requestScheduled = -1;
|
17275
17295
|
this.checkRetry(data);
|
17276
17296
|
}
|
17277
17297
|
}
|
@@ -17341,9 +17361,6 @@ class AudioTrackController extends BasePlaylistController {
|
|
17341
17361
|
this.warn(`Invalid audio track id: ${newId}`);
|
17342
17362
|
return;
|
17343
17363
|
}
|
17344
|
-
|
17345
|
-
// stopping live reloading timer if any
|
17346
|
-
this.clearTimer();
|
17347
17364
|
this.selectDefaultTrack = false;
|
17348
17365
|
const lastTrack = this.currentTrack;
|
17349
17366
|
const track = tracks[newId];
|
@@ -17412,35 +17429,32 @@ class AudioTrackController extends BasePlaylistController {
|
|
17412
17429
|
}
|
17413
17430
|
loadPlaylist(hlsUrlParameters) {
|
17414
17431
|
var _this$hls$levels$this;
|
17432
|
+
super.loadPlaylist();
|
17415
17433
|
const audioTrack = this.currentTrack;
|
17416
|
-
if (!audioTrack) {
|
17434
|
+
if (!this.shouldLoadPlaylist(audioTrack)) {
|
17417
17435
|
return;
|
17418
17436
|
}
|
17419
|
-
|
17420
|
-
|
17421
|
-
|
17422
|
-
const id = audioTrack.id;
|
17423
|
-
const groupId = audioTrack.groupId;
|
17424
|
-
if (hlsUrlParameters) {
|
17425
|
-
try {
|
17426
|
-
url = hlsUrlParameters.addDirectives(url);
|
17427
|
-
} catch (error) {
|
17428
|
-
this.warn(`Could not construct new URL with HLS Delivery Directives: ${error}`);
|
17429
|
-
}
|
17430
|
-
}
|
17431
|
-
// track not retrieved yet, or live playlist we need to (re)load it
|
17432
|
-
const details = audioTrack.details;
|
17433
|
-
const age = details == null ? void 0 : details.age;
|
17434
|
-
this.log(`Loading audio-track ${id} "${audioTrack.name}" lang:${audioTrack.lang} group:${groupId}${(hlsUrlParameters == null ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
|
17435
|
-
this.clearTimer();
|
17436
|
-
this.hls.trigger(Events.AUDIO_TRACK_LOADING, {
|
17437
|
-
url,
|
17438
|
-
id,
|
17439
|
-
groupId,
|
17440
|
-
deliveryDirectives: hlsUrlParameters || null,
|
17441
|
-
track: audioTrack
|
17442
|
-
});
|
17437
|
+
if (audioTrack.url === ((_this$hls$levels$this = this.hls.levels[this.hls.loadLevel]) == null ? void 0 : _this$hls$levels$this.uri)) {
|
17438
|
+
// Do not load audio rendition with URI matching main variant URI
|
17439
|
+
return;
|
17443
17440
|
}
|
17441
|
+
this.scheduleLoading(audioTrack, hlsUrlParameters);
|
17442
|
+
}
|
17443
|
+
loadingPlaylist(audioTrack, hlsUrlParameters) {
|
17444
|
+
super.loadingPlaylist(audioTrack, hlsUrlParameters);
|
17445
|
+
const id = audioTrack.id;
|
17446
|
+
const groupId = audioTrack.groupId;
|
17447
|
+
const url = this.getUrlWithDirectives(audioTrack.url, hlsUrlParameters);
|
17448
|
+
const details = audioTrack.details;
|
17449
|
+
const age = details == null ? void 0 : details.age;
|
17450
|
+
this.log(`Loading audio-track ${id} "${audioTrack.name}" lang:${audioTrack.lang} group:${groupId}${(hlsUrlParameters == null ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
|
17451
|
+
this.hls.trigger(Events.AUDIO_TRACK_LOADING, {
|
17452
|
+
url,
|
17453
|
+
id,
|
17454
|
+
groupId,
|
17455
|
+
deliveryDirectives: hlsUrlParameters || null,
|
17456
|
+
track: audioTrack
|
17457
|
+
});
|
17444
17458
|
}
|
17445
17459
|
}
|
17446
17460
|
|
@@ -22380,9 +22394,6 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22380
22394
|
if (trackId !== -1 && this.trackId === -1) {
|
22381
22395
|
this.setSubtitleTrack(trackId);
|
22382
22396
|
}
|
22383
|
-
} else if (this.shouldReloadPlaylist(currentTrack)) {
|
22384
|
-
// Retry playlist loading if no playlist is or has been loaded yet
|
22385
|
-
this.setSubtitleTrack(this.trackId);
|
22386
22397
|
}
|
22387
22398
|
}
|
22388
22399
|
findTrackId(currentTrack) {
|
@@ -22488,29 +22499,25 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22488
22499
|
}
|
22489
22500
|
loadPlaylist(hlsUrlParameters) {
|
22490
22501
|
super.loadPlaylist();
|
22491
|
-
|
22492
|
-
|
22493
|
-
|
22494
|
-
|
22495
|
-
|
22496
|
-
|
22497
|
-
|
22498
|
-
|
22499
|
-
|
22500
|
-
|
22501
|
-
|
22502
|
-
|
22503
|
-
|
22504
|
-
|
22505
|
-
|
22506
|
-
|
22507
|
-
|
22508
|
-
|
22509
|
-
|
22510
|
-
deliveryDirectives: hlsUrlParameters || null,
|
22511
|
-
track: currentTrack
|
22512
|
-
});
|
22513
|
-
}
|
22502
|
+
if (this.shouldLoadPlaylist(this.currentTrack)) {
|
22503
|
+
this.scheduleLoading(this.currentTrack, hlsUrlParameters);
|
22504
|
+
}
|
22505
|
+
}
|
22506
|
+
loadingPlaylist(currentTrack, hlsUrlParameters) {
|
22507
|
+
super.loadingPlaylist(currentTrack, hlsUrlParameters);
|
22508
|
+
const id = currentTrack.id;
|
22509
|
+
const groupId = currentTrack.groupId;
|
22510
|
+
const url = this.getUrlWithDirectives(currentTrack.url, hlsUrlParameters);
|
22511
|
+
const details = currentTrack.details;
|
22512
|
+
const age = details == null ? void 0 : details.age;
|
22513
|
+
this.log(`Loading subtitle ${id} "${currentTrack.name}" lang:${currentTrack.lang} group:${groupId}${(hlsUrlParameters == null ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
|
22514
|
+
this.hls.trigger(Events.SUBTITLE_TRACK_LOADING, {
|
22515
|
+
url,
|
22516
|
+
id,
|
22517
|
+
groupId,
|
22518
|
+
deliveryDirectives: hlsUrlParameters || null,
|
22519
|
+
track: currentTrack
|
22520
|
+
});
|
22514
22521
|
}
|
22515
22522
|
|
22516
22523
|
/**
|
@@ -22568,9 +22575,6 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
22568
22575
|
this.warn(`Invalid subtitle track id: ${newId}`);
|
22569
22576
|
return;
|
22570
22577
|
}
|
22571
|
-
|
22572
|
-
// stopping live reloading timer if any
|
22573
|
-
this.clearTimer();
|
22574
22578
|
this.selectDefaultTrack = false;
|
22575
22579
|
const lastTrack = this.currentTrack;
|
22576
22580
|
const track = tracks[newId] || null;
|
@@ -30463,9 +30467,7 @@ class LevelController extends BasePlaylistController {
|
|
30463
30467
|
this.currentLevelIndex = newLevel;
|
30464
30468
|
this.currentLevel = level;
|
30465
30469
|
if (lastLevelIndex === newLevel && lastLevel && lastPathwayId === pathwayId) {
|
30466
|
-
|
30467
|
-
return;
|
30468
|
-
}
|
30470
|
+
return;
|
30469
30471
|
}
|
30470
30472
|
this.log(`Switching to level ${newLevel} (${level.height ? level.height + 'p ' : ''}${level.videoRange ? level.videoRange + ' ' : ''}${level.codecSet ? level.codecSet + ' ' : ''}@${level.bitrate})${pathwayId ? ' with Pathway ' + pathwayId : ''} from level ${lastLevelIndex}${lastPathwayId ? ' with Pathway ' + lastPathwayId : ''}`);
|
30471
30473
|
const levelSwitchingData = {
|
@@ -30559,10 +30561,7 @@ class LevelController extends BasePlaylistController {
|
|
30559
30561
|
return;
|
30560
30562
|
}
|
30561
30563
|
if (data.context.type === PlaylistContextType.LEVEL && data.context.level === this.level) {
|
30562
|
-
|
30563
|
-
if (!retry) {
|
30564
|
-
this.requestScheduled = -1;
|
30565
|
-
}
|
30564
|
+
this.checkRetry(data);
|
30566
30565
|
}
|
30567
30566
|
}
|
30568
30567
|
|
@@ -30617,36 +30616,28 @@ class LevelController extends BasePlaylistController {
|
|
30617
30616
|
}
|
30618
30617
|
loadPlaylist(hlsUrlParameters) {
|
30619
30618
|
super.loadPlaylist();
|
30620
|
-
|
30621
|
-
|
30622
|
-
if (currentLevel && this.shouldLoadPlaylist(currentLevel)) {
|
30623
|
-
let url = currentLevel.uri;
|
30624
|
-
if (hlsUrlParameters) {
|
30625
|
-
try {
|
30626
|
-
url = hlsUrlParameters.addDirectives(url);
|
30627
|
-
} catch (error) {
|
30628
|
-
this.warn(`Could not construct new URL with HLS Delivery Directives: ${error}`);
|
30629
|
-
}
|
30630
|
-
}
|
30631
|
-
const pathwayId = currentLevel.attrs['PATHWAY-ID'];
|
30632
|
-
const details = currentLevel.details;
|
30633
|
-
const age = details == null ? void 0 : details.age;
|
30634
|
-
this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters == null ? void 0 : 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}`);
|
30635
|
-
|
30636
|
-
// console.log('Current audio track group ID:', this.hls.audioTracks[this.hls.audioTrack].groupId);
|
30637
|
-
// console.log('New video quality level audio group id:', levelObject.attrs.AUDIO, level);
|
30638
|
-
this.clearTimer();
|
30639
|
-
this.hls.trigger(Events.LEVEL_LOADING, {
|
30640
|
-
url,
|
30641
|
-
level: currentLevelIndex,
|
30642
|
-
levelInfo: currentLevel,
|
30643
|
-
pathwayId: currentLevel.attrs['PATHWAY-ID'],
|
30644
|
-
id: 0,
|
30645
|
-
// Deprecated Level urlId
|
30646
|
-
deliveryDirectives: hlsUrlParameters || null
|
30647
|
-
});
|
30619
|
+
if (this.shouldLoadPlaylist(this.currentLevel)) {
|
30620
|
+
this.scheduleLoading(this.currentLevel, hlsUrlParameters);
|
30648
30621
|
}
|
30649
30622
|
}
|
30623
|
+
loadingPlaylist(currentLevel, hlsUrlParameters) {
|
30624
|
+
super.loadingPlaylist(currentLevel, hlsUrlParameters);
|
30625
|
+
const url = this.getUrlWithDirectives(currentLevel.uri, hlsUrlParameters);
|
30626
|
+
const currentLevelIndex = this.currentLevelIndex;
|
30627
|
+
const pathwayId = currentLevel.attrs['PATHWAY-ID'];
|
30628
|
+
const details = currentLevel.details;
|
30629
|
+
const age = details == null ? void 0 : details.age;
|
30630
|
+
this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters == null ? void 0 : 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}`);
|
30631
|
+
this.hls.trigger(Events.LEVEL_LOADING, {
|
30632
|
+
url,
|
30633
|
+
level: currentLevelIndex,
|
30634
|
+
levelInfo: currentLevel,
|
30635
|
+
pathwayId: currentLevel.attrs['PATHWAY-ID'],
|
30636
|
+
id: 0,
|
30637
|
+
// Deprecated Level urlId
|
30638
|
+
deliveryDirectives: hlsUrlParameters || null
|
30639
|
+
});
|
30640
|
+
}
|
30650
30641
|
get nextLoadLevel() {
|
30651
30642
|
if (this.manualLevelIndex !== -1) {
|
30652
30643
|
return this.manualLevelIndex;
|