@clappr/hlsjs-playback 1.8.2 → 1.8.5
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/hlsjs-playback.esm.js +37 -11
- package/dist/hlsjs-playback.external.js +37 -11
- package/dist/hlsjs-playback.external.min.js +1 -1
- package/dist/hlsjs-playback.external.min.js.map +1 -1
- package/dist/hlsjs-playback.js +37 -11
- package/dist/hlsjs-playback.min.js +1 -1
- package/dist/hlsjs-playback.min.js.map +1 -1
- package/package.json +3 -3
- package/src/hls.js +178 -114
- package/src/hls.test.js +59 -26
package/dist/hlsjs-playback.js
CHANGED
|
@@ -35491,7 +35491,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35491
35491
|
key: "supportedVersion",
|
|
35492
35492
|
get: function get() {
|
|
35493
35493
|
return {
|
|
35494
|
-
min: "0.
|
|
35494
|
+
min: "0.13.0"
|
|
35495
35495
|
};
|
|
35496
35496
|
}
|
|
35497
35497
|
}, {
|
|
@@ -35502,12 +35502,20 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35502
35502
|
}, {
|
|
35503
35503
|
key: "currentLevel",
|
|
35504
35504
|
get: function get() {
|
|
35505
|
-
if (this._currentLevel === null || this._currentLevel === undefined)
|
|
35505
|
+
if (this._currentLevel === null || this._currentLevel === undefined) {
|
|
35506
|
+
return AUTO;
|
|
35507
|
+
} else {
|
|
35508
|
+
return this._currentLevel;
|
|
35509
|
+
} // 0 is a valid level ID
|
|
35506
35510
|
},
|
|
35507
35511
|
set: function set(id) {
|
|
35508
35512
|
this._currentLevel = id;
|
|
35509
35513
|
this.trigger(core.Events.PLAYBACK_LEVEL_SWITCH_START);
|
|
35510
|
-
if (this.options.playback.hlsUseNextLevel)
|
|
35514
|
+
if (this.options.playback.hlsUseNextLevel) {
|
|
35515
|
+
this._hls.nextLevel = this._currentLevel;
|
|
35516
|
+
} else {
|
|
35517
|
+
this._hls.currentLevel = this._currentLevel;
|
|
35518
|
+
}
|
|
35511
35519
|
}
|
|
35512
35520
|
}, {
|
|
35513
35521
|
key: "isReady",
|
|
@@ -35532,7 +35540,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35532
35540
|
}, {
|
|
35533
35541
|
key: "_startTime",
|
|
35534
35542
|
get: function get() {
|
|
35535
|
-
if (this._playbackType === core.Playback.LIVE && this._playlistType !== 'EVENT')
|
|
35543
|
+
if (this._playbackType === core.Playback.LIVE && this._playlistType !== 'EVENT') {
|
|
35544
|
+
return this._extrapolatedStartTime;
|
|
35545
|
+
}
|
|
35536
35546
|
return this._playableRegionStartTime;
|
|
35537
35547
|
}
|
|
35538
35548
|
}, {
|
|
@@ -35546,7 +35556,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35546
35556
|
}, {
|
|
35547
35557
|
key: "_extrapolatedStartTime",
|
|
35548
35558
|
get: function get() {
|
|
35549
|
-
if (!this._localStartTimeCorrelation)
|
|
35559
|
+
if (!this._localStartTimeCorrelation) {
|
|
35560
|
+
return this._playableRegionStartTime;
|
|
35561
|
+
}
|
|
35550
35562
|
var corr = this._localStartTimeCorrelation;
|
|
35551
35563
|
var timePassed = this._now - corr.local;
|
|
35552
35564
|
var extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000;
|
|
@@ -35592,7 +35604,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35592
35604
|
}, {
|
|
35593
35605
|
key: "_extrapolatedWindowDuration",
|
|
35594
35606
|
get: function get() {
|
|
35595
|
-
if (this._segmentTargetDuration === null)
|
|
35607
|
+
if (this._segmentTargetDuration === null) {
|
|
35608
|
+
return 0;
|
|
35609
|
+
}
|
|
35596
35610
|
return this._extrapolatedWindowNumSegments * this._segmentTargetDuration;
|
|
35597
35611
|
}
|
|
35598
35612
|
}, {
|
|
@@ -35713,7 +35727,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35713
35727
|
_this2.options.hlsPlayback.preload && _this2._hls.loadSource(_this2.options.src);
|
|
35714
35728
|
});
|
|
35715
35729
|
this._hls.on(Hls.Events.MANIFEST_LOADING, function () {
|
|
35716
|
-
|
|
35730
|
+
_this2._manifestLoading = true;
|
|
35717
35731
|
});
|
|
35718
35732
|
this._hls.on(Hls.Events.LEVEL_LOADED, function (evt, data) {
|
|
35719
35733
|
return _this2._updatePlaybackType(evt, data);
|
|
@@ -35889,7 +35903,13 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
35889
35903
|
}, {
|
|
35890
35904
|
key: "_updateSettings",
|
|
35891
35905
|
value: function _updateSettings() {
|
|
35892
|
-
if (this._playbackType === core.Playback.VOD)
|
|
35906
|
+
if (this._playbackType === core.Playback.VOD) {
|
|
35907
|
+
this.settings.left = ['playpause', 'position', 'duration'];
|
|
35908
|
+
} else if (this.dvrEnabled) {
|
|
35909
|
+
this.settings.left = ['playpause'];
|
|
35910
|
+
} else {
|
|
35911
|
+
this.settings.left = ['playstop'];
|
|
35912
|
+
}
|
|
35893
35913
|
this.settings.seekEnabled = this.isSeekEnabled();
|
|
35894
35914
|
this.trigger(core.Events.PLAYBACK_SETTINGSUPDATE);
|
|
35895
35915
|
}
|
|
@@ -36036,7 +36056,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
36036
36056
|
start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),
|
|
36037
36057
|
end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)
|
|
36038
36058
|
}]);
|
|
36039
|
-
if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end)
|
|
36059
|
+
if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
|
|
36060
|
+
bufferedPos = i;
|
|
36061
|
+
}
|
|
36040
36062
|
}
|
|
36041
36063
|
var progress = {
|
|
36042
36064
|
start: buffered[bufferedPos].start,
|
|
@@ -36086,7 +36108,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
36086
36108
|
this._playbackType = data.details.live ? core.Playback.LIVE : core.Playback.VOD;
|
|
36087
36109
|
this._onLevelUpdated(evt, data);
|
|
36088
36110
|
// Live stream subtitle tracks detection hack (may not immediately available)
|
|
36089
|
-
if (this._ccTracksUpdated && this._playbackType === core.Playback.LIVE && this.hasClosedCaptionsTracks)
|
|
36111
|
+
if (this._ccTracksUpdated && this._playbackType === core.Playback.LIVE && this.hasClosedCaptionsTracks) {
|
|
36112
|
+
this._onSubtitleLoaded();
|
|
36113
|
+
}
|
|
36090
36114
|
}
|
|
36091
36115
|
}, {
|
|
36092
36116
|
key: "_fillLevels",
|
|
@@ -36112,7 +36136,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
|
|
|
36112
36136
|
var previousPlayableRegionDuration = this._playableRegionDuration;
|
|
36113
36137
|
if (fragments.length === 0) return;
|
|
36114
36138
|
// #EXT-X-PROGRAM-DATE-TIME
|
|
36115
|
-
if (fragments[0].rawProgramDateTime)
|
|
36139
|
+
if (fragments[0].rawProgramDateTime) {
|
|
36140
|
+
this._programDateTime = fragments[0].rawProgramDateTime;
|
|
36141
|
+
}
|
|
36116
36142
|
if (this._playableRegionStartTime !== fragments[0].start) {
|
|
36117
36143
|
startTimeChanged = true;
|
|
36118
36144
|
this._playableRegionStartTime = fragments[0].start;
|