@oddin-gg/havik-player 1.0.6 → 1.1.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 +8 -1
- 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 +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/docs/API.md +28 -27
- package/embed/index.html +1 -1
- package/package.json +1 -1
package/docs/API.md
CHANGED
|
@@ -202,33 +202,34 @@ player.on('error', (e) => console.error(e.code, e.httpStatus, e.message));
|
|
|
202
202
|
|
|
203
203
|
#### `CreatePlayerOptions`
|
|
204
204
|
|
|
205
|
-
| Option | Type | Default | Description
|
|
206
|
-
| --------------------- | --------------------------------------- | ----------------------- |
|
|
207
|
-
| `video` | `HTMLVideoElement` | — | **Required.** The element the SDK will control.
|
|
208
|
-
| `baseUrl` | `string` | — | **Required.** API base URL, e.g. `https://streams.oddin.gg`.
|
|
209
|
-
| `matchUrn` | `string` | — | **Required.** The match to play, e.g. `od:match:1234`.
|
|
210
|
-
| `credential` | [`CredentialSource`](#credentialsource) | — | **Required.** Your api‑key (or a function returning one).
|
|
211
|
-
| `autoplay` | `boolean` | `true` | Start playback once ready.
|
|
212
|
-
| `muted` | `boolean` | `false` | Mute the element. Set `true` for reliable autoplay under browser sound policies.
|
|
213
|
-
| `controls` | `'custom' \| 'native' \| 'none'` | `'custom'` | Which controls to render. See [Controls & theming](#controls--theming).
|
|
214
|
-
| `theme` | [`Partial<HavikTheme>`](#haviktheme) | Oddin brand | Re-skin the custom control bar (ignored unless `controls: 'custom'`). See [Controls & theming](#controls--theming).
|
|
215
|
-
| `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'`.
|
|
216
|
-
| `endedMessage` | `string` | "This stream has ended" | Message on the end-of-stream card.
|
|
217
|
-
| `errorMessage` | `string` | the error's message | Message on the fatal-error card (otherwise the error's own message).
|
|
218
|
-
| `waitForLive` | [`WaitForLive`](#waitforlive) | — | Arm on an upcoming match and auto‑attach at go‑live.
|
|
219
|
-
| `lowLatency` | `'auto' \| boolean` | `'auto'` | `'auto'` lets the player decide from the manifest.
|
|
220
|
-
| `engine` | `'auto' \| 'hls' \| 'native'` | `'auto'` | `'auto'` picks native HLS on Safari, hls.js elsewhere.
|
|
221
|
-
| `userId` | `string` | — | Optional viewer id (sent as `X-User-Id` on license requests).
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
205
|
+
| Option | Type | Default | Description |
|
|
206
|
+
| --------------------- | --------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
207
|
+
| `video` | `HTMLVideoElement` | — | **Required.** The element the SDK will control. |
|
|
208
|
+
| `baseUrl` | `string` | — | **Required.** API base URL, e.g. `https://streams.oddin.gg`. |
|
|
209
|
+
| `matchUrn` | `string` | — | **Required.** The match to play, e.g. `od:match:1234`. |
|
|
210
|
+
| `credential` | [`CredentialSource`](#credentialsource) | — | **Required.** Your api‑key (or a function returning one). |
|
|
211
|
+
| `autoplay` | `boolean` | `true` | Start playback once ready. |
|
|
212
|
+
| `muted` | `boolean` | `false` | Mute the element. Set `true` for reliable autoplay under browser sound policies. |
|
|
213
|
+
| `controls` | `'custom' \| 'native' \| 'none'` | `'custom'` | Which controls to render. See [Controls & theming](#controls--theming). |
|
|
214
|
+
| `theme` | [`Partial<HavikTheme>`](#haviktheme) | Oddin brand | Re-skin the custom control bar (ignored unless `controls: 'custom'`). See [Controls & theming](#controls--theming). |
|
|
215
|
+
| `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'`. |
|
|
216
|
+
| `endedMessage` | `string` | "This stream has ended" | Message on the end-of-stream card. |
|
|
217
|
+
| `errorMessage` | `string` | the error's message | Message on the fatal-error card (otherwise the error's own message). |
|
|
218
|
+
| `waitForLive` | [`WaitForLive`](#waitforlive) | — | Arm on an upcoming match and auto‑attach at go‑live. |
|
|
219
|
+
| `lowLatency` | `'auto' \| boolean` | `'auto'` | `'auto'` lets the player decide from the manifest. |
|
|
220
|
+
| `engine` | `'auto' \| 'hls' \| 'native'` | `'auto'` | `'auto'` picks native HLS on Safari, hls.js elsewhere. |
|
|
221
|
+
| `userId` | `string` | — | Optional viewer id (sent as `X-User-Id` on license requests). |
|
|
222
|
+
| `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. |
|
|
223
|
+
| `hlsConfig` | `Partial<HlsConfig>` | — | Escape hatch for advanced hls.js tuning. |
|
|
224
|
+
| `statsIntervalMs` | `number` | `2000` | How often `'stats'` is emitted. |
|
|
225
|
+
| `licenseRefreshMs` | `number` | `480000` (8 min) | Silent DRM license‑URL refresh interval for long sessions. `0` disables. |
|
|
226
|
+
| `poster` | `string` | — | Poster image shown before playback starts. |
|
|
227
|
+
| `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). |
|
|
228
|
+
| `maxBitrate` | `number` | — | Cap ABR to renditions at/below this bitrate (bps). |
|
|
229
|
+
| `liveLatencyTarget` | `number` | `3` | 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. |
|
|
230
|
+
| `snapToLiveOnRefocus` | `boolean` | `true` | Snap to the live edge when a backgrounded tab is refocused while far behind. Live/LL only. |
|
|
231
|
+
| `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. |
|
|
232
|
+
| `eventsBaseUrl` | `string` | derived | Override the SSE endpoint base. Default: `baseUrl` with the host prefixed by `events.` (e.g. `feed.<d>` → `events.<d>`). |
|
|
232
233
|
|
|
233
234
|
### Low‑latency & adaptive bitrate
|
|
234
235
|
|
package/embed/index.html
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
apiKey, parentOrigin). When injected, the URL query string is IGNORED for
|
|
19
19
|
security; the api-key must NOT travel in the query in production.
|
|
20
20
|
-->
|
|
21
|
-
<script src="https://cdn.jsdelivr.net/npm/@oddin-gg/havik-player@1.0
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/@oddin-gg/havik-player@1.1.0/dist/havik-player.global.js" integrity="sha384-BpHvAuoGIE+4dqbqLV3IX24RWeMcb1S8cedCn4v+Xh02hPlkXuwx6leR8ou0LQYN" crossorigin="anonymous"></script>
|
|
22
22
|
<script>
|
|
23
23
|
HavikPlayer.bootEmbed();
|
|
24
24
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oddin-gg/havik-player",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.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,
|