@vindral/web-sdk 4.1.10 → 4.2.0-10-g4d54d36c

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/react.d.ts CHANGED
@@ -65,6 +65,10 @@ declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<
65
65
  */
66
66
  once<T extends ArgLessEvents>(eventName: T, fn: () => void): void;
67
67
  once<T extends ArgEvents>(eventName: T, fn: (args: TEvents[T]) => void): void;
68
+ /**
69
+ * Check whether there are any listeners registered for the given event.
70
+ */
71
+ hasListeners<T extends keyof TEvents | keyof TEmits>(eventName: T): boolean;
68
72
  /**
69
73
  * Reset the event emitter
70
74
  */
@@ -137,72 +141,13 @@ interface ReconnectState {
137
141
  */
138
142
  reconnectRetries: number;
139
143
  }
140
- interface RenditionProps {
141
- id: number;
142
- /** */
143
- bitRate: number;
144
- /** */
145
- codecString?: string;
146
- /** */
147
- language?: string;
148
- /** */
149
- meta?: Record<string, string>;
150
- }
151
- interface VideoRenditionProps {
152
- /** */
153
- codec: VideoCodec;
154
- /** */
155
- frameRate: [
156
- number,
157
- number
158
- ];
159
- /** */
160
- width: number;
161
- /** */
162
- height: number;
163
- }
164
- interface AudioRenditionProps {
165
- /** */
166
- codec: AudioCodec;
167
- /** */
168
- channels: number;
169
- /** */
170
- sampleRate: number;
171
- }
172
- interface TextRenditionProps {
173
- codec: "webvtt";
174
- kind: "subtitles" | "captions";
175
- label?: string;
176
- }
177
- type VideoRendition = VideoRenditionProps & RenditionProps;
178
- type AudioRendition = AudioRenditionProps & RenditionProps;
179
- type TextRendition = TextRenditionProps & RenditionProps;
180
- type Rendition = VideoRendition | AudioRendition | TextRendition;
181
144
  interface Size {
182
145
  /** */
183
146
  width: number;
184
147
  /** */
185
148
  height: number;
186
149
  }
187
- interface VideoConstraint {
188
- /** */
189
- width: number;
190
- /** */
191
- height: number;
192
- /** */
193
- bitRate: number;
194
- /** */
195
- codec?: VideoCodec;
196
- /** */
197
- codecString?: string;
198
- }
199
150
  interface AdvancedOptions {
200
- /**
201
- * Constrains wasm decoding to this resolution.
202
- * By default it is set to 1280 in width and height.
203
- * This guarantees better performance on older devices and reduces battery drain in general.
204
- */
205
- wasmDecodingConstraint: Partial<VideoConstraint>;
206
151
  }
207
152
  interface DrmOptions {
208
153
  /**
@@ -230,6 +175,7 @@ interface DrmOptions {
230
175
  }
231
176
  type Media = "audio" | "video" | "audio+video";
232
177
  type WebCodecsHardwareAccelerationPreference = "no-preference" | "prefer-hardware" | "prefer-software";
178
+ type DecoderType = "mse" | "webcodecs" | "wasm";
233
179
  interface Options {
234
180
  /**
235
181
  * URL to use when connecting to the stream
@@ -296,11 +242,9 @@ interface Options {
296
242
  */
297
243
  burstEnabled?: boolean;
298
244
  /**
299
- * Enable usage of the MediaSource API on supported browsers.
300
- *
301
- * Is enabled by default.
302
- *
303
- * Note: We recommend to keep this at the default value unless you have very specific needs.
245
+ * @deprecated Use `decoders` instead.
246
+ * Setting `mseEnabled: false` is equivalent to `decoders: ["wasm"]`.
247
+ * When both `mseEnabled` and `decoders` are provided, `decoders` takes precedence.
304
248
  */
305
249
  mseEnabled?: boolean;
306
250
  /**
@@ -417,7 +361,7 @@ interface Options {
417
361
  * The wake lock requires that the audio has been activated at least once for the instance, othwerwise it will not work.
418
362
  * Other devices already provide wake lock by default.
419
363
  *
420
- * This option is redundant and has no effect if iosMediaElementEnabled is enabled since that automatically enables wake lock.
364
+ * This option is redundant and has no effect if streamToMediaElementEnabled is enabled since that automatically enables wake lock.
421
365
  *
422
366
  * Disabled by default.
423
367
  */
@@ -427,26 +371,20 @@ interface Options {
427
371
  */
428
372
  pauseSupportEnabled?: boolean;
429
373
  /**
430
- * Enables iOS devices to use a media element for playback. This enables fullscreen and picture in picture support on iOS.
431
- */
432
- iosMediaElementEnabled?: boolean;
433
- /**
434
- * Enable WebCodecs API for hardware-accelerated decoding.
374
+ * Stream canvas-rendered video/audio to a media element via captureStream.
435
375
  *
436
- * When enabled, the browser's native VideoDecoder and AudioDecoder APIs will be used instead
437
- * of WASM decoding on supported browsers (Chrome 94+, Edge 94+, Safari 16.4+). This provides:
438
- * - Hardware-accelerated decoding (uses GPU for video)
439
- * - Better performance at higher resolutions
440
- * - Lower CPU usage and battery consumption
376
+ * This enables platform media features such as fullscreen and picture-in-picture
377
+ * for non-MSE playback by routing the canvas output through a `<video>` element.
441
378
  *
442
- * Disabled by default to allow gradual rollout and testing.
379
+ * Disabled by default.
380
+ */
381
+ streamToMediaElementEnabled?: boolean;
382
+ /**
383
+ * @deprecated Use `streamToMediaElementEnabled` instead.
443
384
  *
444
- * Note: Automatically falls back to WASM decoding if:
445
- * - The browser doesn't support WebCodecs
446
- * - WebCodecs initialization fails
447
- * - This option is set to false or undefined
385
+ * Legacy alias kept for backwards compatibility.
448
386
  */
449
- webcodecsEnabled?: boolean;
387
+ iosMediaElementEnabled?: boolean;
450
388
  /**
451
389
  * Hardware acceleration preference for WebCodecs video decoding.
452
390
  *
@@ -454,14 +392,29 @@ interface Options {
454
392
  */
455
393
  webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference;
456
394
  /**
457
- * Enable OffscreenCanvas rendering in worker thread (requires webcodecsEnabled: true).
395
+ * Enable OffscreenCanvas rendering in worker thread.
458
396
  *
459
397
  * When enabled, video rendering happens in the worker thread using OffscreenCanvas.
460
- * Disabled by default to allow gradual rollout and testing.
398
+ * Automatically enabled when `decoders` resolves to WebCodecs. Set to `false`
399
+ * to explicitly disable even when WebCodecs is active.
461
400
  *
462
- * Note: Requires browser support for OffscreenCanvas and webcodecsEnabled must be true, and iosMediaElementEnabled must be false.
401
+ * Requires browser support for OffscreenCanvas and WebCodecs.
402
+ * Works with `streamToMediaElementEnabled` for fullscreen/PiP support.
463
403
  */
464
404
  offscreenCanvasEnabled?: boolean;
405
+ /**
406
+ * Ordered list of decoders to try.
407
+ *
408
+ * The runtime walks the list and uses the first decoder that is available on the
409
+ * current platform. When DRM is active, MSE is forced regardless of order.
410
+ *
411
+ * When omitted, the platform default order is used (`["mse", "wasm"]`).
412
+ *
413
+ * @example
414
+ * // Prefer WebCodecs over MSE
415
+ * decoders: ["webcodecs", "mse", "wasm"]
416
+ */
417
+ decoders?: DecoderType[];
465
418
  /**
466
419
  * Advanced options to override default behaviour.
467
420
  */
@@ -480,7 +433,6 @@ interface ClientOverrides {
480
433
  burstEnabled?: boolean;
481
434
  sizeBasedResolutionCapEnabled?: boolean;
482
435
  separateVideoSocketEnabled?: boolean;
483
- webcodecsEnabled?: boolean;
484
436
  webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference;
485
437
  offscreenCanvasEnabled?: boolean;
486
438
  videoCodecs?: string[];
@@ -524,6 +476,47 @@ interface TracksCatalog extends CatalogRoot {
524
476
  namespace: Namespace;
525
477
  tracks: Array<TrackObject>;
526
478
  }
479
+ interface RenditionProps {
480
+ id: number;
481
+ /** */
482
+ bitRate: number;
483
+ /** */
484
+ codecString?: string;
485
+ /** */
486
+ language?: string;
487
+ /** */
488
+ meta?: Record<string, string>;
489
+ }
490
+ interface VideoRenditionProps {
491
+ /** */
492
+ codec: VideoCodec;
493
+ /** */
494
+ frameRate: [
495
+ number,
496
+ number
497
+ ];
498
+ /** */
499
+ width: number;
500
+ /** */
501
+ height: number;
502
+ }
503
+ interface AudioRenditionProps {
504
+ /** */
505
+ codec: AudioCodec;
506
+ /** */
507
+ channels: number;
508
+ /** */
509
+ sampleRate: number;
510
+ }
511
+ interface TextRenditionProps {
512
+ codec: "webvtt";
513
+ kind: "subtitles" | "captions";
514
+ label?: string;
515
+ }
516
+ type VideoRendition = VideoRenditionProps & RenditionProps;
517
+ type AudioRendition = AudioRenditionProps & RenditionProps;
518
+ type TextRendition = TextRenditionProps & RenditionProps;
519
+ type Rendition = VideoRendition | AudioRendition | TextRendition;
527
520
  interface Telemetry {
528
521
  url: string;
529
522
  probability?: number;
@@ -787,6 +780,13 @@ interface DecoderStatistics {
787
780
  videoDecodeTime: MinMaxAverage;
788
781
  audioDecodeTime: MinMaxAverage;
789
782
  videoTransportTime: MinMaxAverage;
783
+ videoKeyframeIntervalMs?: number;
784
+ renderedFrameCount?: number;
785
+ rendererDroppedFrameCount?: number;
786
+ videoRenderer?: "OffscreenCanvas" | "Canvas" | "MSE";
787
+ videoDecoder?: "WebCodecs" | "WASM" | "MSE";
788
+ audioRenderer?: "AudioContext" | "MSE";
789
+ audioDecoder?: "WebCodecs" | "WASM" | "MSE";
790
790
  }
791
791
  interface DocumentStateModulesStatistics {
792
792
  isVisible: boolean;
@@ -836,6 +836,11 @@ interface MseModuleStatistics {
836
836
  droppedVideoFrames?: number;
837
837
  successfulVideoAppendCalls?: number;
838
838
  successfulAudioAppendsCalls?: number;
839
+ videoKeyframeIntervalMs?: number;
840
+ videoRenderer?: "OffscreenCanvas" | "Canvas" | "MSE";
841
+ videoDecoder?: "WebCodecs" | "WASM" | "MSE";
842
+ audioRenderer?: "AudioContext" | "MSE";
843
+ audioDecoder?: "WebCodecs" | "WASM" | "MSE";
839
844
  }
840
845
  interface QualityOfServiceModuleStatistics {
841
846
  /**
@@ -916,8 +921,6 @@ interface SyncModuleStatistics {
916
921
  interface VideoPlayerStatistics {
917
922
  renderedFrameCount: number;
918
923
  rendererDroppedFrameCount: number;
919
- contextLostCount: number;
920
- contextRestoredCount: number;
921
924
  }
922
925
  type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & JitterModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
923
926
  type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["getUserAgentInformation"]> & {
@@ -960,6 +963,8 @@ type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["getUserAge
960
963
  * Note that an actual frame render often happens much quicker, but that is not counted as TTFF.
961
964
  */
962
965
  timeToFirstFrame?: number;
966
+ streamToMediaElementEnabled?: boolean;
967
+ /** @deprecated */
963
968
  iosMediaElementEnabled?: boolean;
964
969
  /**
965
970
  * Average bitrate for the entire session in bits/second.
@@ -1026,6 +1031,8 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1026
1031
  private clientId;
1027
1032
  private _channels;
1028
1033
  private createdAt;
1034
+ private offscreenCanvasElement?;
1035
+ private webCodecsRenditionSupport;
1029
1036
  private hasCalledConnect;
1030
1037
  private latestEmittedLanguages;
1031
1038
  private wakeLock;
@@ -1036,6 +1043,7 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1036
1043
  private sizes;
1037
1044
  private isSuspended;
1038
1045
  private disconnectTimeout;
1046
+ private offscreenSubtitleInterval?;
1039
1047
  constructor(options: Options);
1040
1048
  /**
1041
1049
  * Attaches the video view to a DOM element. The Vindral video view will be sized to fill this element while
@@ -1044,6 +1052,7 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1044
1052
  * @returns
1045
1053
  */
1046
1054
  attach: (container: HTMLElement) => void;
1055
+ private setElement;
1047
1056
  /**
1048
1057
  * Set the current volume.
1049
1058
  * Setting this to 0 is not equivalent to muting the audio.
@@ -1154,6 +1163,14 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1154
1163
  * setting targetBufferTime within that range for consistancy if using both min/max.
1155
1164
  */
1156
1165
  set targetBufferTime(bufferTimeMs: number);
1166
+ /**
1167
+ * Update the dynamic buffer time configuration at runtime.
1168
+ * Allows adjusting min and max buffer time without recreating the Vindral instance.
1169
+ */
1170
+ updateBufferTimeConfig(config: {
1171
+ minBufferTime?: number;
1172
+ maxBufferTime?: number;
1173
+ }): void;
1157
1174
  /**
1158
1175
  * The estimated playback latency based on target buffer time, the connection rtt and local playback drift
1159
1176
  */
@@ -1264,6 +1281,10 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1264
1281
  * The ranges are specified in milliseconds.
1265
1282
  */
1266
1283
  get audioBufferedRanges(): ReadonlyArray<TimeRange>;
1284
+ /**
1285
+ * The timestamps (in milliseconds) of video keyframes currently in the buffer.
1286
+ */
1287
+ get videoKeyframeTimestamps(): ReadonlyArray<number>;
1267
1288
  /**
1268
1289
  * The API client for calls to the public available endpoints of the Vindral Live CDN.
1269
1290
  */
@@ -1323,9 +1344,16 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1323
1344
  private isSupportedVideoCodecProfile;
1324
1345
  private supportedAudioCodecs;
1325
1346
  private initializeDecodingModule;
1347
+ /**
1348
+ * Set up a polling interval that forwards subtitle cues to the decoder worker
1349
+ * when OffscreenCanvas rendering is active. This is needed because the canvas modules'
1350
+ * own subtitle intervals either get killed (LegacyCanvasModule) or don't have the
1351
+ * OffscreenCanvas reference at construction time (ModernCanvasModule).
1352
+ */
1353
+ private setupOffscreenSubtitleRouting;
1326
1354
  /**
1327
1355
  * Fully unloads the instance. This disconnects the clients and stops any background tasks.
1328
- * This client instance can not be used after this has been called.
1356
+ * This client instance cannot be used after this has been called.
1329
1357
  */
1330
1358
  unload: () => Promise<void>;
1331
1359
  /**
@@ -1389,7 +1417,17 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1389
1417
  private get currentSubscription();
1390
1418
  private get targetSubscription();
1391
1419
  private timeToFirstFrame;
1420
+ private resolvedDecoder;
1392
1421
  private willUseMediaSource;
1422
+ private shouldUseWebCodecs;
1423
+ private isWebCodecsVideoAvailable;
1424
+ private isWebCodecsAudioAvailable;
1425
+ /**
1426
+ * Returns true if OffscreenCanvas should be used.
1427
+ * Implicitly enabled when the resolved decoder is WebCodecs, since OffscreenCanvas
1428
+ * is the optimal rendering path for WebCodecs (worker renders VideoFrames directly).
1429
+ */
1430
+ private shouldUseOffscreenCanvas;
1393
1431
  }
1394
1432
  interface TelemetryModuleStatistics {
1395
1433
  /**
@@ -1453,6 +1491,12 @@ interface TimeShiftInfo {
1453
1491
  urls: string[];
1454
1492
  duration: string;
1455
1493
  }
1494
+ interface CmafFragmentEvent {
1495
+ mediaType: "video" | "audio";
1496
+ initSegment: Readonly<Uint8Array<ArrayBuffer>>;
1497
+ fragment: Readonly<Uint8Array<ArrayBuffer>>;
1498
+ isKeyframe: boolean;
1499
+ }
1456
1500
  interface PublicVindralEvents {
1457
1501
  /**
1458
1502
  * When an error that requires action has occured
@@ -1553,6 +1597,13 @@ interface PublicVindralEvents {
1553
1597
  * Emitted when the timeshift URLs are updated.
1554
1598
  */
1555
1599
  ["timeshift info"]: Readonly<TimeShiftInfo>;
1600
+ /**
1601
+ * Emitted for each CMAF fragment received via the MoQ/VoQ path.
1602
+ * Contains raw fMP4 bytes suitable for recording.
1603
+ *
1604
+ * @internal Not part of the public API — may change without notice.
1605
+ */
1606
+ ["cmaf fragment"]: Readonly<CmafFragmentEvent>;
1556
1607
  ["buffer state event"]: Readonly<BufferStateEvent>;
1557
1608
  ["initialized media"]: void;
1558
1609
  }
@@ -1798,7 +1849,7 @@ type ControllerAttributes = (typeof Controller.observedAttributes)[number];
1798
1849
  declare class Controller extends HTMLElement {
1799
1850
  #private;
1800
1851
  static observedAttributes: readonly [
1801
- ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src")[],
1852
+ ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "debug-panel-open" | "target-buffer-time" | "drift" | "playback-latency" | "connection-state")[],
1802
1853
  "url",
1803
1854
  "edge-url",
1804
1855
  "target-buffer-time",
@@ -1815,6 +1866,7 @@ declare class Controller extends HTMLElement {
1815
1866
  "mse-opus-enabled",
1816
1867
  "ios-background-play-enabled",
1817
1868
  "ios-wake-lock-enabled",
1869
+ "stream-to-media-element-enabled",
1818
1870
  "ios-media-element-enabled",
1819
1871
  "abr-enabled",
1820
1872
  "size-based-resolution-cap-enabled",
@@ -1829,8 +1881,8 @@ declare class Controller extends HTMLElement {
1829
1881
  "drm-playready-video-robustness",
1830
1882
  "drm-playready-audio-robustness",
1831
1883
  "webtransport-enabled",
1832
- "webcodecs-enabled",
1833
1884
  "webcodecs-hardware-acceleration",
1885
+ "decoders",
1834
1886
  "offscreen-canvas-enabled",
1835
1887
  "reconnect-retries",
1836
1888
  "auto-instance-enabled",
@@ -1920,7 +1972,7 @@ declare class PlayButton extends VindralButton {
1920
1972
  type PlayerAttributes = (typeof Player.observedAttributes)[number];
1921
1973
  declare class Player extends HTMLElement {
1922
1974
  #private;
1923
- static observedAttributes: readonly ("title" | "offline" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "url" | "edge-url" | "target-buffer-time" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "min-buffer-time" | "max-buffer-time" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "ios-media-element-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "webcodecs-enabled" | "webcodecs-hardware-acceleration" | "offscreen-canvas-enabled" | "reconnect-retries" | "auto-instance-enabled" | "advanced-rendition-menu-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1975
+ static observedAttributes: readonly ("title" | "offline" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "debug-panel-open" | "target-buffer-time" | "drift" | "playback-latency" | "connection-state" | "url" | "decoders" | "min-buffer-time" | "max-buffer-time" | "edge-url" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "stream-to-media-element-enabled" | "ios-media-element-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "webcodecs-hardware-acceleration" | "offscreen-canvas-enabled" | "reconnect-retries" | "auto-instance-enabled" | "advanced-rendition-menu-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1924
1976
  constructor();
1925
1977
  connectedCallback(): void;
1926
1978
  disconnectedCallback(): void;
package/react.js CHANGED
@@ -1 +0,0 @@
1
-
@@ -1,2 +1,5 @@
1
- import { registerComponents as o } from "./player.js";
2
- o();
1
+ import "./Ca_SaIRU.js";
2
+ import { t as e } from "./RV4C9s9Z.js";
3
+ //#region src/vindral-player-component.ts
4
+ e();
5
+ //#endregion
package/wVqDCoXH.js ADDED
@@ -0,0 +1,223 @@
1
+ import { n as e } from "./BsfwXDui.js";
2
+ import { a as t, n, r } from "./B7hT-BKr.js";
3
+ //#region ../../libs/utils/src/formatting.ts
4
+ var i = 1e3, a = i * 1e3, o = a * 1e3, s = (e, t, n) => e % t === 0 ? e / t : (e / t).toFixed(n), c = (e, t = 1) => e >= o ? `${s(e, o, t)} Gbit/s` : e >= a ? `${s(e, a, t)} Mbit/s` : e >= i ? `${s(e, i, t)} Kbit/s` : `${e} bit/s`, l = ({ width: e, height: t }) => `${e}x${t}`, u = {
5
+ PAUSED: "paused",
6
+ MUTED: "muted",
7
+ USER_INTERACTING: "user-interacting",
8
+ IS_CASTING: "is-casting",
9
+ CAST_AVAILABLE: "cast-available",
10
+ CAST_RECEIVER_NAME: "cast-receiver-name",
11
+ BUFFERING: "buffering",
12
+ UI_LOCKED: "ui-locked",
13
+ HIDE_UI_ON_PAUSE: "hide-ui-on-pause",
14
+ FULLSCREEN: "is-fullscreen",
15
+ FULLSCREEN_FALLBACK: "is-fullscreen-fallback",
16
+ RENDITION_LEVELS: "rendition-levels",
17
+ RENDITION_LEVEL: "rendition-level",
18
+ MAX_VIDEO_BITRATE: "max-video-bit-rate",
19
+ MAX_INITIAL_BITRATE: "max-initial-bit-rate",
20
+ ABR_ENABLED: "abr-enabled",
21
+ SIZE_BASED_RESOLUTION_CAP_ENABLED: "size-based-resolution-cap-enabled",
22
+ CHANNELS: "channels",
23
+ CHANNEL_ID: "channel-id",
24
+ CHANNEL_GROUP_ID: "channel-group-id",
25
+ PIP_AVAILABLE: "pip-available",
26
+ IS_PIP: "is-pip",
27
+ AIRPLAY_AVAILABLE: "airplay-available",
28
+ IS_AIRPLAYING: "is-airplaying",
29
+ MEDIA: "media",
30
+ LANGUAGES: "languages",
31
+ LANGUAGE: "language",
32
+ TEXT_TRACKS: "text-tracks",
33
+ TEXT_TRACK: "text-track",
34
+ NEEDS_USER_INPUT_VIDEO: "needs-user-input-video",
35
+ NEEDS_USER_INPUT_AUDIO: "needs-user-input-audio",
36
+ AUTHENTICATION_TOKEN: "authentication-token",
37
+ VOLUME: "volume",
38
+ VOLUME_LEVEL: "volume-level",
39
+ CAST_ENABLED: "cast",
40
+ AIRPLAY_ENABLED: "airplay",
41
+ PIP_ENABLED: "pip",
42
+ FULLSCREEN_ENABLED: "fullscreen",
43
+ VU_METER_ENABLED: "vu-meter",
44
+ TIMESHIFT_ENABLED: "timeshift",
45
+ TIMESHIFT_POSITION: "timeshift-position",
46
+ POSTER_SRC: "poster-src",
47
+ DURATION: "duration",
48
+ DEBUG_PANEL_OPEN: "debug-panel-open",
49
+ TARGET_BUFFER_TIME: "target-buffer-time",
50
+ DRIFT: "drift",
51
+ PLAYBACK_LATENCY: "playback-latency",
52
+ CONNECTION_STATE: "connection-state"
53
+ }, d = Object.values(u), f = {
54
+ PLAY: "play",
55
+ PAUSE: "pause",
56
+ MUTE: "mute",
57
+ UNMUTE: "unmute",
58
+ LOCK_UI: "lock-ui",
59
+ UNLOCK_UI: "unlock-ui",
60
+ ENTER_FULLSCREEN: "enter-fullscreen",
61
+ EXIT_FULLSCREEN: "exit-fullscreen",
62
+ SET_RENDITION: "set-rendition",
63
+ SET_ABR_MODE: "set-abr-mode",
64
+ SET_SIZE_BASED_RESOLUTION_CAP_MODE: "set-size-based-resolution-cap-mode",
65
+ CHANNEL_GRID_OPENED: "channel-grid-opened",
66
+ CHANNEL_GRID_CLOSED: "channel-grid-closed",
67
+ ENTER_PIP: "enter-pip",
68
+ EXIT_PIP: "exit-pip",
69
+ REQUEST_AIRPLAY: "request-airplay",
70
+ SET_LANGUAGE: "set-language",
71
+ SET_TEXT_TRACK: "set-text-track",
72
+ REQUEST_USER_INPUT: "request-user-input",
73
+ SET_VOLUME: "set-volume",
74
+ SEEK: "seek",
75
+ GO_LIVE: "go-live",
76
+ TOGGLE_DEBUG_PANEL: "toggle-debug-panel",
77
+ SET_TARGET_BUFFER_TIME: "set-target-buffer-time"
78
+ };
79
+ //#endregion
80
+ //#region ../../libs/player-next/src/utils/vindralAttributesUtils.ts
81
+ function p(e) {
82
+ return e === "audio" || e === "video" || e === "audio+video" ? e : "audio+video";
83
+ }
84
+ function m(e) {
85
+ return e === "trace" || e === "debug" || e === "info" || e === "warn" || e === "error" || e === "off" ? e : "off";
86
+ }
87
+ function h(e) {
88
+ if (e === null) return;
89
+ let t = e.split(",").map((e) => e.trim()).filter((e) => e === "h264" || e === "av1");
90
+ if (t.length !== 0) return t;
91
+ }
92
+ function g(e) {
93
+ if (e !== null) try {
94
+ let t = JSON.parse(e);
95
+ if (typeof t == "object" && t) {
96
+ let e = t;
97
+ if (typeof e.width == "number" && typeof e.height == "number") return e;
98
+ }
99
+ } catch (e) {
100
+ return;
101
+ }
102
+ }
103
+ function _(e) {
104
+ if (e !== null) try {
105
+ let t = JSON.parse(e);
106
+ if (typeof t == "object" && t) return t;
107
+ } catch (e) {
108
+ return;
109
+ }
110
+ }
111
+ function v(e) {
112
+ if (e === null) return;
113
+ let t = parseFloat(e);
114
+ return isNaN(t) ? void 0 : t;
115
+ }
116
+ function y(e) {
117
+ return typeof e == "string";
118
+ }
119
+ function b(e, t) {
120
+ if (e === null) return t == null ? void 0 : t;
121
+ let n = e.toLowerCase();
122
+ return n === "false" ? !1 : n === "true" || n === "" || t == null ? !0 : t;
123
+ }
124
+ function x(e, t) {
125
+ return e === null ? t == null ? void 0 : t : e === "" || e.toLowerCase() === "true" ? !0 : e.toLowerCase() === "false" ? !1 : e;
126
+ }
127
+ function S(e) {
128
+ if (e === null) return;
129
+ let t = {}, n = e.split(",");
130
+ for (let e of n) {
131
+ let [n, r] = e.split(":");
132
+ n && r && (t[n.trim()] = r.trim());
133
+ }
134
+ return Object.keys(t).length > 0 ? t : void 0;
135
+ }
136
+ function C(e) {
137
+ if (e === null) return;
138
+ let t = e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
139
+ return t.length > 0 ? t : void 0;
140
+ }
141
+ //#endregion
142
+ //#region ../../libs/player-next/src/components/VindralButton.ts
143
+ var w = document.createElement("template");
144
+ w.innerHTML = "\n <style>\n :host {\n cursor: pointer;\n color: var(--fg-strong);\n padding: var(--button-padding);\n background: transparent;\n transition: background 0.2s linear;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host(:focus-visible) {\n box-shadow: inset 0 0 0 2px var(--fg-strong);\n outline: 0;\n }\n\n :host(:where(:focus)) {\n box-shadow: none;\n outline: 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n :host(:hover) {\n background: rgba(255, 255, 255, 0.15);\n }\n }\n\n :host(:active) {\n background: rgba(255, 255, 255, 0.25);\n }\n\n :host(:active) svg {\n scale: 0.9;\n }\n\n :host([disabled]) {\n opacity: 0.5;\n background: transparent;\n }\n\n slot > svg {\n display: block;\n width: var(--button-icon-size);\n height: var(--button-icon-size);\n }\n </style>\n";
145
+ var T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), k = class extends HTMLElement {
146
+ constructor() {
147
+ super(), t(this, T, null), t(this, E, (e) => {
148
+ this.handleClick(e);
149
+ }), t(this, D, (e) => {
150
+ let { key: t } = e;
151
+ if (!this.keysUsed.includes(t)) {
152
+ this.removeEventListener("keyup", n(D, this));
153
+ return;
154
+ }
155
+ this.handleClick(e);
156
+ }), t(this, O, (e) => {
157
+ let { metaKey: t, altKey: r, key: i } = e;
158
+ if (t || r || !this.keysUsed.includes(i)) {
159
+ this.removeEventListener("keyup", n(D, this));
160
+ return;
161
+ }
162
+ this.addEventListener("keyup", n(D, this), { once: !0 });
163
+ }), this.attachShadow({ mode: "open" }).appendChild(w.content.cloneNode(!0));
164
+ }
165
+ get keysUsed() {
166
+ return ["Enter", " "];
167
+ }
168
+ connectedCallback() {
169
+ var e;
170
+ r(T, this, this.closest("vindral-controller")), (e = n(T, this)) == null || e.connectListener(this), this.hasAttribute("disabled") || this.enable(), this.setAttribute("role", "button");
171
+ }
172
+ enable() {
173
+ this.addEventListener("click", n(E, this)), this.addEventListener("keydown", n(O, this)), this.tabIndex = 0;
174
+ }
175
+ disable() {
176
+ this.removeEventListener("click", n(E, this)), this.removeEventListener("keydown", n(O, this)), this.removeEventListener("keyup", n(D, this)), this.tabIndex = -1;
177
+ }
178
+ disconnectedCallback() {
179
+ var e;
180
+ (e = n(T, this)) == null || e.disconnectListener(this);
181
+ }
182
+ attributeChangedCallback(e, t, n) {
183
+ e === "disabled" && (y(n) ? this.disable() : this.enable());
184
+ }
185
+ };
186
+ e(k, "observedAttributes", ["disabled"]);
187
+ //#endregion
188
+ //#region \0@oxc-project+runtime@0.115.0/helpers/getPrototypeOf.js
189
+ function A(e) {
190
+ return A = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
191
+ return e.__proto__ || Object.getPrototypeOf(e);
192
+ }, A(e);
193
+ }
194
+ //#endregion
195
+ //#region \0@oxc-project+runtime@0.115.0/helpers/superPropBase.js
196
+ function j(e, t) {
197
+ for (; !{}.hasOwnProperty.call(e, t) && (e = A(e)) !== null;);
198
+ return e;
199
+ }
200
+ //#endregion
201
+ //#region \0@oxc-project+runtime@0.115.0/helpers/get.js
202
+ function M() {
203
+ return M = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(e, t, n) {
204
+ var r = j(e, t);
205
+ if (r) {
206
+ var i = Object.getOwnPropertyDescriptor(r, t);
207
+ return i.get ? i.get.call(arguments.length < 3 ? e : n) : i.value;
208
+ }
209
+ }, M.apply(null, arguments);
210
+ }
211
+ //#endregion
212
+ //#region \0@oxc-project+runtime@0.115.0/helpers/superPropGet.js
213
+ function N(e, t, n, r) {
214
+ var i = M(A(1 & r ? e.prototype : e), t, n);
215
+ return 2 & r && typeof i == "function" ? function(e) {
216
+ return i.apply(n, e);
217
+ } : i;
218
+ }
219
+ //#endregion
220
+ //#region ../../libs/player-next/src/constants.ts
221
+ var P = 5e3;
222
+ //#endregion
223
+ export { d as _, _ as a, m as c, p as d, v as f, u as g, f as h, y as i, S as l, h as m, N as n, b as o, C as p, k as r, x as s, P as t, g as u, c as v, l as y };