@vindral/web-sdk 4.1.9 → 4.1.10

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/core.d.ts CHANGED
@@ -20,17 +20,6 @@ interface Channel {
20
20
  */
21
21
  timeshiftUrls?: string[];
22
22
  }
23
- interface ClientOverrides {
24
- maxVideoBitRate?: number;
25
- minBufferTime?: number;
26
- maxBufferTime?: number;
27
- burstEnabled?: boolean;
28
- sizeBasedResolutionCapEnabled?: boolean;
29
- separateVideoSocketEnabled?: boolean;
30
- videoCodecs?: string[];
31
- }
32
- export type AudioCodec = "aac" | "opus" | "mp3";
33
- export type VideoCodec = "h264" | "av1";
34
23
  interface MinMaxAverage {
35
24
  last: number;
36
25
  /**
@@ -103,44 +92,51 @@ type Tagged<BaseType, Tag extends PropertyKey> = BaseType & {
103
92
  [K in Tag]: void;
104
93
  };
105
94
  };
106
- type Namespace = Tagged<Array<string>, "Namespace">;
107
- interface TrackObject {
108
- namespace?: Namespace;
109
- name: string;
110
- format: string;
111
- label?: string;
112
- renderGroup?: number;
113
- altGroup?: number;
114
- initData?: string;
115
- initTrack?: string;
116
- depends?: Array<string>;
117
- temporalId?: number;
118
- spatialId?: number;
119
- codec?: string;
120
- mimeType?: string;
121
- framerate?: [
122
- number,
123
- number
124
- ];
125
- bitrate?: number;
126
- width?: number;
127
- height?: number;
128
- samplerate?: number;
129
- channelConfig?: string;
130
- displayWidth?: number;
131
- displayHeight?: number;
132
- language?: string;
133
- ["com.vindral.variant_uid"]?: string;
134
- ["com.vindral.drm"]?: string;
135
- }
136
- interface CatalogRoot {
137
- version: number;
138
- streamingFormat?: number;
139
- streamingFormatVersion?: string;
95
+ declare class UserAgentInformation {
96
+ private highEntropyValues?;
97
+ constructor();
98
+ getUserAgentInformation(): {
99
+ locationOrigin: string;
100
+ locationPath: string;
101
+ ancestorOrigins: string[] | undefined;
102
+ hardwareConcurrency: number;
103
+ deviceMemory: number | undefined;
104
+ userAgentLegacy: string;
105
+ ua: {
106
+ browser: {
107
+ brands: string[];
108
+ fullVersionBrands: string[];
109
+ majorVersions: string[];
110
+ };
111
+ device: string;
112
+ os: {
113
+ family: string;
114
+ version: string;
115
+ major_version: number;
116
+ };
117
+ };
118
+ } | {
119
+ locationOrigin: string;
120
+ locationPath: string;
121
+ ancestorOrigins: string[] | undefined;
122
+ hardwareConcurrency: number;
123
+ deviceMemory: number | undefined;
124
+ userAgent: string;
125
+ };
140
126
  }
141
- interface TracksCatalog extends CatalogRoot {
142
- namespace: Namespace;
143
- tracks: Array<TrackObject>;
127
+ export type AudioCodec = "aac" | "opus" | "mp3";
128
+ export type VideoCodec = "h264" | "av1";
129
+ /**
130
+ * The current reconnect state to use to decide whether to kep reconnecting or not
131
+ */
132
+ export interface ReconnectState {
133
+ /**
134
+ * The number or retry attempts so far.
135
+ * This gets reset on every successful connect, so it will start from zero every
136
+ * time the client instance gets disconnected and will increment until the
137
+ * client instance makes a connection attempt is successful.
138
+ */
139
+ reconnectRetries: number;
144
140
  }
145
141
  interface RenditionProps {
146
142
  id: number;
@@ -189,85 +185,6 @@ export type VideoRendition = VideoRenditionProps & RenditionProps;
189
185
  export type AudioRendition = AudioRenditionProps & RenditionProps;
190
186
  type TextRendition = TextRenditionProps & RenditionProps;
191
187
  type Rendition = VideoRendition | AudioRendition | TextRendition;
192
- interface Telemetry {
193
- url: string;
194
- probability?: number;
195
- includeErrors?: boolean;
196
- includeEvents?: boolean;
197
- includeStats?: boolean;
198
- maxRetries?: number;
199
- maxErrorReports?: number;
200
- interval?: number;
201
- }
202
- interface ChannelWithCatalog extends Channel {
203
- catalog: TracksCatalog;
204
- renditions: Rendition[];
205
- overrides?: ClientOverrides;
206
- }
207
- interface ChannelWithRenditions extends Channel {
208
- renditions: Rendition[];
209
- overrides?: ClientOverrides;
210
- }
211
- interface ServerCertificateHash {
212
- algorithm: string;
213
- value: string;
214
- }
215
- interface Edge {
216
- moqUrl?: string;
217
- moqWsUrl: string;
218
- serverCertificateHashes?: ServerCertificateHash[];
219
- }
220
- interface MoQConnectInfo {
221
- logsUrl?: string;
222
- statsUrl?: string;
223
- telemetry?: Telemetry;
224
- channels: ChannelWithCatalog[];
225
- edges: Edge[];
226
- timeshift: {
227
- urls: string[];
228
- duration: string;
229
- };
230
- }
231
- interface VindralConnectInfo {
232
- logsUrl?: string;
233
- statsUrl?: string;
234
- telemetry?: Telemetry;
235
- channels: ChannelWithRenditions[];
236
- edges: string[];
237
- }
238
- type ConnectInfo = VindralConnectInfo | MoQConnectInfo;
239
- /**
240
- * Represents a timed metadata event
241
- */
242
- export interface Metadata {
243
- /**
244
- * The raw string content as it was ingested (if using JSON, it needs to be parsed on your end)
245
- */
246
- content: string;
247
- /**
248
- * Timestamp in ms
249
- */
250
- timestamp: number;
251
- }
252
- /** */
253
- export interface TimeRange {
254
- /** */
255
- start: number;
256
- /** */
257
- end: number;
258
- }
259
- /**
260
- * The current reconnect state to use to decide whether to kep reconnecting or not
261
- */
262
- export interface ReconnectState {
263
- /**
264
- * The number or retry attempts so far.
265
- * This gets reset on every successful connect, so it will start from zero every
266
- * time the client instance gets disconnected and will increment until the
267
- * client instance makes a connection attempt is successful.
268
- */
269
- reconnectRetries: number;
270
- }
271
188
  /**
272
189
  * Represents a size with a width and height.
273
190
  */
@@ -331,6 +248,7 @@ export interface DrmOptions {
331
248
  * Type of media.
332
249
  */
333
250
  export type Media = "audio" | "video" | "audio+video";
251
+ type WebCodecsHardwareAccelerationPreference = "no-preference" | "prefer-hardware" | "prefer-software";
334
252
  /**
335
253
  * Options for the Vindral instance
336
254
  *
@@ -535,6 +453,38 @@ export interface Options {
535
453
  * Enables iOS devices to use a media element for playback. This enables fullscreen and picture in picture support on iOS.
536
454
  */
537
455
  iosMediaElementEnabled?: boolean;
456
+ /**
457
+ * Enable WebCodecs API for hardware-accelerated decoding.
458
+ *
459
+ * When enabled, the browser's native VideoDecoder and AudioDecoder APIs will be used instead
460
+ * of WASM decoding on supported browsers (Chrome 94+, Edge 94+, Safari 16.4+). This provides:
461
+ * - Hardware-accelerated decoding (uses GPU for video)
462
+ * - Better performance at higher resolutions
463
+ * - Lower CPU usage and battery consumption
464
+ *
465
+ * Disabled by default to allow gradual rollout and testing.
466
+ *
467
+ * Note: Automatically falls back to WASM decoding if:
468
+ * - The browser doesn't support WebCodecs
469
+ * - WebCodecs initialization fails
470
+ * - This option is set to false or undefined
471
+ */
472
+ webcodecsEnabled?: boolean;
473
+ /**
474
+ * Hardware acceleration preference for WebCodecs video decoding.
475
+ *
476
+ * Defaults to `"no-preference"`.
477
+ */
478
+ webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference;
479
+ /**
480
+ * Enable OffscreenCanvas rendering in worker thread (requires webcodecsEnabled: true).
481
+ *
482
+ * When enabled, video rendering happens in the worker thread using OffscreenCanvas.
483
+ * Disabled by default to allow gradual rollout and testing.
484
+ *
485
+ * Note: Requires browser support for OffscreenCanvas and webcodecsEnabled must be true, and iosMediaElementEnabled must be false.
486
+ */
487
+ offscreenCanvasEnabled?: boolean;
538
488
  /**
539
489
  * Advanced options to override default behaviour.
540
490
  */
@@ -546,6 +496,124 @@ export interface Options {
546
496
  */
547
497
  drm?: DrmOptions;
548
498
  }
499
+ interface ClientOverrides {
500
+ maxVideoBitRate?: number;
501
+ minBufferTime?: number;
502
+ maxBufferTime?: number;
503
+ burstEnabled?: boolean;
504
+ sizeBasedResolutionCapEnabled?: boolean;
505
+ separateVideoSocketEnabled?: boolean;
506
+ webcodecsEnabled?: boolean;
507
+ webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference;
508
+ offscreenCanvasEnabled?: boolean;
509
+ videoCodecs?: string[];
510
+ }
511
+ type Namespace = Tagged<Array<string>, "Namespace">;
512
+ interface TrackObject {
513
+ namespace?: Namespace;
514
+ name: string;
515
+ format: string;
516
+ label?: string;
517
+ renderGroup?: number;
518
+ altGroup?: number;
519
+ initData?: string;
520
+ initTrack?: string;
521
+ depends?: Array<string>;
522
+ temporalId?: number;
523
+ spatialId?: number;
524
+ codec?: string;
525
+ mimeType?: string;
526
+ framerate?: [
527
+ number,
528
+ number
529
+ ];
530
+ bitrate?: number;
531
+ width?: number;
532
+ height?: number;
533
+ samplerate?: number;
534
+ channelConfig?: string;
535
+ displayWidth?: number;
536
+ displayHeight?: number;
537
+ language?: string;
538
+ ["com.vindral.variant_uid"]?: string;
539
+ ["com.vindral.drm"]?: string;
540
+ }
541
+ interface CatalogRoot {
542
+ version: number;
543
+ streamingFormat?: number;
544
+ streamingFormatVersion?: string;
545
+ }
546
+ interface TracksCatalog extends CatalogRoot {
547
+ namespace: Namespace;
548
+ tracks: Array<TrackObject>;
549
+ }
550
+ interface Telemetry {
551
+ url: string;
552
+ probability?: number;
553
+ includeErrors?: boolean;
554
+ includeEvents?: boolean;
555
+ includeStats?: boolean;
556
+ maxRetries?: number;
557
+ maxErrorReports?: number;
558
+ interval?: number;
559
+ }
560
+ interface ChannelWithCatalog extends Channel {
561
+ catalog: TracksCatalog;
562
+ renditions: Rendition[];
563
+ overrides?: ClientOverrides;
564
+ }
565
+ interface ChannelWithRenditions extends Channel {
566
+ renditions: Rendition[];
567
+ overrides?: ClientOverrides;
568
+ }
569
+ interface ServerCertificateHash {
570
+ algorithm: string;
571
+ value: string;
572
+ }
573
+ interface Edge {
574
+ moqUrl?: string;
575
+ moqWsUrl: string;
576
+ serverCertificateHashes?: ServerCertificateHash[];
577
+ }
578
+ interface MoQConnectInfo {
579
+ logsUrl?: string;
580
+ statsUrl?: string;
581
+ telemetry?: Telemetry;
582
+ channels: ChannelWithCatalog[];
583
+ edges: Edge[];
584
+ timeshift: {
585
+ urls: string[];
586
+ duration: string;
587
+ };
588
+ }
589
+ interface VindralConnectInfo {
590
+ logsUrl?: string;
591
+ statsUrl?: string;
592
+ telemetry?: Telemetry;
593
+ channels: ChannelWithRenditions[];
594
+ edges: string[];
595
+ }
596
+ type ConnectInfo = VindralConnectInfo | MoQConnectInfo;
597
+ /**
598
+ * Represents a timed metadata event
599
+ */
600
+ export interface Metadata {
601
+ /**
602
+ * The raw string content as it was ingested (if using JSON, it needs to be parsed on your end)
603
+ */
604
+ content: string;
605
+ /**
606
+ * Timestamp in ms
607
+ */
608
+ timestamp: number;
609
+ }
610
+ /** */
611
+ export interface TimeRange {
612
+ /** */
613
+ start: number;
614
+ /** */
615
+ end: number;
616
+ }
549
617
  /**
550
618
  * Represents a rendition (quality level).
551
619
  */
@@ -913,38 +981,6 @@ interface VideoPlayerStatistics {
913
981
  contextLostCount: number;
914
982
  contextRestoredCount: number;
915
983
  }
916
- declare class UserAgentInformation {
917
- private highEntropyValues?;
918
- constructor();
919
- getUserAgentInformation(): {
920
- locationOrigin: string;
921
- locationPath: string;
922
- ancestorOrigins: string[] | undefined;
923
- hardwareConcurrency: number;
924
- deviceMemory: number | undefined;
925
- userAgentLegacy: string;
926
- ua: {
927
- browser: {
928
- brands: string[];
929
- fullVersionBrands: string[];
930
- majorVersions: string[];
931
- };
932
- device: string;
933
- os: {
934
- family: string;
935
- version: string;
936
- major_version: number;
937
- };
938
- };
939
- } | {
940
- locationOrigin: string;
941
- locationPath: string;
942
- ancestorOrigins: string[] | undefined;
943
- hardwareConcurrency: number;
944
- deviceMemory: number | undefined;
945
- userAgent: string;
946
- };
947
- }
948
984
  type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & JitterModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
949
985
  /**
950
986
  * Contains internal statistics.
package/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as C, e as I, f as _, a as O, C as D, D as T, I as a, N as A, V as s, g as r } from "./CX6N3uJK.js";
1
+ import { c as C, e as I, f as _, a as O, C as D, D as T, I as a, N as A, V as s, g as r } from "./BWE6d-4K.js";
2
2
  export {
3
3
  C as AUTHENTICATION_EXPIRED_CODE,
4
4
  I as AUTHENTICATION_FAILED_CODE,