hls.js 1.5.6-0.canary.9999 → 1.5.7-0.canary.10014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hls.js +29 -20
- package/dist/hls.js.d.ts +1 -0
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +26 -20
- 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 +26 -22
- 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 +29 -22
- 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 +4 -4
- package/src/controller/abr-controller.ts +20 -10
- package/src/controller/stream-controller.ts +3 -3
- package/src/utils/mp4-tools.ts +6 -4
package/dist/hls.light.js
CHANGED
@@ -613,7 +613,7 @@
|
|
613
613
|
// Some browsers don't allow to use bind on console object anyway
|
614
614
|
// fallback to default if needed
|
615
615
|
try {
|
616
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.
|
616
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.7-0.canary.10014");
|
617
617
|
} catch (e) {
|
618
618
|
/* log fn threw an exception. All logger methods are no-ops. */
|
619
619
|
return createLogger();
|
@@ -1674,11 +1674,13 @@
|
|
1674
1674
|
var earliestPresentationTime = 0;
|
1675
1675
|
var firstOffset = 0;
|
1676
1676
|
if (version === 0) {
|
1677
|
-
earliestPresentationTime = readUint32(sidx, index
|
1678
|
-
firstOffset = readUint32(sidx, index
|
1677
|
+
earliestPresentationTime = readUint32(sidx, index);
|
1678
|
+
firstOffset = readUint32(sidx, index + 4);
|
1679
|
+
index += 8;
|
1679
1680
|
} else {
|
1680
|
-
earliestPresentationTime = readUint64(sidx, index
|
1681
|
-
firstOffset = readUint64(sidx, index
|
1681
|
+
earliestPresentationTime = readUint64(sidx, index);
|
1682
|
+
firstOffset = readUint64(sidx, index + 8);
|
1683
|
+
index += 16;
|
1682
1684
|
}
|
1683
1685
|
|
1684
1686
|
// skip reserved
|
@@ -6803,8 +6805,7 @@
|
|
6803
6805
|
}
|
6804
6806
|
};
|
6805
6807
|
_proto.getAutoLevelKey = function getAutoLevelKey() {
|
6806
|
-
|
6807
|
-
return this.getBwEstimate() + "_" + ((_this$hls$mainForward = this.hls.mainForwardBufferInfo) == null ? void 0 : _this$hls$mainForward.len);
|
6808
|
+
return this.getBwEstimate() + "_" + this.getStarvationDelay().toFixed(2);
|
6808
6809
|
};
|
6809
6810
|
_proto.getNextABRAutoLevel = function getNextABRAutoLevel() {
|
6810
6811
|
var fragCurrent = this.fragCurrent,
|
@@ -6812,17 +6813,11 @@
|
|
6812
6813
|
hls = this.hls;
|
6813
6814
|
var maxAutoLevel = hls.maxAutoLevel,
|
6814
6815
|
config = hls.config,
|
6815
|
-
minAutoLevel = hls.minAutoLevel
|
6816
|
-
media = hls.media;
|
6816
|
+
minAutoLevel = hls.minAutoLevel;
|
6817
6817
|
var currentFragDuration = partCurrent ? partCurrent.duration : fragCurrent ? fragCurrent.duration : 0;
|
6818
|
-
|
6819
|
-
// playbackRate is the absolute value of the playback rate; if media.playbackRate is 0, we use 1 to load as
|
6820
|
-
// if we're playing back at the normal rate.
|
6821
|
-
var playbackRate = media && media.playbackRate !== 0 ? Math.abs(media.playbackRate) : 1.0;
|
6822
6818
|
var avgbw = this.getBwEstimate();
|
6823
6819
|
// bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.
|
6824
|
-
var
|
6825
|
-
var bufferStarvationDelay = (bufferInfo ? bufferInfo.len : 0) / playbackRate;
|
6820
|
+
var bufferStarvationDelay = this.getStarvationDelay();
|
6826
6821
|
var bwFactor = config.abrBandWidthFactor;
|
6827
6822
|
var bwUpFactor = config.abrBandWidthUpFactor;
|
6828
6823
|
|
@@ -6865,6 +6860,18 @@
|
|
6865
6860
|
// or if bitrate is not lower, continue to use loadLevel
|
6866
6861
|
return hls.loadLevel;
|
6867
6862
|
};
|
6863
|
+
_proto.getStarvationDelay = function getStarvationDelay() {
|
6864
|
+
var hls = this.hls;
|
6865
|
+
var media = hls.media;
|
6866
|
+
if (!media) {
|
6867
|
+
return Infinity;
|
6868
|
+
}
|
6869
|
+
// playbackRate is the absolute value of the playback rate; if media.playbackRate is 0, we use 1 to load as
|
6870
|
+
// if we're playing back at the normal rate.
|
6871
|
+
var playbackRate = media && media.playbackRate !== 0 ? Math.abs(media.playbackRate) : 1.0;
|
6872
|
+
var bufferInfo = hls.mainForwardBufferInfo;
|
6873
|
+
return (bufferInfo ? bufferInfo.len : 0) / playbackRate;
|
6874
|
+
};
|
6868
6875
|
_proto.getBwEstimate = function getBwEstimate() {
|
6869
6876
|
return this.bwEstimator.canEstimate() ? this.bwEstimator.getEstimate() : this.hls.config.abrEwmaDefaultEstimate;
|
6870
6877
|
};
|
@@ -19513,13 +19520,11 @@
|
|
19513
19520
|
levelLastLoaded = this.levelLastLoaded,
|
19514
19521
|
levels = this.levels,
|
19515
19522
|
media = this.media;
|
19516
|
-
var config = hls.config,
|
19517
|
-
level = hls.nextLoadLevel;
|
19518
19523
|
|
19519
19524
|
// if start level not parsed yet OR
|
19520
19525
|
// if video not attached AND start fragment already requested OR start frag prefetch not enabled
|
19521
19526
|
// exit loop, as we either need more info (level not parsed) or we need media to be attached to load new fragment
|
19522
|
-
if (levelLastLoaded === null || !media && (this.startFragRequested || !config.startFragPrefetch)) {
|
19527
|
+
if (levelLastLoaded === null || !media && (this.startFragRequested || !hls.config.startFragPrefetch)) {
|
19523
19528
|
return;
|
19524
19529
|
}
|
19525
19530
|
|
@@ -19527,7 +19532,8 @@
|
|
19527
19532
|
if (this.altAudio && this.audioOnly) {
|
19528
19533
|
return;
|
19529
19534
|
}
|
19530
|
-
|
19535
|
+
var level = hls.nextLoadLevel;
|
19536
|
+
if (!(levels != null && levels[level])) {
|
19531
19537
|
return;
|
19532
19538
|
}
|
19533
19539
|
var levelInfo = levels[level];
|
@@ -21325,7 +21331,7 @@
|
|
21325
21331
|
* Get the video-dev/hls.js package version.
|
21326
21332
|
*/
|
21327
21333
|
function get() {
|
21328
|
-
return "1.5.
|
21334
|
+
return "1.5.7-0.canary.10014";
|
21329
21335
|
}
|
21330
21336
|
}, {
|
21331
21337
|
key: "Events",
|