@oddin-gg/havik-player 2.11.1 → 2.13.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 CHANGED
@@ -208,8 +208,9 @@ A ready-to-host template lives in the repo at [`embed/index.html`](embed/index.h
208
208
  > top-level iframe nav.
209
209
 
210
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).
211
+ A server from v0.10.0 names the beacons host itself, so this is only needed
212
+ against an older server when `baseUrl` is not a `feed` host. There, without
213
+ it, QoE beacons stay off. See [Analytics](#analytics-qoe-beacons).
213
214
 
214
215
  ```js
215
216
  window.HAVIK_EMBED_CONFIG = {
@@ -226,9 +227,11 @@ so the query string is not allowed to set one.
226
227
 
227
228
  That has a consequence worth knowing before you pick a Mode C path.
228
229
  `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.
230
+ cannot carry `analytics` either. Against a server from v0.10.0 that does not
231
+ matter: the server names the beacons host. Against an older server, if your
232
+ `baseUrl` is not a `feed` host and you need beacons, host the embed page
233
+ yourself and inject the config. There, a `mountEmbed` integration on a non-feed
234
+ base has no way to turn analytics on.
232
235
 
233
236
  ---
234
237
 
@@ -345,9 +348,28 @@ suspended (OS sleep, a frozen tab) for that long. The suspension gap never
345
348
  goes below five minutes, whatever `idleMs` is. The next `play()` reloads the
346
349
  stream as a fresh session.
347
350
 
348
- ### If your `baseUrl` is not a `feed` host, set `analytics.endpoint`
351
+ ### Where beacons go
349
352
 
350
- By default the beacons host is derived from `baseUrl` by hostname convention:
353
+ The streams server names the beacons host. From havik-streams v0.10.0, the
354
+ playback response carries it beside the `sid`. The SDK posts there whatever
355
+ your `baseUrl` is, including your own CDN or gateway hostname. You configure
356
+ nothing. The server's host also wins over `analytics.endpoint`: a differing
357
+ value is ignored, with one `console.warn` saying so. Only `analytics: false`
358
+ turns beacons off.
359
+
360
+ If your page sets a Content-Security-Policy, allow the beacons host in
361
+ `connect-src`: `https://beacons.oddin-video.gg` in production and
362
+ `https://beacons-dev.oddin-video.gg` in integration. If the policy blocks it,
363
+ playback is unaffected. The SDK prints one `console.warn` naming the origin to
364
+ add, and emits a non-fatal [`warning`](docs/API.md#player-events) event with
365
+ the same sentence. It then sends no more beacons from that page.
366
+
367
+ ### Against an older server: if your `baseUrl` is not a `feed` host, set `analytics.endpoint`
368
+
369
+ A server before v0.10.0 does not name the host. The SDK then falls back to the
370
+ rules below, exactly as before.
371
+
372
+ The beacons host is derived from `baseUrl` by hostname convention:
351
373
  `feed.<domain>` becomes `beacons.<domain>`, and `feed-dev.<domain>` becomes
352
374
  `beacons-dev.<domain>`. The rule is deliberately narrow. It maps only hosts
353
375
  whose first label is `feed` or `feed-*`. **Any other `baseUrl` derives nothing,