@oddin-gg/havik-player 2.11.1 → 2.12.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 +26 -7
- package/dist/havik-player.global.js +18 -18
- 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 +33 -15
- package/dist/index.d.ts +33 -15
- package/dist/index.js +356 -335
- package/dist/index.js.map +1 -1
- package/docs/API.md +48 -43
- package/embed/index.html +1 -1
- package/examples/vanilla.html +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -142,8 +142,10 @@ export declare interface CreatePlayerOptions {
|
|
|
142
142
|
* fronting the streams API, the CN plane, or a pinned build that must
|
|
143
143
|
* outlive a domain change.
|
|
144
144
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
145
|
+
* QoE beacons: havik-streams v0.10.0+ names the beacons host itself, so any
|
|
146
|
+
* base works. Against an older server, a base which is not a
|
|
147
|
+
* `feed[-dev].<domain>` host derives no beacons endpoint, so pair it with
|
|
148
|
+
* `analytics: { endpoint }`.
|
|
147
149
|
*/
|
|
148
150
|
baseUrl?: string;
|
|
149
151
|
matchUrn: string;
|
|
@@ -308,13 +310,17 @@ export declare interface CreatePlayerOptions {
|
|
|
308
310
|
/**
|
|
309
311
|
* QoE beacons + CMCD session attribution. Active only when the playback
|
|
310
312
|
* response carries an analytics sid (the server-side flag) — without one
|
|
311
|
-
* this option does nothing. Default: true
|
|
312
|
-
* derived from {@link baseUrl} by hostname convention (`feed[-dev].…` →
|
|
313
|
-
* `beacons[-dev].…`). Pass `false` to opt out entirely, or
|
|
314
|
-
* `{ endpoint }` to point at a non-conventional beacons host.
|
|
313
|
+
* this option does nothing. Default: true. Pass `false` to opt out entirely.
|
|
315
314
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
315
|
+
* Where beacons go: havik-streams v0.10.0+ names the beacons host in the
|
|
316
|
+
* playback response, and that host is used whatever {@link baseUrl} is —
|
|
317
|
+
* including a CDN or gateway fronting the streams API. It also wins over
|
|
318
|
+
* `{ endpoint }` (a differing value is ignored with one `console.warn`).
|
|
319
|
+
*
|
|
320
|
+
* Against an older server that names none, the endpoint is `{ endpoint }`
|
|
321
|
+
* if given, else derived from {@link baseUrl} by hostname convention
|
|
322
|
+
* (`feed[-dev].…` → `beacons[-dev].…`). If {@link baseUrl} is NOT a
|
|
323
|
+
* `feed[-dev].<domain>` host, nothing can be derived and beacons are
|
|
318
324
|
* disabled. That is reported, not silent: a `console.warn` naming the host
|
|
319
325
|
* (once per host) plus a non-fatal `warning` event. Supply `{ endpoint }`.
|
|
320
326
|
*
|
|
@@ -421,9 +427,11 @@ export declare interface EmbedConfig {
|
|
|
421
427
|
* there: `false` opts out, `{ endpoint }` names a beacons host.
|
|
422
428
|
*
|
|
423
429
|
* Mode C needs this for the same reason Mode A does, and until now had no
|
|
424
|
-
* way to say it.
|
|
425
|
-
*
|
|
426
|
-
*
|
|
430
|
+
* way to say it. Against a server that does not name the beacons host
|
|
431
|
+
* (havik-streams before v0.10.0), an embed whose `baseUrl` is not a
|
|
432
|
+
* `feed[-dev].<domain>` host — a CDN or gateway fronting the streams API —
|
|
433
|
+
* derives no beacons endpoint, so analytics is off and stays off. A server
|
|
434
|
+
* that names it needs no option here. Without this option the
|
|
427
435
|
* only remedy was to move `baseUrl` back onto a feed host, which is not a
|
|
428
436
|
* choice an integrator who fronts the API deliberately can make.
|
|
429
437
|
*
|
|
@@ -763,10 +771,12 @@ export declare interface MountEmbedOptions {
|
|
|
763
771
|
/**
|
|
764
772
|
* API base URL, forwarded to the embed page as a query parameter.
|
|
765
773
|
*
|
|
766
|
-
* ⚠️ QoE beacons:
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* `
|
|
774
|
+
* ⚠️ QoE beacons: havik-streams v0.10.0+ names the beacons host in the
|
|
775
|
+
* playback response, so any base works. Against an older server the
|
|
776
|
+
* endpoint is derived from this host by convention (`feed[-dev].<domain>` →
|
|
777
|
+
* `beacons[-dev].<domain>`). There, if your base is NOT a feed host,
|
|
778
|
+
* nothing derives and analytics is off — and `mountEmbed` CANNOT fix it,
|
|
779
|
+
* because the only client-side way to name an endpoint is
|
|
770
780
|
* {@link EmbedConfig.analytics}, which the embed page reads from injected
|
|
771
781
|
* config and deliberately never from the query string (a link must not be
|
|
772
782
|
* able to redirect a session's telemetry). Host the embed page yourself
|
|
@@ -1061,9 +1071,17 @@ export declare interface StreamDescriptor {
|
|
|
1061
1071
|
* id — non-secret by design (DRM remains the access gate) — echoed in CMCD
|
|
1062
1072
|
* query params on CDN requests and carried by QoE beacons. It lives only in
|
|
1063
1073
|
* memory for the duration of the session and is never persisted.
|
|
1074
|
+
*
|
|
1075
|
+
* `endpoint` is the QoE beacons origin the server names for this session
|
|
1076
|
+
* (e.g. `https://beacons.oddin-video.gg`; beacons POST to
|
|
1077
|
+
* `<endpoint>/v1/beacons`). Present only alongside a sid, and only from a
|
|
1078
|
+
* server new enough to send it; the SDK keeps it only when it is a bare
|
|
1079
|
+
* https origin. It takes precedence over the `analytics.endpoint` option and
|
|
1080
|
+
* over deriving a host from `baseUrl`.
|
|
1064
1081
|
*/
|
|
1065
1082
|
analytics?: {
|
|
1066
1083
|
sid?: string;
|
|
1084
|
+
endpoint?: string;
|
|
1067
1085
|
};
|
|
1068
1086
|
/** Any unrecognized top-level fields from the playback response (forward-compat). */
|
|
1069
1087
|
extensions?: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -142,8 +142,10 @@ export declare interface CreatePlayerOptions {
|
|
|
142
142
|
* fronting the streams API, the CN plane, or a pinned build that must
|
|
143
143
|
* outlive a domain change.
|
|
144
144
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
145
|
+
* QoE beacons: havik-streams v0.10.0+ names the beacons host itself, so any
|
|
146
|
+
* base works. Against an older server, a base which is not a
|
|
147
|
+
* `feed[-dev].<domain>` host derives no beacons endpoint, so pair it with
|
|
148
|
+
* `analytics: { endpoint }`.
|
|
147
149
|
*/
|
|
148
150
|
baseUrl?: string;
|
|
149
151
|
matchUrn: string;
|
|
@@ -308,13 +310,17 @@ export declare interface CreatePlayerOptions {
|
|
|
308
310
|
/**
|
|
309
311
|
* QoE beacons + CMCD session attribution. Active only when the playback
|
|
310
312
|
* response carries an analytics sid (the server-side flag) — without one
|
|
311
|
-
* this option does nothing. Default: true
|
|
312
|
-
* derived from {@link baseUrl} by hostname convention (`feed[-dev].…` →
|
|
313
|
-
* `beacons[-dev].…`). Pass `false` to opt out entirely, or
|
|
314
|
-
* `{ endpoint }` to point at a non-conventional beacons host.
|
|
313
|
+
* this option does nothing. Default: true. Pass `false` to opt out entirely.
|
|
315
314
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
315
|
+
* Where beacons go: havik-streams v0.10.0+ names the beacons host in the
|
|
316
|
+
* playback response, and that host is used whatever {@link baseUrl} is —
|
|
317
|
+
* including a CDN or gateway fronting the streams API. It also wins over
|
|
318
|
+
* `{ endpoint }` (a differing value is ignored with one `console.warn`).
|
|
319
|
+
*
|
|
320
|
+
* Against an older server that names none, the endpoint is `{ endpoint }`
|
|
321
|
+
* if given, else derived from {@link baseUrl} by hostname convention
|
|
322
|
+
* (`feed[-dev].…` → `beacons[-dev].…`). If {@link baseUrl} is NOT a
|
|
323
|
+
* `feed[-dev].<domain>` host, nothing can be derived and beacons are
|
|
318
324
|
* disabled. That is reported, not silent: a `console.warn` naming the host
|
|
319
325
|
* (once per host) plus a non-fatal `warning` event. Supply `{ endpoint }`.
|
|
320
326
|
*
|
|
@@ -421,9 +427,11 @@ export declare interface EmbedConfig {
|
|
|
421
427
|
* there: `false` opts out, `{ endpoint }` names a beacons host.
|
|
422
428
|
*
|
|
423
429
|
* Mode C needs this for the same reason Mode A does, and until now had no
|
|
424
|
-
* way to say it.
|
|
425
|
-
*
|
|
426
|
-
*
|
|
430
|
+
* way to say it. Against a server that does not name the beacons host
|
|
431
|
+
* (havik-streams before v0.10.0), an embed whose `baseUrl` is not a
|
|
432
|
+
* `feed[-dev].<domain>` host — a CDN or gateway fronting the streams API —
|
|
433
|
+
* derives no beacons endpoint, so analytics is off and stays off. A server
|
|
434
|
+
* that names it needs no option here. Without this option the
|
|
427
435
|
* only remedy was to move `baseUrl` back onto a feed host, which is not a
|
|
428
436
|
* choice an integrator who fronts the API deliberately can make.
|
|
429
437
|
*
|
|
@@ -763,10 +771,12 @@ export declare interface MountEmbedOptions {
|
|
|
763
771
|
/**
|
|
764
772
|
* API base URL, forwarded to the embed page as a query parameter.
|
|
765
773
|
*
|
|
766
|
-
* ⚠️ QoE beacons:
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* `
|
|
774
|
+
* ⚠️ QoE beacons: havik-streams v0.10.0+ names the beacons host in the
|
|
775
|
+
* playback response, so any base works. Against an older server the
|
|
776
|
+
* endpoint is derived from this host by convention (`feed[-dev].<domain>` →
|
|
777
|
+
* `beacons[-dev].<domain>`). There, if your base is NOT a feed host,
|
|
778
|
+
* nothing derives and analytics is off — and `mountEmbed` CANNOT fix it,
|
|
779
|
+
* because the only client-side way to name an endpoint is
|
|
770
780
|
* {@link EmbedConfig.analytics}, which the embed page reads from injected
|
|
771
781
|
* config and deliberately never from the query string (a link must not be
|
|
772
782
|
* able to redirect a session's telemetry). Host the embed page yourself
|
|
@@ -1061,9 +1071,17 @@ export declare interface StreamDescriptor {
|
|
|
1061
1071
|
* id — non-secret by design (DRM remains the access gate) — echoed in CMCD
|
|
1062
1072
|
* query params on CDN requests and carried by QoE beacons. It lives only in
|
|
1063
1073
|
* memory for the duration of the session and is never persisted.
|
|
1074
|
+
*
|
|
1075
|
+
* `endpoint` is the QoE beacons origin the server names for this session
|
|
1076
|
+
* (e.g. `https://beacons.oddin-video.gg`; beacons POST to
|
|
1077
|
+
* `<endpoint>/v1/beacons`). Present only alongside a sid, and only from a
|
|
1078
|
+
* server new enough to send it; the SDK keeps it only when it is a bare
|
|
1079
|
+
* https origin. It takes precedence over the `analytics.endpoint` option and
|
|
1080
|
+
* over deriving a host from `baseUrl`.
|
|
1064
1081
|
*/
|
|
1065
1082
|
analytics?: {
|
|
1066
1083
|
sid?: string;
|
|
1084
|
+
endpoint?: string;
|
|
1067
1085
|
};
|
|
1068
1086
|
/** Any unrecognized top-level fields from the playback response (forward-compat). */
|
|
1069
1087
|
extensions?: Record<string, unknown>;
|