@oddin-gg/havik-player 1.16.1 → 1.17.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/docs/API.md CHANGED
@@ -135,7 +135,11 @@ action. By default it does this over the **push** channel (SSE,
135
135
  `/v1/playback` requests, waits for the pushed `live`, then resolves once. If the SSE
136
136
  endpoint is unavailable it **falls back to polling** `TOO_EARLY` + the server's
137
137
  `Retry-After`. End-of-stream is detected automatically too — the player stops and
138
- fires `ended`. Set `liveStateEvents: false` to force polling-only.
138
+ fires `ended`. And ended is not necessarily forever: if the encoder reconnects after
139
+ an outage long enough to tear the session down, the recreated session serves under a
140
+ **new manifest URL** — so on the next pushed `live` the player **rejoins**
141
+ automatically (re-resolves and re-attaches, `rejoinOnLive` option). Set
142
+ `liveStateEvents: false` to force polling-only.
139
143
 
140
144
  See [`WaitForLive`](#waitforlive) for tuning, and [`createPlayer`](#createplayer) /
141
145
  [`resolveStream`](#resolvestream) for usage.
@@ -215,34 +219,35 @@ player.on('error', (e) => console.error(e.code, e.httpStatus, e.message));
215
219
 
216
220
  #### `CreatePlayerOptions`
217
221
 
218
- | Option | Type | Default | Description |
219
- | --------------------- | --------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
220
- | `video` | `HTMLVideoElement` | — | **Required.** The element the SDK will control. |
221
- | `baseUrl` | `string` | — | **Required.** API base URL, e.g. `https://feed-dev.oddin-video.gg`. |
222
- | `matchUrn` | `string` | — | **Required.** The match to play, e.g. `od:match:1234`. |
223
- | `credential` | [`CredentialSource`](#credentialsource) | — | **Required.** Your api‑key (or a function returning one). |
224
- | `autoplay` | `boolean` | `true` | Start playback once ready. |
225
- | `muted` | `boolean` | `false` | Mute the element. Set `true` for reliable autoplay under browser sound policies. |
226
- | `controls` | `'custom' \| 'native' \| 'none'` | `'custom'` | Which controls to render. See [Controls & theming](#controls--theming). |
227
- | `theme` | [`Partial<HavikTheme>`](#haviktheme) | Oddin brand | Re-skin the custom control bar (ignored unless `controls: 'custom'`). See [Controls & theming](#controls--theming). |
228
- | `statusOverlays` | `boolean` | `true` | Branded full-bleed cards for the stopped/pre-play states (ended, fatal error, pre-play, armed-waiting) instead of a frozen frame + a dead play button. Themed via the control-bar tokens + `theme.logoUrl`. Set `false` to render your own UI from the `ended`/`error` events. Ignored unless `controls: 'custom'`. |
229
- | `endedMessage` | `string` | "This stream has ended" | Message on the end-of-stream card. |
230
- | `errorMessage` | `string` | the error's message | Message on the fatal-error card (otherwise the error's own message). |
231
- | `waitForLive` | [`WaitForLive`](#waitforlive) | — | Arm on an upcoming match and auto‑attach at go‑live. |
232
- | `lowLatency` | `'auto' \| boolean` | `'auto'` | `'auto'` lets the player decide from the manifest. |
233
- | `engine` | `'auto' \| 'hls' \| 'native'` | `'auto'` | `'auto'` prefers hls.js wherever it is supported — including modern Safari/iOS via ManagedMediaSource — and falls back to native HLS otherwise. |
234
- | `userId` | `string` | — | Optional viewer id (sent as `X-User-Id` on license requests). |
235
- | `debug` | `boolean` | `false` | Turn on hls.js's internal console logging — fragment/part scheduling, ABR switches, EME key sessions and license traffic. For diagnosing a playback problem with Oddin support; leave it off in production (it logs on every fragment, and the EME lines include license request/response metadata). hls.js engine only. `hlsConfig.debug` still wins if you set both. |
236
- | `hlsConfig` | `Partial<HlsConfig>` | — | Escape hatch for advanced hls.js tuning. |
237
- | `statsIntervalMs` | `number` | `2000` | How often `'stats'` is emitted. |
238
- | `licenseRefreshMs` | `number` | `480000` (8 min) | Silent DRM license‑URL refresh interval for long sessions. `0` disables. |
239
- | `poster` | `string` | — | Poster image shown before playback starts. |
240
- | `startLevel` | `number` | `-1` | Initial rendition index (`-1` = auto). With auto, ABR starts on a conservative, sustainable rendition (~360p) and ramps up as bandwidth allows — see [Low‑latency & adaptive bitrate](#low-latency--adaptive-bitrate). |
241
- | `maxBitrate` | `number` | — | Cap ABR to renditions at/below this bitrate (bps). |
242
- | `liveLatencyTarget` | `number` | `2` | Target live‑edge latency in seconds (hls.js `liveSyncDuration`). The player derives a matching latency **ceiling** internally and catches up at 1.5×, so this is the only live‑latency knob you need. Lower = closer to live but more rebuffer‑prone. Live/LL only. |
243
- | `snapToLiveOnRefocus` | `boolean` | `true` | Snap to the live edge when a backgrounded tab is refocused while far behind. Live/LL only. |
244
- | `liveStateEvents` | `boolean` | `true` | Use the push-based **live-state SSE** channel for go-live and end-of-stream (see [Live state](#live-state-sse)). Graceful: falls back to polling if the endpoint is unreachable. Set `false` to disable. |
245
- | `eventsBaseUrl` | `string` | derived | Override the SSE endpoint base. Default: `baseUrl` with the host prefixed by `events.` (e.g. `feed.<d>` → `events.<d>`). |
222
+ | Option | Type | Default | Description |
223
+ | --------------------- | --------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
224
+ | `video` | `HTMLVideoElement` | — | **Required.** The element the SDK will control. |
225
+ | `baseUrl` | `string` | — | **Required.** API base URL, e.g. `https://feed-dev.oddin-video.gg`. |
226
+ | `matchUrn` | `string` | — | **Required.** The match to play, e.g. `od:match:1234`. |
227
+ | `credential` | [`CredentialSource`](#credentialsource) | — | **Required.** Your api‑key (or a function returning one). |
228
+ | `autoplay` | `boolean` | `true` | Start playback once ready. |
229
+ | `muted` | `boolean` | `false` | Mute the element. Set `true` for reliable autoplay under browser sound policies. |
230
+ | `controls` | `'custom' \| 'native' \| 'none'` | `'custom'` | Which controls to render. See [Controls & theming](#controls--theming). |
231
+ | `theme` | [`Partial<HavikTheme>`](#haviktheme) | Oddin brand | Re-skin the custom control bar (ignored unless `controls: 'custom'`). See [Controls & theming](#controls--theming). |
232
+ | `statusOverlays` | `boolean` | `true` | Branded full-bleed cards for the stopped/pre-play states (ended, fatal error, pre-play, armed-waiting) instead of a frozen frame + a dead play button. Themed via the control-bar tokens + `theme.logoUrl`. Set `false` to render your own UI from the `ended`/`error` events. Ignored unless `controls: 'custom'`. |
233
+ | `endedMessage` | `string` | "This stream has ended" | Message on the end-of-stream card. |
234
+ | `errorMessage` | `string` | the error's message | Message on the fatal-error card (otherwise the error's own message). |
235
+ | `waitForLive` | [`WaitForLive`](#waitforlive) | — | Arm on an upcoming match and auto‑attach at go‑live. |
236
+ | `lowLatency` | `'auto' \| boolean` | `'auto'` | `'auto'` lets the player decide from the manifest. |
237
+ | `engine` | `'auto' \| 'hls' \| 'native'` | `'auto'` | `'auto'` prefers hls.js wherever it is supported — including modern Safari/iOS via ManagedMediaSource — and falls back to native HLS otherwise. |
238
+ | `userId` | `string` | — | Optional viewer id (sent as `X-User-Id` on license requests). |
239
+ | `debug` | `boolean` | `false` | Turn on hls.js's internal console logging — fragment/part scheduling, ABR switches, EME key sessions and license traffic. For diagnosing a playback problem with Oddin support; leave it off in production (it logs on every fragment, and the EME lines include license request/response metadata). hls.js engine only. `hlsConfig.debug` still wins if you set both. |
240
+ | `hlsConfig` | `Partial<HlsConfig>` | — | Escape hatch for advanced hls.js tuning. |
241
+ | `statsIntervalMs` | `number` | `2000` | How often `'stats'` is emitted. |
242
+ | `licenseRefreshMs` | `number` | `480000` (8 min) | Silent DRM license‑URL refresh interval for long sessions. `0` disables. |
243
+ | `poster` | `string` | — | Poster image shown before playback starts. |
244
+ | `startLevel` | `number` | `-1` | Initial rendition index (`-1` = auto). With auto, ABR starts on a conservative, sustainable rendition (~360p) and ramps up as bandwidth allows — see [Low‑latency & adaptive bitrate](#low-latency--adaptive-bitrate). |
245
+ | `maxBitrate` | `number` | — | Cap ABR to renditions at/below this bitrate (bps). |
246
+ | `liveLatencyTarget` | `number` | `2` | Target live‑edge latency in seconds (hls.js `liveSyncDuration`). The player derives a matching latency **ceiling** internally and catches up at 1.5×, so this is the only live‑latency knob you need. Lower = closer to live but more rebuffer‑prone. Live/LL only. |
247
+ | `snapToLiveOnRefocus` | `boolean` | `true` | Snap to the live edge when a backgrounded tab is refocused while far behind. Live/LL only. |
248
+ | `liveStateEvents` | `boolean` | `true` | Use the push-based **live-state SSE** channel for go-live and end-of-stream (see [Live state](#live-state-sse)). Graceful: falls back to polling if the endpoint is unreachable. Set `false` to disable. |
249
+ | `rejoinOnLive` | `boolean` | `true` | Rejoin automatically when a stream that ended comes back live. An ingest outage longer than the bridge's reconnect grace recreates the session under a **new manifest URL** (the old playlist freezes at HTTP 200), so the player keeps the live-state subscription open after `ended` (until `gone`) and re-arms on a pushed `live`. Set `false` to keep `ended` terminal. Needs `liveStateEvents`. |
250
+ | `eventsBaseUrl` | `string` | derived | Override the SSE endpoint base. Default: `baseUrl` with the host prefixed by `events.` (e.g. `feed.<d>` → `events.<d>`). |
246
251
 
247
252
  ### Low‑latency & adaptive bitrate
248
253
 
package/embed/index.html CHANGED
@@ -23,7 +23,7 @@
23
23
  apiKey, parentOrigin). When injected, the URL query string is IGNORED for
24
24
  security; the api-key must NOT travel in the query in production.
25
25
  -->
26
- <script src="https://cdn.jsdelivr.net/npm/@oddin-gg/havik-player@1.16.1/dist/havik-player.global.js" integrity="sha384-BSymm/a1bdHnU/U4UDnn6vGVVMANbVatcFgRhJJ1Hfj+5u3h/LZ4U3C7vAkyitdU" crossorigin="anonymous"></script>
26
+ <script src="https://cdn.jsdelivr.net/npm/@oddin-gg/havik-player@1.17.0/dist/havik-player.global.js" integrity="sha384-OX+N8AnO+WaVi6AnRhVIs7vYm8RugKMxdmtkdu9zwlpyIcAuXCbt16XqnccW49h2" crossorigin="anonymous"></script>
27
27
  <script>
28
28
  HavikPlayer.bootEmbed();
29
29
  </script>
@@ -12,7 +12,7 @@
12
12
  shipped in each npm release is pinned to that release with Subresource
13
13
  Integrity, injected at publish time (scripts/inject-sri.mjs). In
14
14
  production, always use a pinned + SRI'd tag like the released copy. -->
15
- <script src="https://cdn.jsdelivr.net/npm/@oddin-gg/havik-player@1.16.1/dist/havik-player.global.js" integrity="sha384-BSymm/a1bdHnU/U4UDnn6vGVVMANbVatcFgRhJJ1Hfj+5u3h/LZ4U3C7vAkyitdU" crossorigin="anonymous"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/@oddin-gg/havik-player@1.17.0/dist/havik-player.global.js" integrity="sha384-OX+N8AnO+WaVi6AnRhVIs7vYm8RugKMxdmtkdu9zwlpyIcAuXCbt16XqnccW49h2" crossorigin="anonymous"></script>
16
16
  <script>
17
17
  (async () => {
18
18
  const player = await HavikPlayer.createPlayer({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oddin-gg/havik-player",
3
- "version": "1.16.1",
3
+ "version": "1.17.0",
4
4
  "description": "Havik HTML5 player SDK — LL-HLS + DRM playback for Oddin live streams (managed, bring-your-own-player, and iframe-embed modes).",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -59,9 +59,6 @@
59
59
  "build:lib": "vite build --config vite.lib.config.ts",
60
60
  "build:global": "vite build --config vite.global.config.ts",
61
61
  "build:demo": "vite build",
62
- "dev:site": "vitepress dev site",
63
- "build:site": "vitepress build site && vite build --config vite.embed.config.ts",
64
- "preview:site": "vitepress preview site",
65
62
  "typecheck": "tsc --noEmit",
66
63
  "lint": "eslint .",
67
64
  "format": "prettier --write .",
@@ -103,12 +100,6 @@
103
100
  "typescript-eslint": "^8.62.0",
104
101
  "vite": "^8.1.0",
105
102
  "vite-plugin-dts": "^5.0.3",
106
- "vitepress": "^1.6.4",
107
103
  "vitest": "^4.1.9"
108
- },
109
- "overrides": {
110
- "vitepress": {
111
- "vite": "^6.4.3"
112
- }
113
104
  }
114
105
  }