@vindral/web-sdk 4.0.0 → 4.1.0-1-g31205a30

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.
@@ -19,6 +19,9 @@ class c {
19
19
  once(s, e) {
20
20
  this.add(s, e, !0);
21
21
  }
22
+ /**
23
+ * Reset the event emitter
24
+ */
22
25
  reset() {
23
26
  this.listeners = {};
24
27
  }
@@ -27,7 +27,7 @@ var X = (B, g, A) => new Promise((J, k) => {
27
27
  }, o = (h) => h.done ? J(h.value) : Promise.resolve(h.value).then(y, a);
28
28
  o((A = A.apply(B, g)).next());
29
29
  });
30
- import { F as RA, d as JA, n as kA } from "./DwDXQwR0.js";
30
+ import { F as RA, d as JA, n as kA } from "./BojTkNPM.js";
31
31
  var hA = function() {
32
32
  var B = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0;
33
33
  return function(g) {
package/api-client.d.ts CHANGED
@@ -1,35 +1,3 @@
1
- type AudioCodec = "aac" | "opus" | "mp3";
2
- type VideoCodec = "h264" | "av1";
3
- interface RenditionProps {
4
- id: number;
5
- bitRate: number;
6
- codecString?: string;
7
- language?: string;
8
- meta?: Record<string, string>;
9
- }
10
- interface VideoRenditionProps {
11
- codec: VideoCodec;
12
- frameRate: [
13
- number,
14
- number
15
- ];
16
- width: number;
17
- height: number;
18
- }
19
- interface AudioRenditionProps {
20
- codec: AudioCodec;
21
- channels: number;
22
- sampleRate: number;
23
- }
24
- interface TextRenditionProps {
25
- codec: "webvtt";
26
- kind: "subtitles" | "captions";
27
- label?: string;
28
- }
29
- type VideoRendition = VideoRenditionProps & RenditionProps;
30
- type AudioRendition = AudioRenditionProps & RenditionProps;
31
- type TextRendition = TextRenditionProps & RenditionProps;
32
- type Rendition = VideoRendition | AudioRendition | TextRendition;
33
1
  /**
34
2
  * Channel
35
3
  */
@@ -60,14 +28,94 @@ interface ClientOverrides {
60
28
  separateVideoSocketEnabled?: boolean;
61
29
  videoCodecs?: string[];
62
30
  }
63
- interface ChannelWithRenditionsAndOverrides extends Channel {
64
- renditions: Rendition[];
65
- overrides?: ClientOverrides;
31
+ type AudioCodec = "aac" | "opus" | "mp3";
32
+ type VideoCodec = "h264" | "av1";
33
+ declare const tags: unique symbol;
34
+ type Tagged<BaseType, Tag extends PropertyKey> = BaseType & {
35
+ [tags]: {
36
+ [K in Tag]: void;
37
+ };
38
+ };
39
+ type Namespace = Tagged<Array<string>, "Namespace">;
40
+ interface TrackObject {
41
+ namespace?: Namespace;
42
+ name: string;
43
+ format: string;
44
+ label?: string;
45
+ renderGroup?: number;
46
+ altGroup?: number;
47
+ initData?: string;
48
+ initTrack?: string;
49
+ depends?: Array<string>;
50
+ temporalId?: number;
51
+ spatialId?: number;
52
+ codec?: string;
53
+ mimeType?: string;
54
+ framerate?: [
55
+ number,
56
+ number
57
+ ];
58
+ bitrate?: number;
59
+ width?: number;
60
+ height?: number;
61
+ samplerate?: number;
62
+ channelConfig?: string;
63
+ displayWidth?: number;
64
+ displayHeight?: number;
65
+ language?: string;
66
+ ["com.vindral.variant_uid"]?: string;
67
+ ["com.vindral.drm"]?: string;
66
68
  }
67
- interface ConnectOptions {
68
- channelGroupId?: string;
69
- channelId: string;
69
+ interface CatalogRoot {
70
+ version: number;
71
+ streamingFormat?: number;
72
+ streamingFormatVersion?: string;
73
+ }
74
+ interface TracksCatalog extends CatalogRoot {
75
+ namespace: Namespace;
76
+ tracks: Array<TrackObject>;
70
77
  }
78
+ interface RenditionProps {
79
+ id: number;
80
+ /** */
81
+ bitRate: number;
82
+ /** */
83
+ codecString?: string;
84
+ /** */
85
+ language?: string;
86
+ /** */
87
+ meta?: Record<string, string>;
88
+ }
89
+ interface VideoRenditionProps {
90
+ /** */
91
+ codec: VideoCodec;
92
+ /** */
93
+ frameRate: [
94
+ number,
95
+ number
96
+ ];
97
+ /** */
98
+ width: number;
99
+ /** */
100
+ height: number;
101
+ }
102
+ interface AudioRenditionProps {
103
+ /** */
104
+ codec: AudioCodec;
105
+ /** */
106
+ channels: number;
107
+ /** */
108
+ sampleRate: number;
109
+ }
110
+ interface TextRenditionProps {
111
+ codec: "webvtt";
112
+ kind: "subtitles" | "captions";
113
+ label?: string;
114
+ }
115
+ type VideoRendition = VideoRenditionProps & RenditionProps;
116
+ type AudioRendition = AudioRenditionProps & RenditionProps;
117
+ type TextRendition = TextRenditionProps & RenditionProps;
118
+ type Rendition = VideoRendition | AudioRendition | TextRendition;
71
119
  interface Telemetry {
72
120
  url: string;
73
121
  probability?: number;
@@ -78,13 +126,39 @@ interface Telemetry {
78
126
  maxErrorReports?: number;
79
127
  interval?: number;
80
128
  }
81
- export interface ConnectResponse {
129
+ interface ChannelWithCatalog extends Channel {
130
+ catalog: TracksCatalog;
131
+ renditions: Rendition[];
132
+ overrides?: ClientOverrides;
133
+ }
134
+ interface ChannelWithRenditions extends Channel {
135
+ renditions: Rendition[];
136
+ overrides?: ClientOverrides;
137
+ }
138
+ interface ServerCertificateHash {
139
+ algorithm: string;
140
+ value: string;
141
+ }
142
+ interface Edge {
143
+ moqUrl?: string;
144
+ moqWsUrl: string;
145
+ serverCertificateHashes?: ServerCertificateHash[];
146
+ }
147
+ interface MoQConnectInfo {
82
148
  logsUrl?: string;
83
149
  statsUrl?: string;
84
150
  telemetry?: Telemetry;
85
- channels: ChannelWithRenditionsAndOverrides[];
151
+ channels: ChannelWithCatalog[];
152
+ edges: Edge[];
153
+ }
154
+ interface VindralConnectInfo {
155
+ logsUrl?: string;
156
+ statsUrl?: string;
157
+ telemetry?: Telemetry;
158
+ channels: ChannelWithRenditions[];
86
159
  edges: string[];
87
160
  }
161
+ export type ConnectInfo = VindralConnectInfo | MoQConnectInfo;
88
162
  /**
89
163
  * ApiClientOptions
90
164
  */
@@ -111,6 +185,10 @@ export interface AuthorizationContext {
111
185
  */
112
186
  channelId?: string;
113
187
  }
188
+ interface ConnectOptions {
189
+ channelGroupId?: string;
190
+ channelId: string;
191
+ }
114
192
  /**
115
193
  * AuthorizationTokenFactory
116
194
  */
@@ -123,9 +201,10 @@ export declare class ApiClient {
123
201
  private tokenFactory?;
124
202
  constructor(options: ApiClientOptions);
125
203
  /**
204
+ * @ignore
126
205
  * Returns everything needed to setup the connection of Vindral instance.
127
206
  */
128
- connect(options: ConnectOptions): Promise<ConnectResponse>;
207
+ connect(options: ConnectOptions): Promise<ConnectInfo>;
129
208
  /**
130
209
  * Fetches information regarding a single channel.
131
210
  *
@@ -138,7 +217,7 @@ export declare class ApiClient {
138
217
  *
139
218
  * Note: The returned list includes inactive channels - check isLive to filter out only active channels
140
219
  *
141
- * @param channelGroup the channel group to fetch channels from
220
+ * @param channelGroupId the channel group to fetch channels from
142
221
  * @returns an array of [[Channel]] that belong to the channel group
143
222
  */
144
223
  getChannels(channelGroupId: string): Promise<Channel[]>;
package/api-client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as o } from "./B7jz034g.js";
1
+ import { A as o } from "./hRzek83o.js";
2
2
  export {
3
3
  o as ApiClient
4
4
  };
package/cast-sender.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ type VideoCodec = "h264" | "av1";
1
2
  type MatchingKeys<TRecord, TMatch, K extends keyof TRecord = keyof TRecord> = K extends (TRecord[K] extends TMatch ? K : never) ? K : never;
2
3
  type VoidKeys<Record> = MatchingKeys<Record, void>;
3
4
  type EventListenerReturnType = (() => void) | void;
@@ -5,6 +6,9 @@ declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<
5
6
  private listeners;
6
7
  emit<T extends ArgLessEmits>(eventName: T): void;
7
8
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
9
+ /**
10
+ * Remove an event listener from `eventName`
11
+ */
8
12
  off<T extends ArgLessEvents>(eventName: T, fn: () => EventListenerReturnType): void;
9
13
  off<T extends ArgEvents>(eventName: T, fn: (args: TEvents[T]) => EventListenerReturnType): void;
10
14
  /**
@@ -23,10 +27,13 @@ declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<
23
27
  */
24
28
  once<T extends ArgLessEvents>(eventName: T, fn: () => void): void;
25
29
  once<T extends ArgEvents>(eventName: T, fn: (args: TEvents[T]) => void): void;
30
+ /**
31
+ * Reset the event emitter
32
+ */
26
33
  reset(): void;
27
34
  private add;
28
35
  }
29
- declare const Levels: readonly [
36
+ declare const LogLevels: readonly [
30
37
  "off",
31
38
  "error",
32
39
  "warn",
@@ -34,8 +41,8 @@ declare const Levels: readonly [
34
41
  "debug",
35
42
  "trace"
36
43
  ];
37
- type Level = (typeof Levels)[number];
38
- declare const Level: {
44
+ type LogLevel = (typeof LogLevels)[number];
45
+ declare const LogLevel: {
39
46
  ERROR: "error";
40
47
  WARN: "warn";
41
48
  INFO: "info";
@@ -43,7 +50,6 @@ declare const Level: {
43
50
  TRACE: "trace";
44
51
  OFF: "off";
45
52
  };
46
- type VideoCodec = "h264" | "av1";
47
53
  interface Metadata {
48
54
  /**
49
55
  * The raw string content as it was ingested (if using JSON, it needs to be parsed on your end)
@@ -64,14 +70,21 @@ interface ReconnectState {
64
70
  reconnectRetries: number;
65
71
  }
66
72
  interface Size {
73
+ /** */
67
74
  width: number;
75
+ /** */
68
76
  height: number;
69
77
  }
70
78
  interface VideoConstraint {
79
+ /** */
71
80
  width: number;
81
+ /** */
72
82
  height: number;
83
+ /** */
73
84
  bitRate: number;
85
+ /** */
74
86
  codec?: VideoCodec;
87
+ /** */
75
88
  codecString?: string;
76
89
  }
77
90
  interface AdvancedOptions {
@@ -82,6 +95,16 @@ interface AdvancedOptions {
82
95
  */
83
96
  wasmDecodingConstraint: Partial<VideoConstraint>;
84
97
  }
98
+ interface DrmOptions {
99
+ /**
100
+ * Headers to be added to requests to license servers
101
+ */
102
+ headers?: Record<string, string>;
103
+ /**
104
+ * Query parameters to be added to requests to license servers
105
+ */
106
+ queryParams?: Record<string, string>;
107
+ }
85
108
  type Media = "audio" | "video" | "audio+video";
86
109
  interface Options {
87
110
  /**
@@ -118,7 +141,7 @@ interface Options {
118
141
  /**
119
142
  * Sets the log level - defaults to info
120
143
  */
121
- logLevel?: Level;
144
+ logLevel?: LogLevel;
122
145
  /**
123
146
  * Sets the minimum and initial buffer time
124
147
  */
@@ -248,6 +271,7 @@ interface Options {
248
271
  edgeUrl?: string;
249
272
  logShippingEnabled?: boolean;
250
273
  statsShippingEnabled?: boolean;
274
+ webtransportEnabled?: boolean;
251
275
  /**
252
276
  * Enable wake lock for iOS devices.
253
277
  * The wake lock requires that the audio has been activated at least once for the instance, othwerwise it will not work.
@@ -272,6 +296,10 @@ interface Options {
272
296
  advanced?: AdvancedOptions;
273
297
  media?: Media;
274
298
  videoCodecs?: VideoCodec[];
299
+ /**
300
+ * DRM options to provide to the Vindral instance
301
+ */
302
+ drm?: DrmOptions;
275
303
  }
276
304
  /**
277
305
  * Available events to listen to
@@ -307,7 +335,7 @@ export interface CastSenderEvents {
307
335
  */
308
336
  export interface CastConfig {
309
337
  /**
310
- * The [Vindral Options](./Options) to use for the Cast Receiver
338
+ * The Vindral Options to use for the Cast Receiver
311
339
  */
312
340
  options: Options;
313
341
  /**
package/cast-sender.js CHANGED
@@ -17,7 +17,7 @@ var h = (n, i, e) => new Promise((t, a) => {
17
17
  }, c = (r) => r.done ? t(r.value) : Promise.resolve(r.value).then(o, d);
18
18
  c((e = e.apply(n, i)).next());
19
19
  });
20
- import { E as g } from "./BTxJOjm9.js";
20
+ import { E as g } from "./Bx7s5QdT.js";
21
21
  class p extends g {
22
22
  constructor(e) {
23
23
  super();