@oddin-gg/havik-player 2.22.0 → 2.23.0
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/havik-player.global.js +2 -2
- package/dist/havik-player.global.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +376 -249
- package/dist/index.js.map +1 -1
- package/docs/API.md +99 -54
- package/embed/index.html +1 -1
- package/examples/vanilla.html +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -224,6 +224,33 @@ export declare interface CreatePlayerOptions {
|
|
|
224
224
|
* true` (hls.js's own poller) caps to the covering rung with no headroom.
|
|
225
225
|
*/
|
|
226
226
|
sizeCapHeadroom?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Adaptive live hold-back (hls.js engine): raise the live-sync target for a
|
|
229
|
+
* session whose part fetches are slow, instead of letting it stall. A
|
|
230
|
+
* viewer far from the origin plays from a local edge whose every cache
|
|
231
|
+
* miss on a 0.5 s part is a cross-continent fetch (250-310 ms per part on
|
|
232
|
+
* the global slot from South America, Canada/Mexico and APAC, against
|
|
233
|
+
* 44 ms in Europe, 2026-10-30), so the fetch cycle outruns the part
|
|
234
|
+
* cadence and the 2 s buffer drains: 3-13% rebuffer there against under
|
|
235
|
+
* 1% in the US and Europe. The engine times the session's own part
|
|
236
|
+
* fetches (first byte, as a share of the part's duration, over a 10 s
|
|
237
|
+
* window): a window whose p95 is at or above 60% AND whose median is at
|
|
238
|
+
* or above 40%, two 3 s ticks running, steps the target up 0.5 s, to
|
|
239
|
+
* `adaptiveHoldBackCeiling` at most; a p95 under 40% for 60 s steps it
|
|
240
|
+
* back down. A session whose fetches are fast never moves. Each
|
|
241
|
+
* move fires `latencytargetchange`, counts in `holdBackSteps`, and shows
|
|
242
|
+
* in `targetLatencySeconds` (and the heartbeat's target latency).
|
|
243
|
+
* Default: true. Live/LL only.
|
|
244
|
+
*/
|
|
245
|
+
adaptiveHoldBack?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Highest live-sync target the adaptive hold-back may step to, in seconds.
|
|
248
|
+
* Default: 3.5 (a far session that stalls drifts to ~6 s anyway, so a
|
|
249
|
+
* steady 3.5 s is the better trade for a latency-sensitive viewer). Kept
|
|
250
|
+
* under the drift ceiling; at or below `liveLatencyTarget` it disables the
|
|
251
|
+
* stepping.
|
|
252
|
+
*/
|
|
253
|
+
adaptiveHoldBackCeiling?: number;
|
|
227
254
|
/**
|
|
228
255
|
* DRM cold start: download the first init segment and parts while the
|
|
229
256
|
* first key is still being acquired, instead of after it (hls.js waits for
|
|
@@ -796,6 +823,28 @@ export declare interface LiveStateSubscription {
|
|
|
796
823
|
close(): void;
|
|
797
824
|
}
|
|
798
825
|
|
|
826
|
+
/** Payload of the `latencytargetchange` event: an SDK-initiated move of the
|
|
827
|
+
* live-sync target (never a caller's own `liveLatencyTarget`). */
|
|
828
|
+
export declare interface LiveTargetChange {
|
|
829
|
+
/** The target hls.js now converges to, in seconds. */
|
|
830
|
+
targetSeconds: number;
|
|
831
|
+
/** The target it replaced, in seconds. */
|
|
832
|
+
previousSeconds: number;
|
|
833
|
+
reason: LiveTargetReason;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Why the SDK moved the live-sync target (the `latencytargetchange` event).
|
|
838
|
+
* - `slow-fetches`: the adaptive hold-back stepped the target UP because the
|
|
839
|
+
* session's part fetches kept taking a large share of each part's duration.
|
|
840
|
+
* - `fast-fetches`: it stepped the target back DOWN after fetches stayed fast.
|
|
841
|
+
* - `connection-rtt`: the browser reported a high round-trip estimate at
|
|
842
|
+
* start, so the session began one step above the configured target.
|
|
843
|
+
* - `futile-chase`: a catch-up at full rate was not gaining on the live edge,
|
|
844
|
+
* so the target was parked where playback actually is.
|
|
845
|
+
*/
|
|
846
|
+
export declare type LiveTargetReason = 'slow-fetches' | 'fast-fetches' | 'connection-rtt' | 'futile-chase';
|
|
847
|
+
|
|
799
848
|
/**
|
|
800
849
|
* `pending` is the catalog's "kickoff has passed, the stream is being
|
|
801
850
|
* packaged" — not playable yet, `live` expected within seconds to minutes. It
|
|
@@ -965,6 +1014,10 @@ export declare interface PlaybackStats {
|
|
|
965
1014
|
* gaining on the edge (hls.js engine only). After a move, `targetLatencySeconds`
|
|
966
1015
|
* carries the new target and drift/atLiveEdge read against it. */
|
|
967
1016
|
liveRetargets?: number;
|
|
1017
|
+
/** Times the adaptive hold-back moved the live-sync target this session, up
|
|
1018
|
+
* or down (hls.js engine only; see `adaptiveHoldBack`). `targetLatencySeconds`
|
|
1019
|
+
* carries the current target. */
|
|
1020
|
+
holdBackSteps?: number;
|
|
968
1021
|
/** Times the ABR ceiling was stepped down because the device kept dropping
|
|
969
1022
|
* frames on the rendition it played (hls.js engine only). */
|
|
970
1023
|
fpsDownCaps?: number;
|
|
@@ -1062,7 +1115,7 @@ export declare interface Player {
|
|
|
1062
1115
|
destroy(): void;
|
|
1063
1116
|
}
|
|
1064
1117
|
|
|
1065
|
-
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'stats' | 'statechange';
|
|
1118
|
+
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'latencytargetchange' | 'stats' | 'statechange';
|
|
1066
1119
|
|
|
1067
1120
|
export declare interface PlayerEventMap {
|
|
1068
1121
|
ready: void;
|
|
@@ -1092,6 +1145,13 @@ export declare interface PlayerEventMap {
|
|
|
1092
1145
|
texttrackchange: number;
|
|
1093
1146
|
/** Picture-in-Picture entered (true) or exited (false). */
|
|
1094
1147
|
pipchange: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* The SDK moved the live-sync target itself (hls.js engine): the adaptive
|
|
1150
|
+
* hold-back stepped it for slow or fast part fetches or a high
|
|
1151
|
+
* browser-reported RTT, or a futile catch-up parked it where playback is.
|
|
1152
|
+
* Never fired for the caller's own `liveLatencyTarget`.
|
|
1153
|
+
*/
|
|
1154
|
+
latencytargetchange: LiveTargetChange;
|
|
1095
1155
|
stats: PlaybackStats;
|
|
1096
1156
|
statechange: PlayerState;
|
|
1097
1157
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -224,6 +224,33 @@ export declare interface CreatePlayerOptions {
|
|
|
224
224
|
* true` (hls.js's own poller) caps to the covering rung with no headroom.
|
|
225
225
|
*/
|
|
226
226
|
sizeCapHeadroom?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Adaptive live hold-back (hls.js engine): raise the live-sync target for a
|
|
229
|
+
* session whose part fetches are slow, instead of letting it stall. A
|
|
230
|
+
* viewer far from the origin plays from a local edge whose every cache
|
|
231
|
+
* miss on a 0.5 s part is a cross-continent fetch (250-310 ms per part on
|
|
232
|
+
* the global slot from South America, Canada/Mexico and APAC, against
|
|
233
|
+
* 44 ms in Europe, 2026-10-30), so the fetch cycle outruns the part
|
|
234
|
+
* cadence and the 2 s buffer drains: 3-13% rebuffer there against under
|
|
235
|
+
* 1% in the US and Europe. The engine times the session's own part
|
|
236
|
+
* fetches (first byte, as a share of the part's duration, over a 10 s
|
|
237
|
+
* window): a window whose p95 is at or above 60% AND whose median is at
|
|
238
|
+
* or above 40%, two 3 s ticks running, steps the target up 0.5 s, to
|
|
239
|
+
* `adaptiveHoldBackCeiling` at most; a p95 under 40% for 60 s steps it
|
|
240
|
+
* back down. A session whose fetches are fast never moves. Each
|
|
241
|
+
* move fires `latencytargetchange`, counts in `holdBackSteps`, and shows
|
|
242
|
+
* in `targetLatencySeconds` (and the heartbeat's target latency).
|
|
243
|
+
* Default: true. Live/LL only.
|
|
244
|
+
*/
|
|
245
|
+
adaptiveHoldBack?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Highest live-sync target the adaptive hold-back may step to, in seconds.
|
|
248
|
+
* Default: 3.5 (a far session that stalls drifts to ~6 s anyway, so a
|
|
249
|
+
* steady 3.5 s is the better trade for a latency-sensitive viewer). Kept
|
|
250
|
+
* under the drift ceiling; at or below `liveLatencyTarget` it disables the
|
|
251
|
+
* stepping.
|
|
252
|
+
*/
|
|
253
|
+
adaptiveHoldBackCeiling?: number;
|
|
227
254
|
/**
|
|
228
255
|
* DRM cold start: download the first init segment and parts while the
|
|
229
256
|
* first key is still being acquired, instead of after it (hls.js waits for
|
|
@@ -796,6 +823,28 @@ export declare interface LiveStateSubscription {
|
|
|
796
823
|
close(): void;
|
|
797
824
|
}
|
|
798
825
|
|
|
826
|
+
/** Payload of the `latencytargetchange` event: an SDK-initiated move of the
|
|
827
|
+
* live-sync target (never a caller's own `liveLatencyTarget`). */
|
|
828
|
+
export declare interface LiveTargetChange {
|
|
829
|
+
/** The target hls.js now converges to, in seconds. */
|
|
830
|
+
targetSeconds: number;
|
|
831
|
+
/** The target it replaced, in seconds. */
|
|
832
|
+
previousSeconds: number;
|
|
833
|
+
reason: LiveTargetReason;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Why the SDK moved the live-sync target (the `latencytargetchange` event).
|
|
838
|
+
* - `slow-fetches`: the adaptive hold-back stepped the target UP because the
|
|
839
|
+
* session's part fetches kept taking a large share of each part's duration.
|
|
840
|
+
* - `fast-fetches`: it stepped the target back DOWN after fetches stayed fast.
|
|
841
|
+
* - `connection-rtt`: the browser reported a high round-trip estimate at
|
|
842
|
+
* start, so the session began one step above the configured target.
|
|
843
|
+
* - `futile-chase`: a catch-up at full rate was not gaining on the live edge,
|
|
844
|
+
* so the target was parked where playback actually is.
|
|
845
|
+
*/
|
|
846
|
+
export declare type LiveTargetReason = 'slow-fetches' | 'fast-fetches' | 'connection-rtt' | 'futile-chase';
|
|
847
|
+
|
|
799
848
|
/**
|
|
800
849
|
* `pending` is the catalog's "kickoff has passed, the stream is being
|
|
801
850
|
* packaged" — not playable yet, `live` expected within seconds to minutes. It
|
|
@@ -965,6 +1014,10 @@ export declare interface PlaybackStats {
|
|
|
965
1014
|
* gaining on the edge (hls.js engine only). After a move, `targetLatencySeconds`
|
|
966
1015
|
* carries the new target and drift/atLiveEdge read against it. */
|
|
967
1016
|
liveRetargets?: number;
|
|
1017
|
+
/** Times the adaptive hold-back moved the live-sync target this session, up
|
|
1018
|
+
* or down (hls.js engine only; see `adaptiveHoldBack`). `targetLatencySeconds`
|
|
1019
|
+
* carries the current target. */
|
|
1020
|
+
holdBackSteps?: number;
|
|
968
1021
|
/** Times the ABR ceiling was stepped down because the device kept dropping
|
|
969
1022
|
* frames on the rendition it played (hls.js engine only). */
|
|
970
1023
|
fpsDownCaps?: number;
|
|
@@ -1062,7 +1115,7 @@ export declare interface Player {
|
|
|
1062
1115
|
destroy(): void;
|
|
1063
1116
|
}
|
|
1064
1117
|
|
|
1065
|
-
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'stats' | 'statechange';
|
|
1118
|
+
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'latencytargetchange' | 'stats' | 'statechange';
|
|
1066
1119
|
|
|
1067
1120
|
export declare interface PlayerEventMap {
|
|
1068
1121
|
ready: void;
|
|
@@ -1092,6 +1145,13 @@ export declare interface PlayerEventMap {
|
|
|
1092
1145
|
texttrackchange: number;
|
|
1093
1146
|
/** Picture-in-Picture entered (true) or exited (false). */
|
|
1094
1147
|
pipchange: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* The SDK moved the live-sync target itself (hls.js engine): the adaptive
|
|
1150
|
+
* hold-back stepped it for slow or fast part fetches or a high
|
|
1151
|
+
* browser-reported RTT, or a futile catch-up parked it where playback is.
|
|
1152
|
+
* Never fired for the caller's own `liveLatencyTarget`.
|
|
1153
|
+
*/
|
|
1154
|
+
latencytargetchange: LiveTargetChange;
|
|
1095
1155
|
stats: PlaybackStats;
|
|
1096
1156
|
statechange: PlayerState;
|
|
1097
1157
|
}
|