@oddin-gg/havik-player 2.23.4 → 2.25.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/README.md +2 -0
- package/dist/havik-player.global.js +15 -15
- package/dist/havik-player.global.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +573 -433
- package/dist/index.js.map +1 -1
- package/docs/API.md +101 -57
- package/embed/index.html +1 -1
- package/examples/vanilla.html +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -260,6 +260,16 @@ export declare interface CreatePlayerOptions {
|
|
|
260
260
|
* clear streams, and when `hlsConfig.fLoader` is set.
|
|
261
261
|
*/
|
|
262
262
|
mediaDuringKey?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Live LL-HLS (hls.js engine): fetch the part each playlist's
|
|
265
|
+
* EXT-X-PRELOAD-HINT names as soon as the playlist arrives, instead of
|
|
266
|
+
* waiting for the next playlist to list it. The origin and CDNs hold that
|
|
267
|
+
* request until the part exists, so a viewer far from the origin saves
|
|
268
|
+
* about one round trip per part. Bytes reach hls.js only when it asks for
|
|
269
|
+
* the part; a hinted part it never asks for is dropped. Default: false.
|
|
270
|
+
* Ignored when `hlsConfig.fLoader` is set.
|
|
271
|
+
*/
|
|
272
|
+
preloadHints?: boolean;
|
|
263
273
|
/** Force an engine; 'auto' uses the native engine for FairPlay on Apple
|
|
264
274
|
* browsers and for every stream on iPhone/iPad, hls.js elsewhere wherever
|
|
265
275
|
* supported, and falls back to native HLS. Default: 'auto'. */
|
|
@@ -311,6 +321,16 @@ export declare interface CreatePlayerOptions {
|
|
|
311
321
|
interruptedMessage?: string;
|
|
312
322
|
/** Message on the fatal-error card. Default: the error's own message. */
|
|
313
323
|
errorMessage?: string;
|
|
324
|
+
/**
|
|
325
|
+
* Message on the card shown while the browser reports no network
|
|
326
|
+
* (`navigator.onLine === false` — wifi off, airplane mode, cable out).
|
|
327
|
+
* Default: "No internet connection — waiting to reconnect". The card
|
|
328
|
+
* replaces the error and reconnecting cards for as long as the browser
|
|
329
|
+
* says offline, and carries no Retry button: nothing can succeed without a
|
|
330
|
+
* route. Playback resumes on its own when the browser fires `online` (see
|
|
331
|
+
* the `offline`/`online` events).
|
|
332
|
+
*/
|
|
333
|
+
offlineMessage?: string;
|
|
314
334
|
/**
|
|
315
335
|
* Turn on hls.js's internal console logging — segment/part scheduling, ABR
|
|
316
336
|
* switches, and EME key-session + license traffic. Default: false.
|
|
@@ -1092,6 +1112,14 @@ export declare interface PlaybackStats {
|
|
|
1092
1112
|
export declare interface Player {
|
|
1093
1113
|
readonly state: PlayerState;
|
|
1094
1114
|
readonly descriptor: StreamDescriptor | null;
|
|
1115
|
+
/**
|
|
1116
|
+
* True while the browser reports no network (`navigator.onLine === false`).
|
|
1117
|
+
* Reliable in that direction only: `false` means "not known to be offline",
|
|
1118
|
+
* which a captive portal or a dead upstream still satisfies. Orthogonal to
|
|
1119
|
+
* `state` — a player can be 'buffering' or 'error' with this true, and the
|
|
1120
|
+
* control bar shows the offline card over either while it is.
|
|
1121
|
+
*/
|
|
1122
|
+
readonly offline: boolean;
|
|
1095
1123
|
/** Why the stream ended, when the server said so; null otherwise. Cleared
|
|
1096
1124
|
* when fresh playback commits (including a rejoin). See EndedReason. */
|
|
1097
1125
|
readonly endedReason: EndedReason | null;
|
|
@@ -1144,7 +1172,7 @@ export declare interface Player {
|
|
|
1144
1172
|
destroy(): void;
|
|
1145
1173
|
}
|
|
1146
1174
|
|
|
1147
|
-
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'latencytargetchange' | 'stats' | 'statechange';
|
|
1175
|
+
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'latencytargetchange' | 'stats' | 'statechange' | 'offline' | 'online';
|
|
1148
1176
|
|
|
1149
1177
|
export declare interface PlayerEventMap {
|
|
1150
1178
|
ready: void;
|
|
@@ -1183,6 +1211,21 @@ export declare interface PlayerEventMap {
|
|
|
1183
1211
|
latencytargetchange: LiveTargetChange;
|
|
1184
1212
|
stats: PlaybackStats;
|
|
1185
1213
|
statechange: PlayerState;
|
|
1214
|
+
/**
|
|
1215
|
+
* The browser reported it lost its network (`window` `offline`). The
|
|
1216
|
+
* player state is unchanged — what follows depends on where the loss
|
|
1217
|
+
* lands: the hls.js engine parks its loader on the next failed fetch, a
|
|
1218
|
+
* resolve in flight fails NETWORK — and `offline` is the one signal that
|
|
1219
|
+
* the cause is the viewer's link. See {@link Player.offline}.
|
|
1220
|
+
*/
|
|
1221
|
+
offline: void;
|
|
1222
|
+
/**
|
|
1223
|
+
* The browser reported its network is back (`window` `online`). The
|
|
1224
|
+
* player resumes on its own: a parked hls.js loader restarts at once, and
|
|
1225
|
+
* a fatal error that happened while offline (or any NETWORK error) is
|
|
1226
|
+
* retried — the same re-resolve as `retry()`.
|
|
1227
|
+
*/
|
|
1228
|
+
online: void;
|
|
1186
1229
|
}
|
|
1187
1230
|
|
|
1188
1231
|
export declare type PlayerState = 'idle' | 'waiting' | 'loading' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error';
|
package/dist/index.d.ts
CHANGED
|
@@ -260,6 +260,16 @@ export declare interface CreatePlayerOptions {
|
|
|
260
260
|
* clear streams, and when `hlsConfig.fLoader` is set.
|
|
261
261
|
*/
|
|
262
262
|
mediaDuringKey?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Live LL-HLS (hls.js engine): fetch the part each playlist's
|
|
265
|
+
* EXT-X-PRELOAD-HINT names as soon as the playlist arrives, instead of
|
|
266
|
+
* waiting for the next playlist to list it. The origin and CDNs hold that
|
|
267
|
+
* request until the part exists, so a viewer far from the origin saves
|
|
268
|
+
* about one round trip per part. Bytes reach hls.js only when it asks for
|
|
269
|
+
* the part; a hinted part it never asks for is dropped. Default: false.
|
|
270
|
+
* Ignored when `hlsConfig.fLoader` is set.
|
|
271
|
+
*/
|
|
272
|
+
preloadHints?: boolean;
|
|
263
273
|
/** Force an engine; 'auto' uses the native engine for FairPlay on Apple
|
|
264
274
|
* browsers and for every stream on iPhone/iPad, hls.js elsewhere wherever
|
|
265
275
|
* supported, and falls back to native HLS. Default: 'auto'. */
|
|
@@ -311,6 +321,16 @@ export declare interface CreatePlayerOptions {
|
|
|
311
321
|
interruptedMessage?: string;
|
|
312
322
|
/** Message on the fatal-error card. Default: the error's own message. */
|
|
313
323
|
errorMessage?: string;
|
|
324
|
+
/**
|
|
325
|
+
* Message on the card shown while the browser reports no network
|
|
326
|
+
* (`navigator.onLine === false` — wifi off, airplane mode, cable out).
|
|
327
|
+
* Default: "No internet connection — waiting to reconnect". The card
|
|
328
|
+
* replaces the error and reconnecting cards for as long as the browser
|
|
329
|
+
* says offline, and carries no Retry button: nothing can succeed without a
|
|
330
|
+
* route. Playback resumes on its own when the browser fires `online` (see
|
|
331
|
+
* the `offline`/`online` events).
|
|
332
|
+
*/
|
|
333
|
+
offlineMessage?: string;
|
|
314
334
|
/**
|
|
315
335
|
* Turn on hls.js's internal console logging — segment/part scheduling, ABR
|
|
316
336
|
* switches, and EME key-session + license traffic. Default: false.
|
|
@@ -1092,6 +1112,14 @@ export declare interface PlaybackStats {
|
|
|
1092
1112
|
export declare interface Player {
|
|
1093
1113
|
readonly state: PlayerState;
|
|
1094
1114
|
readonly descriptor: StreamDescriptor | null;
|
|
1115
|
+
/**
|
|
1116
|
+
* True while the browser reports no network (`navigator.onLine === false`).
|
|
1117
|
+
* Reliable in that direction only: `false` means "not known to be offline",
|
|
1118
|
+
* which a captive portal or a dead upstream still satisfies. Orthogonal to
|
|
1119
|
+
* `state` — a player can be 'buffering' or 'error' with this true, and the
|
|
1120
|
+
* control bar shows the offline card over either while it is.
|
|
1121
|
+
*/
|
|
1122
|
+
readonly offline: boolean;
|
|
1095
1123
|
/** Why the stream ended, when the server said so; null otherwise. Cleared
|
|
1096
1124
|
* when fresh playback commits (including a rejoin). See EndedReason. */
|
|
1097
1125
|
readonly endedReason: EndedReason | null;
|
|
@@ -1144,7 +1172,7 @@ export declare interface Player {
|
|
|
1144
1172
|
destroy(): void;
|
|
1145
1173
|
}
|
|
1146
1174
|
|
|
1147
|
-
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'latencytargetchange' | 'stats' | 'statechange';
|
|
1175
|
+
export declare type PlayerEvent = 'ready' | 'waiting' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error' | 'warning' | 'autoplayblocked' | 'qualitychange' | 'audiotrackchange' | 'texttrackchange' | 'pipchange' | 'latencytargetchange' | 'stats' | 'statechange' | 'offline' | 'online';
|
|
1148
1176
|
|
|
1149
1177
|
export declare interface PlayerEventMap {
|
|
1150
1178
|
ready: void;
|
|
@@ -1183,6 +1211,21 @@ export declare interface PlayerEventMap {
|
|
|
1183
1211
|
latencytargetchange: LiveTargetChange;
|
|
1184
1212
|
stats: PlaybackStats;
|
|
1185
1213
|
statechange: PlayerState;
|
|
1214
|
+
/**
|
|
1215
|
+
* The browser reported it lost its network (`window` `offline`). The
|
|
1216
|
+
* player state is unchanged — what follows depends on where the loss
|
|
1217
|
+
* lands: the hls.js engine parks its loader on the next failed fetch, a
|
|
1218
|
+
* resolve in flight fails NETWORK — and `offline` is the one signal that
|
|
1219
|
+
* the cause is the viewer's link. See {@link Player.offline}.
|
|
1220
|
+
*/
|
|
1221
|
+
offline: void;
|
|
1222
|
+
/**
|
|
1223
|
+
* The browser reported its network is back (`window` `online`). The
|
|
1224
|
+
* player resumes on its own: a parked hls.js loader restarts at once, and
|
|
1225
|
+
* a fatal error that happened while offline (or any NETWORK error) is
|
|
1226
|
+
* retried — the same re-resolve as `retry()`.
|
|
1227
|
+
*/
|
|
1228
|
+
online: void;
|
|
1186
1229
|
}
|
|
1187
1230
|
|
|
1188
1231
|
export declare type PlayerState = 'idle' | 'waiting' | 'loading' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error';
|