hls.js 1.5.9-0.canary.10265 → 1.5.9-0.canary.10268
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 +11 -7
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +11 -7
- 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 +11 -7
- 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 +11 -7
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +2 -2
- package/src/controller/base-stream-controller.ts +16 -5
package/dist/hls.light.mjs
CHANGED
@@ -512,7 +512,7 @@ function enableLogs(debugConfig, context, id) {
|
|
512
512
|
// Some browsers don't allow to use bind on console object anyway
|
513
513
|
// fallback to default if needed
|
514
514
|
try {
|
515
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.9-0.canary.
|
515
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.9-0.canary.10268"}`);
|
516
516
|
} catch (e) {
|
517
517
|
/* log fn threw an exception. All logger methods are no-ops. */
|
518
518
|
return createLogger();
|
@@ -12492,11 +12492,14 @@ class BaseStreamController extends TaskLoop {
|
|
12492
12492
|
} = this;
|
12493
12493
|
const fragState = fragmentTracker.getState(frag);
|
12494
12494
|
if (fragState === FragmentState.APPENDING) {
|
12495
|
-
// Lower the buffer
|
12495
|
+
// Lower the max buffer length and try again
|
12496
12496
|
const playlistType = frag.type;
|
12497
12497
|
const bufferedInfo = this.getFwdBufferInfo(this.mediaBuffer, playlistType);
|
12498
12498
|
const minForwardBufferLength = Math.max(frag.duration, bufferedInfo ? bufferedInfo.len : this.config.maxBufferLength);
|
12499
|
-
|
12499
|
+
// If backtracking, always remove from the tracker without reducing max buffer length
|
12500
|
+
const backtrackFragment = this.backtrackFragment;
|
12501
|
+
const backtracked = backtrackFragment ? frag.sn - backtrackFragment.sn : 0;
|
12502
|
+
if (backtracked === 1 || this.reduceMaxBufferLength(minForwardBufferLength)) {
|
12500
12503
|
fragmentTracker.removeFragment(frag);
|
12501
12504
|
}
|
12502
12505
|
} else if (((_this$mediaBuffer = this.mediaBuffer) == null ? void 0 : _this$mediaBuffer.buffered.length) === 0) {
|
@@ -13000,10 +13003,11 @@ class BaseStreamController extends TaskLoop {
|
|
13000
13003
|
reduceMaxBufferLength(threshold) {
|
13001
13004
|
const config = this.config;
|
13002
13005
|
const minLength = threshold || config.maxBufferLength;
|
13003
|
-
|
13006
|
+
const reducedLength = config.maxMaxBufferLength / 2;
|
13007
|
+
if (reducedLength >= minLength) {
|
13004
13008
|
// reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
|
13005
|
-
config.maxMaxBufferLength
|
13006
|
-
this.warn(`Reduce max buffer length to ${
|
13009
|
+
config.maxMaxBufferLength = reducedLength;
|
13010
|
+
this.warn(`Reduce max buffer length to ${reducedLength}s`);
|
13007
13011
|
return true;
|
13008
13012
|
}
|
13009
13013
|
return false;
|
@@ -20376,7 +20380,7 @@ class Hls {
|
|
20376
20380
|
* Get the video-dev/hls.js package version.
|
20377
20381
|
*/
|
20378
20382
|
static get version() {
|
20379
|
-
return "1.5.9-0.canary.
|
20383
|
+
return "1.5.9-0.canary.10268";
|
20380
20384
|
}
|
20381
20385
|
|
20382
20386
|
/**
|