@vindral/web-sdk 4.1.8 → 4.1.9-10-g6fb644c9

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
@@ -22,17 +22,6 @@ interface Channel {
22
22
  */
23
23
  timeshiftUrls?: string[];
24
24
  }
25
- interface ClientOverrides {
26
- maxVideoBitRate?: number;
27
- minBufferTime?: number;
28
- maxBufferTime?: number;
29
- burstEnabled?: boolean;
30
- sizeBasedResolutionCapEnabled?: boolean;
31
- separateVideoSocketEnabled?: boolean;
32
- videoCodecs?: string[];
33
- }
34
- type AudioCodec = "aac" | "opus" | "mp3";
35
- type VideoCodec = "h264" | "av1";
36
25
  interface MinMaxAverage {
37
26
  last: number;
38
27
  /**
@@ -105,44 +94,16 @@ type Tagged<BaseType, Tag extends PropertyKey> = BaseType & {
105
94
  [K in Tag]: void;
106
95
  };
107
96
  };
108
- type Namespace = Tagged<Array<string>, "Namespace">;
109
- interface TrackObject {
110
- namespace?: Namespace;
111
- name: string;
112
- format: string;
113
- label?: string;
114
- renderGroup?: number;
115
- altGroup?: number;
116
- initData?: string;
117
- initTrack?: string;
118
- depends?: Array<string>;
119
- temporalId?: number;
120
- spatialId?: number;
121
- codec?: string;
122
- mimeType?: string;
123
- framerate?: [
124
- number,
125
- number
126
- ];
127
- bitrate?: number;
128
- width?: number;
129
- height?: number;
130
- samplerate?: number;
131
- channelConfig?: string;
132
- displayWidth?: number;
133
- displayHeight?: number;
134
- language?: string;
135
- ["com.vindral.variant_uid"]?: string;
136
- ["com.vindral.drm"]?: string;
137
- }
138
- interface CatalogRoot {
139
- version: number;
140
- streamingFormat?: number;
141
- streamingFormatVersion?: string;
142
- }
143
- interface TracksCatalog extends CatalogRoot {
144
- namespace: Namespace;
145
- tracks: Array<TrackObject>;
97
+ type AudioCodec = "aac" | "opus" | "mp3";
98
+ type VideoCodec = "h264" | "av1";
99
+ interface ReconnectState {
100
+ /**
101
+ * The number or retry attempts so far.
102
+ * This gets reset on every successful connect, so it will start from zero every
103
+ * time the client instance gets disconnected and will increment until the
104
+ * client instance makes a connection attempt is successful.
105
+ */
106
+ reconnectRetries: number;
146
107
  }
147
108
  interface RenditionProps {
148
109
  id: number;
@@ -185,78 +146,6 @@ type VideoRendition = VideoRenditionProps & RenditionProps;
185
146
  type AudioRendition = AudioRenditionProps & RenditionProps;
186
147
  type TextRendition = TextRenditionProps & RenditionProps;
187
148
  type Rendition = VideoRendition | AudioRendition | TextRendition;
188
- interface Telemetry {
189
- url: string;
190
- probability?: number;
191
- includeErrors?: boolean;
192
- includeEvents?: boolean;
193
- includeStats?: boolean;
194
- maxRetries?: number;
195
- maxErrorReports?: number;
196
- interval?: number;
197
- }
198
- interface ChannelWithCatalog extends Channel {
199
- catalog: TracksCatalog;
200
- renditions: Rendition[];
201
- overrides?: ClientOverrides;
202
- }
203
- interface ChannelWithRenditions extends Channel {
204
- renditions: Rendition[];
205
- overrides?: ClientOverrides;
206
- }
207
- interface ServerCertificateHash {
208
- algorithm: string;
209
- value: string;
210
- }
211
- interface Edge {
212
- moqUrl?: string;
213
- moqWsUrl: string;
214
- serverCertificateHashes?: ServerCertificateHash[];
215
- }
216
- interface MoQConnectInfo {
217
- logsUrl?: string;
218
- statsUrl?: string;
219
- telemetry?: Telemetry;
220
- channels: ChannelWithCatalog[];
221
- edges: Edge[];
222
- timeshift: {
223
- urls: string[];
224
- duration: string;
225
- };
226
- }
227
- interface VindralConnectInfo {
228
- logsUrl?: string;
229
- statsUrl?: string;
230
- telemetry?: Telemetry;
231
- channels: ChannelWithRenditions[];
232
- edges: string[];
233
- }
234
- type ConnectInfo = VindralConnectInfo | MoQConnectInfo;
235
- interface Metadata {
236
- /**
237
- * The raw string content as it was ingested (if using JSON, it needs to be parsed on your end)
238
- */
239
- content: string;
240
- /**
241
- * Timestamp in ms
242
- */
243
- timestamp: number;
244
- }
245
- interface TimeRange {
246
- /** */
247
- start: number;
248
- /** */
249
- end: number;
250
- }
251
- interface ReconnectState {
252
- /**
253
- * The number or retry attempts so far.
254
- * This gets reset on every successful connect, so it will start from zero every
255
- * time the client instance gets disconnected and will increment until the
256
- * client instance makes a connection attempt is successful.
257
- */
258
- reconnectRetries: number;
259
- }
260
149
  interface Size {
261
150
  /** */
262
151
  width: number;
@@ -308,6 +197,7 @@ interface DrmOptions {
308
197
  };
309
198
  }
310
199
  type Media = "audio" | "video" | "audio+video";
200
+ type WebCodecsHardwareAccelerationPreference = "no-preference" | "prefer-hardware" | "prefer-software";
311
201
  interface Options {
312
202
  /**
313
203
  * URL to use when connecting to the stream
@@ -508,6 +398,38 @@ interface Options {
508
398
  * Enables iOS devices to use a media element for playback. This enables fullscreen and picture in picture support on iOS.
509
399
  */
510
400
  iosMediaElementEnabled?: boolean;
401
+ /**
402
+ * Enable WebCodecs API for hardware-accelerated decoding.
403
+ *
404
+ * When enabled, the browser's native VideoDecoder and AudioDecoder APIs will be used instead
405
+ * of WASM decoding on supported browsers (Chrome 94+, Edge 94+, Safari 16.4+). This provides:
406
+ * - Hardware-accelerated decoding (uses GPU for video)
407
+ * - Better performance at higher resolutions
408
+ * - Lower CPU usage and battery consumption
409
+ *
410
+ * Disabled by default to allow gradual rollout and testing.
411
+ *
412
+ * Note: Automatically falls back to WASM decoding if:
413
+ * - The browser doesn't support WebCodecs
414
+ * - WebCodecs initialization fails
415
+ * - This option is set to false or undefined
416
+ */
417
+ webcodecsEnabled?: boolean;
418
+ /**
419
+ * Hardware acceleration preference for WebCodecs video decoding.
420
+ *
421
+ * Defaults to `"no-preference"`.
422
+ */
423
+ webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference;
424
+ /**
425
+ * Enable OffscreenCanvas rendering in worker thread (requires webcodecsEnabled: true).
426
+ *
427
+ * When enabled, video rendering happens in the worker thread using OffscreenCanvas.
428
+ * Disabled by default to allow gradual rollout and testing.
429
+ *
430
+ * Note: Requires browser support for OffscreenCanvas and webcodecsEnabled must be true, and iosMediaElementEnabled must be false.
431
+ */
432
+ offscreenCanvasEnabled?: boolean;
511
433
  /**
512
434
  * Advanced options to override default behaviour.
513
435
  */
@@ -519,6 +441,120 @@ interface Options {
519
441
  */
520
442
  drm?: DrmOptions;
521
443
  }
444
+ interface ClientOverrides {
445
+ maxVideoBitRate?: number;
446
+ minBufferTime?: number;
447
+ maxBufferTime?: number;
448
+ burstEnabled?: boolean;
449
+ sizeBasedResolutionCapEnabled?: boolean;
450
+ separateVideoSocketEnabled?: boolean;
451
+ webcodecsEnabled?: boolean;
452
+ webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference;
453
+ offscreenCanvasEnabled?: boolean;
454
+ videoCodecs?: string[];
455
+ }
456
+ type Namespace = Tagged<Array<string>, "Namespace">;
457
+ interface TrackObject {
458
+ namespace?: Namespace;
459
+ name: string;
460
+ format: string;
461
+ label?: string;
462
+ renderGroup?: number;
463
+ altGroup?: number;
464
+ initData?: string;
465
+ initTrack?: string;
466
+ depends?: Array<string>;
467
+ temporalId?: number;
468
+ spatialId?: number;
469
+ codec?: string;
470
+ mimeType?: string;
471
+ framerate?: [
472
+ number,
473
+ number
474
+ ];
475
+ bitrate?: number;
476
+ width?: number;
477
+ height?: number;
478
+ samplerate?: number;
479
+ channelConfig?: string;
480
+ displayWidth?: number;
481
+ displayHeight?: number;
482
+ language?: string;
483
+ ["com.vindral.variant_uid"]?: string;
484
+ ["com.vindral.drm"]?: string;
485
+ }
486
+ interface CatalogRoot {
487
+ version: number;
488
+ streamingFormat?: number;
489
+ streamingFormatVersion?: string;
490
+ }
491
+ interface TracksCatalog extends CatalogRoot {
492
+ namespace: Namespace;
493
+ tracks: Array<TrackObject>;
494
+ }
495
+ interface Telemetry {
496
+ url: string;
497
+ probability?: number;
498
+ includeErrors?: boolean;
499
+ includeEvents?: boolean;
500
+ includeStats?: boolean;
501
+ maxRetries?: number;
502
+ maxErrorReports?: number;
503
+ interval?: number;
504
+ }
505
+ interface ChannelWithCatalog extends Channel {
506
+ catalog: TracksCatalog;
507
+ renditions: Rendition[];
508
+ overrides?: ClientOverrides;
509
+ }
510
+ interface ChannelWithRenditions extends Channel {
511
+ renditions: Rendition[];
512
+ overrides?: ClientOverrides;
513
+ }
514
+ interface ServerCertificateHash {
515
+ algorithm: string;
516
+ value: string;
517
+ }
518
+ interface Edge {
519
+ moqUrl?: string;
520
+ moqWsUrl: string;
521
+ serverCertificateHashes?: ServerCertificateHash[];
522
+ }
523
+ interface MoQConnectInfo {
524
+ logsUrl?: string;
525
+ statsUrl?: string;
526
+ telemetry?: Telemetry;
527
+ channels: ChannelWithCatalog[];
528
+ edges: Edge[];
529
+ timeshift: {
530
+ urls: string[];
531
+ duration: string;
532
+ };
533
+ }
534
+ interface VindralConnectInfo {
535
+ logsUrl?: string;
536
+ statsUrl?: string;
537
+ telemetry?: Telemetry;
538
+ channels: ChannelWithRenditions[];
539
+ edges: string[];
540
+ }
541
+ type ConnectInfo = VindralConnectInfo | MoQConnectInfo;
542
+ interface Metadata {
543
+ /**
544
+ * The raw string content as it was ingested (if using JSON, it needs to be parsed on your end)
545
+ */
546
+ content: string;
547
+ /**
548
+ * Timestamp in ms
549
+ */
550
+ timestamp: number;
551
+ }
552
+ interface TimeRange {
553
+ /** */
554
+ start: number;
555
+ /** */
556
+ end: number;
557
+ }
522
558
  interface RenditionLevel {
523
559
  /** */
524
560
  audio?: AudioRendition;
@@ -1760,6 +1796,9 @@ declare class Controller extends HTMLElement {
1760
1796
  "drm-playready-video-robustness",
1761
1797
  "drm-playready-audio-robustness",
1762
1798
  "webtransport-enabled",
1799
+ "webcodecs-enabled",
1800
+ "webcodecs-hardware-acceleration",
1801
+ "offscreen-canvas-enabled",
1763
1802
  "reconnect-retries",
1764
1803
  "auto-instance-enabled",
1765
1804
  "language"
@@ -1859,7 +1898,7 @@ declare class PlayButton extends VindralButton {
1859
1898
  type PlayerAttributes = (typeof Player.observedAttributes)[number];
1860
1899
  declare class Player extends HTMLElement {
1861
1900
  #private;
1862
- static observedAttributes: readonly ("title" | "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" | "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" | "offline" | "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" | "abr-enabled" | "size-based-resolution-cap-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" | "reconnect-retries" | "auto-instance-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1901
+ static observedAttributes: readonly ("title" | "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" | "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" | "offline" | "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" | "abr-enabled" | "size-based-resolution-cap-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" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1863
1902
  constructor();
1864
1903
  connectedCallback(): void;
1865
1904
  disconnectedCallback(): void;