@oddin-gg/havik-player 2.24.0 → 2.25.1

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/index.d.cts CHANGED
@@ -321,6 +321,16 @@ export declare interface CreatePlayerOptions {
321
321
  interruptedMessage?: string;
322
322
  /** Message on the fatal-error card. Default: the error's own message. */
323
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;
324
334
  /**
325
335
  * Turn on hls.js's internal console logging — segment/part scheduling, ABR
326
336
  * switches, and EME key-session + license traffic. Default: false.
@@ -1102,6 +1112,14 @@ export declare interface PlaybackStats {
1102
1112
  export declare interface Player {
1103
1113
  readonly state: PlayerState;
1104
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;
1105
1123
  /** Why the stream ended, when the server said so; null otherwise. Cleared
1106
1124
  * when fresh playback commits (including a rejoin). See EndedReason. */
1107
1125
  readonly endedReason: EndedReason | null;
@@ -1154,7 +1172,7 @@ export declare interface Player {
1154
1172
  destroy(): void;
1155
1173
  }
1156
1174
 
1157
- 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';
1158
1176
 
1159
1177
  export declare interface PlayerEventMap {
1160
1178
  ready: void;
@@ -1193,6 +1211,21 @@ export declare interface PlayerEventMap {
1193
1211
  latencytargetchange: LiveTargetChange;
1194
1212
  stats: PlaybackStats;
1195
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;
1196
1229
  }
1197
1230
 
1198
1231
  export declare type PlayerState = 'idle' | 'waiting' | 'loading' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error';
package/dist/index.d.ts CHANGED
@@ -321,6 +321,16 @@ export declare interface CreatePlayerOptions {
321
321
  interruptedMessage?: string;
322
322
  /** Message on the fatal-error card. Default: the error's own message. */
323
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;
324
334
  /**
325
335
  * Turn on hls.js's internal console logging — segment/part scheduling, ABR
326
336
  * switches, and EME key-session + license traffic. Default: false.
@@ -1102,6 +1112,14 @@ export declare interface PlaybackStats {
1102
1112
  export declare interface Player {
1103
1113
  readonly state: PlayerState;
1104
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;
1105
1123
  /** Why the stream ended, when the server said so; null otherwise. Cleared
1106
1124
  * when fresh playback commits (including a rejoin). See EndedReason. */
1107
1125
  readonly endedReason: EndedReason | null;
@@ -1154,7 +1172,7 @@ export declare interface Player {
1154
1172
  destroy(): void;
1155
1173
  }
1156
1174
 
1157
- 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';
1158
1176
 
1159
1177
  export declare interface PlayerEventMap {
1160
1178
  ready: void;
@@ -1193,6 +1211,21 @@ export declare interface PlayerEventMap {
1193
1211
  latencytargetchange: LiveTargetChange;
1194
1212
  stats: PlaybackStats;
1195
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;
1196
1229
  }
1197
1230
 
1198
1231
  export declare type PlayerState = 'idle' | 'waiting' | 'loading' | 'playing' | 'buffering' | 'paused' | 'ended' | 'error';