@oddin-gg/havik-player 1.2.0 → 1.3.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/dist/index.d.cts CHANGED
@@ -95,7 +95,8 @@ export declare interface CreatePlayerOptions {
95
95
  * playback has fallen well behind. Default: true. Live/LL only.
96
96
  */
97
97
  snapToLiveOnRefocus?: boolean;
98
- /** Force an engine; 'auto' picks native HLS on Safari, hls.js elsewhere. Default: 'auto'. */
98
+ /** Force an engine; 'auto' prefers hls.js wherever supported (incl. modern
99
+ * Safari/iOS via ManagedMediaSource) and falls back to native HLS. Default: 'auto'. */
99
100
  engine?: 'auto' | 'hls' | 'native';
100
101
  /** Optional viewer id (X-User-Id on the license POST). */
101
102
  userId?: string;
@@ -186,11 +187,50 @@ export declare type CredentialSource = Credential_2 | (() => Credential_2 | Prom
186
187
  */
187
188
  export declare function deriveEventsBaseUrl(baseUrl: string): string | undefined;
188
189
 
190
+ /**
191
+ * Probe whether DRM playback can work here. Resolves — never rejects.
192
+ *
193
+ * Call it lazily (only for content whose descriptor says `drmEnabled`), CACHE
194
+ * the result yourself (probes are not memoized, and the EME spec allows each
195
+ * call to show consent prompts / trigger CDM downloads), and treat
196
+ * 'supported' as necessary-not-sufficient: the licence server, CORS
197
+ * onboarding and content packaging still have to cooperate.
198
+ */
199
+ export declare function detectDrmSupport(opts?: DetectDrmSupportOptions): Promise<DrmSupportResult>;
200
+
201
+ export declare interface DetectDrmSupportOptions {
202
+ /** Systems to probe, in order. Default: both. */
203
+ systems?: DrmSystem[];
204
+ /** OVERALL budget for the whole call before concluding 'probe-timeout' —
205
+ * shared across every probed system/stage, not per probe. Default 5000ms. */
206
+ timeoutMs?: number;
207
+ }
208
+
189
209
  export declare interface DrmInfo {
190
210
  widevine?: WidevineInfo;
191
211
  fairplay?: FairPlayInfo;
192
212
  }
193
213
 
214
+ export declare interface DrmSupportResult {
215
+ verdict: DrmSupportVerdict;
216
+ /** The first system that probed as working (when verdict is 'supported'). */
217
+ system?: DrmSystem;
218
+ /** Per-system outcome, for diagnostics/support bundles. */
219
+ detail: Partial<Record<DrmSystem, string>>;
220
+ }
221
+
222
+ export declare type DrmSupportVerdict =
223
+ /** At least one probed system produced working MediaKeys. */
224
+ 'supported'
225
+ /** EME exists but no probed system yields a CDM (e.g. iOS third-party browsers). */
226
+ | 'no-cdm'
227
+ /** Not a secure context — EME is unavailable by spec (http://<LAN-IP> dev, etc.). */
228
+ | 'insecure-context'
229
+ /** SecurityError: permissions-policy / iframe allow="encrypted-media" missing. */
230
+ | 'blocked-by-policy'
231
+ /** The access promise never settled within timeoutMs (some WebViews). */
232
+ | 'probe-timeout';
233
+
194
234
  export declare type DrmSystem = 'widevine' | 'fairplay';
195
235
 
196
236
  export declare interface EmbedConfig {
package/dist/index.d.ts CHANGED
@@ -95,7 +95,8 @@ export declare interface CreatePlayerOptions {
95
95
  * playback has fallen well behind. Default: true. Live/LL only.
96
96
  */
97
97
  snapToLiveOnRefocus?: boolean;
98
- /** Force an engine; 'auto' picks native HLS on Safari, hls.js elsewhere. Default: 'auto'. */
98
+ /** Force an engine; 'auto' prefers hls.js wherever supported (incl. modern
99
+ * Safari/iOS via ManagedMediaSource) and falls back to native HLS. Default: 'auto'. */
99
100
  engine?: 'auto' | 'hls' | 'native';
100
101
  /** Optional viewer id (X-User-Id on the license POST). */
101
102
  userId?: string;
@@ -186,11 +187,50 @@ export declare type CredentialSource = Credential_2 | (() => Credential_2 | Prom
186
187
  */
187
188
  export declare function deriveEventsBaseUrl(baseUrl: string): string | undefined;
188
189
 
190
+ /**
191
+ * Probe whether DRM playback can work here. Resolves — never rejects.
192
+ *
193
+ * Call it lazily (only for content whose descriptor says `drmEnabled`), CACHE
194
+ * the result yourself (probes are not memoized, and the EME spec allows each
195
+ * call to show consent prompts / trigger CDM downloads), and treat
196
+ * 'supported' as necessary-not-sufficient: the licence server, CORS
197
+ * onboarding and content packaging still have to cooperate.
198
+ */
199
+ export declare function detectDrmSupport(opts?: DetectDrmSupportOptions): Promise<DrmSupportResult>;
200
+
201
+ export declare interface DetectDrmSupportOptions {
202
+ /** Systems to probe, in order. Default: both. */
203
+ systems?: DrmSystem[];
204
+ /** OVERALL budget for the whole call before concluding 'probe-timeout' —
205
+ * shared across every probed system/stage, not per probe. Default 5000ms. */
206
+ timeoutMs?: number;
207
+ }
208
+
189
209
  export declare interface DrmInfo {
190
210
  widevine?: WidevineInfo;
191
211
  fairplay?: FairPlayInfo;
192
212
  }
193
213
 
214
+ export declare interface DrmSupportResult {
215
+ verdict: DrmSupportVerdict;
216
+ /** The first system that probed as working (when verdict is 'supported'). */
217
+ system?: DrmSystem;
218
+ /** Per-system outcome, for diagnostics/support bundles. */
219
+ detail: Partial<Record<DrmSystem, string>>;
220
+ }
221
+
222
+ export declare type DrmSupportVerdict =
223
+ /** At least one probed system produced working MediaKeys. */
224
+ 'supported'
225
+ /** EME exists but no probed system yields a CDM (e.g. iOS third-party browsers). */
226
+ | 'no-cdm'
227
+ /** Not a secure context — EME is unavailable by spec (http://<LAN-IP> dev, etc.). */
228
+ | 'insecure-context'
229
+ /** SecurityError: permissions-policy / iframe allow="encrypted-media" missing. */
230
+ | 'blocked-by-policy'
231
+ /** The access promise never settled within timeoutMs (some WebViews). */
232
+ | 'probe-timeout';
233
+
194
234
  export declare type DrmSystem = 'widevine' | 'fairplay';
195
235
 
196
236
  export declare interface EmbedConfig {