@oddin-gg/havik-player 2.7.0 → 2.8.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
@@ -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
- baseUrl: 'https://feed-dev.oddin-video.gg',
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