@oddin-gg/havik-player 2.7.0 → 2.9.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 +57 -1
- package/dist/havik-player.global.js +17 -17
- 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 +98 -7
- package/dist/index.d.ts +98 -7
- package/dist/index.js +209 -180
- package/dist/index.js.map +1 -1
- package/docs/API.md +39 -11
- package/embed/index.html +6 -1
- package/examples/vanilla.html +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ import { createPlayer } from '@oddin-gg/havik-player';
|
|
|
61
61
|
|
|
62
62
|
const player = await createPlayer({
|
|
63
63
|
video: document.querySelector('video')!,
|
|
64
|
-
|
|
64
|
+
env: 'integration', // or 'production'
|
|
65
65
|
matchUrn: 'od:match:1234',
|
|
66
66
|
credential: { apiKey: 'pk_test_…' },
|
|
67
67
|
autoplay: true,
|
|
@@ -81,6 +81,39 @@ player.destroy();
|
|
|
81
81
|
The managed player handles `425 TOO_EARLY` retries (honoring `Retry-After`),
|
|
82
82
|
buffering recovery, and silent DRM **license-URL refresh** for long sessions.
|
|
83
83
|
|
|
84
|
+
### Choosing an environment
|
|
85
|
+
|
|
86
|
+
`env` names the stack: `integration` is the shared pre-production environment,
|
|
87
|
+
`production` is the production one. They are separate deployments, not
|
|
88
|
+
aliases. Prefer `env` over a hand-written `baseUrl`. The API host is then
|
|
89
|
+
correct by construction, and so is every host derived from it, including the
|
|
90
|
+
QoE beacons endpoint.
|
|
91
|
+
|
|
92
|
+
Pass `baseUrl` instead when the named environments do not cover your
|
|
93
|
+
deployment:
|
|
94
|
+
|
|
95
|
+
- your own CDN or gateway in front of the streams API
|
|
96
|
+
- the CN plane, whose host is not under this domain
|
|
97
|
+
- a pinned build that has to outlive a domain change
|
|
98
|
+
|
|
99
|
+
`baseUrl` is not deprecated and is not going away. Pass exactly one of the
|
|
100
|
+
two. In TypeScript, passing both or neither is a compile error. In JavaScript
|
|
101
|
+
it throws at `createPlayer`, because the two disagreeing is the
|
|
102
|
+
misconfiguration worth refusing.
|
|
103
|
+
|
|
104
|
+
Modes B and C still take a `baseUrl`. Use `baseUrlForEnv` there rather than
|
|
105
|
+
copying a hostname into your own config:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { baseUrlForEnv, resolveStream } from '@oddin-gg/havik-player';
|
|
109
|
+
|
|
110
|
+
const stream = await resolveStream({
|
|
111
|
+
baseUrl: baseUrlForEnv('production'),
|
|
112
|
+
matchUrn: 'od:match:1234',
|
|
113
|
+
credential: { apiKey: 'pk_live_…' },
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
84
117
|
### Controls & skinning
|
|
85
118
|
|
|
86
119
|
By default, Mode A renders a **branded, fully skinnable control bar**. It covers
|
|
@@ -174,6 +207,29 @@ A ready-to-host template lives in the repo at [`embed/index.html`](embed/index.h
|
|
|
174
207
|
> which is what havik-streams matches against; there is no `Origin` header on a
|
|
175
208
|
> top-level iframe nav.
|
|
176
209
|
|
|
210
|
+
The injected config also takes `analytics`, forwarded to the managed player.
|
|
211
|
+
Set it when `baseUrl` is not a `feed` host, or QoE beacons stay off. See
|
|
212
|
+
[Analytics](#analytics-qoe-beacons).
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
window.HAVIK_EMBED_CONFIG = {
|
|
216
|
+
baseUrl: 'https://cdn.example.com',
|
|
217
|
+
matchUrn: 'od:match:1234',
|
|
218
|
+
apiKey: 'pk_test_…',
|
|
219
|
+
parentOrigin: 'https://your-site.example',
|
|
220
|
+
analytics: { endpoint: 'https://beacons.oddin-video.gg' },
|
|
221
|
+
};
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`analytics` is read from the injected config only. It names a telemetry sink,
|
|
225
|
+
so the query string is not allowed to set one.
|
|
226
|
+
|
|
227
|
+
That has a consequence worth knowing before you pick a Mode C path.
|
|
228
|
+
`mountEmbed` passes its config to the embed page as query parameters, so it
|
|
229
|
+
cannot carry `analytics` either. If your `baseUrl` is not a `feed` host and
|
|
230
|
+
you need beacons, host the embed page yourself and inject the config. A
|
|
231
|
+
`mountEmbed` integration on a non-feed base has no way to turn analytics on.
|
|
232
|
+
|
|
177
233
|
---
|
|
178
234
|
|
|
179
235
|
## Live pickup (`waitForLive`)
|