hls.js 1.5.12-0.canary.10397 → 1.5.12-0.canary.10399
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 +21 -11
- package/dist/hls.js.d.ts +2 -1
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +21 -11
- 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 +21 -11
- 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 +21 -11
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/base-stream-controller.ts +15 -8
- package/src/controller/latency-controller.ts +8 -0
- package/src/hls.ts +4 -0
@@ -18,6 +18,7 @@ export default class LatencyController implements ComponentAPI {
|
|
18
18
|
private currentTime: number = 0;
|
19
19
|
private stallCount: number = 0;
|
20
20
|
private _latency: number | null = null;
|
21
|
+
private _targetLatencyUpdated = false;
|
21
22
|
|
22
23
|
constructor(hls: Hls) {
|
23
24
|
this.hls = hls;
|
@@ -50,6 +51,7 @@ export default class LatencyController implements ComponentAPI {
|
|
50
51
|
const userConfig = this.hls.userConfig;
|
51
52
|
let targetLatency = lowLatencyMode ? partHoldBack || holdBack : holdBack;
|
52
53
|
if (
|
54
|
+
this._targetLatencyUpdated ||
|
53
55
|
userConfig.liveSyncDuration ||
|
54
56
|
userConfig.liveSyncDurationCount ||
|
55
57
|
targetLatency === 0
|
@@ -69,6 +71,12 @@ export default class LatencyController implements ComponentAPI {
|
|
69
71
|
);
|
70
72
|
}
|
71
73
|
|
74
|
+
set targetLatency(latency: number) {
|
75
|
+
this.stallCount = 0;
|
76
|
+
this.config.liveSyncDuration = latency;
|
77
|
+
this._targetLatencyUpdated = true;
|
78
|
+
}
|
79
|
+
|
72
80
|
get liveSyncPosition(): number | null {
|
73
81
|
const liveEdge = this.estimateLiveEdge();
|
74
82
|
const targetLatency = this.targetLatency;
|
package/src/hls.ts
CHANGED
@@ -969,6 +969,10 @@ export default class Hls implements HlsEventEmitter {
|
|
969
969
|
return this.latencyController.targetLatency;
|
970
970
|
}
|
971
971
|
|
972
|
+
set targetLatency(latency: number) {
|
973
|
+
this.latencyController.targetLatency = latency;
|
974
|
+
}
|
975
|
+
|
972
976
|
/**
|
973
977
|
* the rate at which the edge of the current live playlist is advancing or 1 if there is none
|
974
978
|
*/
|