moqtail 0.15.0 → 0.16.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.
Files changed (44) hide show
  1. package/README.md +153 -473
  2. package/dist/{client-BviQ20Lc.cjs → client-DQ5aGbLR.cjs} +1089 -1074
  3. package/dist/client-DUzLw_Y8.d.cts +1932 -0
  4. package/dist/{client-zi0lmuIL.mjs → client-DVi4Nh1J.mjs} +930 -921
  5. package/dist/client-epHqMdHm.d.mts +1932 -0
  6. package/dist/client.cjs +121 -4
  7. package/dist/client.d.cts +23 -1944
  8. package/dist/client.d.mts +23 -1944
  9. package/dist/client.mjs +117 -2
  10. package/dist/emitter-UbeRcbuf.mjs +109 -0
  11. package/dist/{logger-c2NoQqtx.cjs → emitter-qNJYD3yQ.cjs} +61 -2
  12. package/dist/index-B-BMK-b6.d.mts +2090 -0
  13. package/dist/index-BtemTtwe.d.cts +2090 -0
  14. package/dist/{index-BY6e1obL.d.cts → index-CNn9BgO6.d.mts} +119 -324
  15. package/dist/index.cjs +38 -34
  16. package/dist/index.d.cts +20 -4
  17. package/dist/index.d.mts +20 -4
  18. package/dist/index.mjs +5 -4
  19. package/dist/logger-B8IYkljn.d.cts +64 -0
  20. package/dist/logger-B8IYkljn.d.mts +64 -0
  21. package/dist/model.cjs +122 -340
  22. package/dist/model.d.cts +2896 -2
  23. package/dist/model.d.mts +17 -2
  24. package/dist/model.mjs +122 -340
  25. package/dist/player/component.cjs +317 -0
  26. package/dist/player/component.d.cts +50 -0
  27. package/dist/player/component.d.mts +50 -0
  28. package/dist/player/component.mjs +315 -0
  29. package/dist/player-CJayEzwt.cjs +6750 -0
  30. package/dist/player-DcctWhyM.mjs +6599 -0
  31. package/dist/player.cjs +27 -0
  32. package/dist/player.d.cts +17 -0
  33. package/dist/player.d.mts +17 -0
  34. package/dist/player.mjs +1 -0
  35. package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
  36. package/dist/util.cjs +9 -10
  37. package/dist/util.d.cts +20 -13
  38. package/dist/util.d.mts +20 -13
  39. package/dist/util.mjs +4 -6
  40. package/package.json +45 -5
  41. package/dist/index-BY6e1obL.d.mts +0 -3087
  42. package/dist/logger-ByDB8lYF.mjs +0 -56
  43. package/dist/logger-dEoueCj7.d.cts +0 -35
  44. package/dist/logger-dEoueCj7.d.mts +0 -35
@@ -0,0 +1,2090 @@
1
+ import { Jn as Location, Kn as Tuple, at as Setup, bn as MoqtObject, r as SetupOptions } from "./index-CNn9BgO6.mjs";
2
+ import { o as Emitter } from "./logger-B8IYkljn.mjs";
3
+ import { D as FetchOptions, M as SubscribeOptions, N as SubscribeResult, O as FetchResult, j as ObjectOrdering, k as MOQtailClientOptions, t as MOQtailClient } from "./client-epHqMdHm.mjs";
4
+ import * as v from "valibot";
5
+ /** @public An inclusive range of MOQT Locations. */
6
+ interface LocationRange {
7
+ /** Start Object ID defaults to 0. */
8
+ start: Location;
9
+ /** No end: open range. No end object: the whole end group. */
10
+ end?: {
11
+ group: bigint;
12
+ object?: bigint;
13
+ };
14
+ }
15
+ /** @public An inclusive range in milliseconds. No end: open range. */
16
+ interface TimeRange {
17
+ start: number;
18
+ end?: number;
19
+ }
20
+ /** @public A parsed MSF URL. */
21
+ interface MsfSource {
22
+ /** `moqt://authority/path[?query]`, lowercase scheme, no fragment. */
23
+ url: string;
24
+ /** Namespace fields hold the decoded bytes. */
25
+ namespace: Tuple;
26
+ /** The track name decoded as UTF-8, for display and probing. */
27
+ track: string;
28
+ /** The track name bytes. Names are compared as bytes (MSF 11.2.2). */
29
+ trackBytes: Uint8Array;
30
+ locationRanges: LocationRange[];
31
+ mediaTimeRanges: TimeRange[];
32
+ wallclockRanges: TimeRange[];
33
+ c4m?: string;
34
+ connection?: 'q' | 'wt';
35
+ /** Every fragment parameter, last value wins. Used for catalog variable substitution (MSF 5.4). */
36
+ variables: Record<string, string>;
37
+ }
38
+ /**
39
+ * @public
40
+ * Parses an MSF URL (MSF 11.1). Ranges stay in their own domain and aren't merged.
41
+ * @throws PlayerError `UNSUPPORTED_SOURCE` for anything that isn't a valid `msf-uri`.
42
+ */
43
+ declare function parseMsfUrl(uri: string): MsfSource;
44
+ /**
45
+ * @public
46
+ * Builds an MSF URL from a `moqt://authority/path[?query]` session URL and a full track name.
47
+ */
48
+ declare function formatMsfUrl(url: string, namespace: Tuple, track: Uint8Array | string): string;
49
+ /**
50
+ * Copyright 2026 The MOQtail Authors
51
+ *
52
+ * Licensed under the Apache License, Version 2.0 (the "License");
53
+ * you may not use this file except in compliance with the License.
54
+ * You may obtain a copy of the License at
55
+ *
56
+ * http://www.apache.org/licenses/LICENSE-2.0
57
+ *
58
+ * Unless required by applicable law or agreed to in writing, software
59
+ * distributed under the License is distributed on an "AS IS" BASIS,
60
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
61
+ * See the License for the specific language governing permissions and
62
+ * limitations under the License.
63
+ */
64
+ /**
65
+ * @public
66
+ * Every error the player reports. The first group is fatal (`error` event), the
67
+ * second are warnings (`warning` event).
68
+ */
69
+ type PlayerErrorCode = 'UNSUPPORTED_SOURCE' | 'UNSUPPORTED_ORIGIN' | 'CATALOG_TIMEOUT' | 'SESSION_LOST' | 'MEDIA_FAILURE' | 'SEEK_FAILED' | 'NO_MEDIA_SINK' | 'ABORTED' | 'PAD_UNLINKED' | 'TRACK_SKIPPED' | 'VARIABLE_SKIPPED' | 'INVALID_CATALOG_UPDATE';
70
+ /**
71
+ * @public
72
+ * Broad failure class, mapped to a `MediaError` code by the web component.
73
+ */
74
+ type PlayerErrorCategory = 'source' | 'network' | 'media' | 'aborted';
75
+ /**
76
+ * @public
77
+ * The single error type of the player module. `element` names the element that
78
+ * raised it, when there is one.
79
+ */
80
+ declare class PlayerError extends Error {
81
+ readonly code: PlayerErrorCode;
82
+ readonly category: PlayerErrorCategory;
83
+ readonly element?: string;
84
+ constructor(code: PlayerErrorCode, message: string, options?: {
85
+ element?: string;
86
+ cause?: unknown;
87
+ });
88
+ }
89
+ /** @public Where a track's init data comes from (MSF 5.1.7, 12.2). */
90
+ type InitData = {
91
+ type: 'inline';
92
+ data: Uint8Array;
93
+ } | {
94
+ type: 'track-property' | 'object-property';
95
+ property: number;
96
+ };
97
+ /** An independent catalog (MSF 5.1) whose tracks without a namespace inherit `catalogNamespace`. */
98
+ declare const catalogSchema: (catalogNamespace: Tuple) => v.SchemaWithPipe<readonly [v.LooseObjectSchema<{
99
+ readonly version: v.PicklistSchema<readonly ["draft-01"], (issue: v.PicklistIssue) => string>;
100
+ readonly generatedAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
101
+ readonly isComplete: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
102
+ readonly tracks: v.ArraySchema<v.SchemaWithPipe<readonly [v.LooseObjectSchema<{
103
+ readonly namespace: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Tuple>]>, undefined>;
104
+ readonly name: v.StringSchema<undefined>;
105
+ readonly packaging: v.StringSchema<undefined>;
106
+ readonly packagingMetadata: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Record<string, string>>]>, undefined>;
107
+ readonly eventType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
108
+ readonly role: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
109
+ readonly isLive: v.BooleanSchema<undefined>;
110
+ readonly targetLatency: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
111
+ readonly buffers: v.OptionalSchema<v.LooseObjectSchema<{
112
+ readonly target: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
113
+ readonly min: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
114
+ readonly max: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
115
+ }, undefined>, undefined>;
116
+ readonly label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
117
+ readonly renderGroup: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
118
+ readonly altGroup: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
119
+ readonly initRef: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
120
+ readonly depends: v.OptionalSchema<v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, undefined>, undefined>;
121
+ readonly template: v.OptionalSchema<v.SchemaWithPipe<readonly [v.TupleSchema<[v.NumberSchema<undefined>, v.NumberSchema<undefined>, v.TupleSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, v.TupleSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, v.NumberSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<[number, number, [number, number], [number, number], number, number], {
122
+ startMediaTime: number;
123
+ deltaMediaTime: number;
124
+ startLocation: [number, number];
125
+ deltaLocation: [number, number];
126
+ startWallclock: number;
127
+ deltaWallclock: number;
128
+ }>]>, undefined>;
129
+ readonly temporalId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
130
+ readonly spatialId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
131
+ readonly codec: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
132
+ readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
133
+ readonly framerate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
134
+ readonly timescale: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
135
+ readonly bitrate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
136
+ readonly avgBitrate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
137
+ readonly maxGopDuration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
138
+ readonly maxGroupDuration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
139
+ readonly width: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
140
+ readonly height: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
141
+ readonly samplerate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
142
+ readonly channelConfig: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
143
+ readonly displayWidth: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
144
+ readonly displayHeight: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
145
+ readonly lang: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
146
+ readonly parentName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
147
+ readonly parentNamespace: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
148
+ readonly trackDuration: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
149
+ readonly connectionUri: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
150
+ readonly token: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
151
+ readonly authInfo: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
152
+ readonly accessibility: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{
153
+ readonly scheme: v.StringSchema<undefined>;
154
+ readonly value: v.StringSchema<undefined>;
155
+ }, undefined>, undefined>, undefined>;
156
+ readonly accessibleWindowTime: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
157
+ readonly keyframeSpacing: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, v.MinValueAction<number, 1, undefined>]>, undefined>;
158
+ readonly maxGrpSapStartingType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
159
+ readonly maxObjSapStartingType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
160
+ }, undefined>, v.CheckAction<{
161
+ namespace?: Tuple | undefined;
162
+ name: string;
163
+ packaging: string;
164
+ packagingMetadata?: Record<string, string> | undefined;
165
+ eventType?: string | undefined;
166
+ role?: string | undefined;
167
+ isLive: boolean;
168
+ targetLatency?: number | undefined;
169
+ buffers?: ({
170
+ target?: number | undefined;
171
+ min?: number | undefined;
172
+ max?: number | undefined;
173
+ } & {
174
+ [key: string]: unknown;
175
+ }) | undefined;
176
+ label?: string | undefined;
177
+ renderGroup?: number | undefined;
178
+ altGroup?: number | undefined;
179
+ initRef?: string | undefined;
180
+ depends?: (string | number)[] | undefined;
181
+ template?: {
182
+ startMediaTime: number;
183
+ deltaMediaTime: number;
184
+ startLocation: [number, number];
185
+ deltaLocation: [number, number];
186
+ startWallclock: number;
187
+ deltaWallclock: number;
188
+ } | undefined;
189
+ temporalId?: number | undefined;
190
+ spatialId?: number | undefined;
191
+ codec?: string | undefined;
192
+ mimeType?: string | undefined;
193
+ framerate?: number | undefined;
194
+ timescale?: number | undefined;
195
+ bitrate?: number | undefined;
196
+ avgBitrate?: number | undefined;
197
+ maxGopDuration?: number | undefined;
198
+ maxGroupDuration?: number | undefined;
199
+ width?: number | undefined;
200
+ height?: number | undefined;
201
+ samplerate?: number | undefined;
202
+ channelConfig?: string | undefined;
203
+ displayWidth?: number | undefined;
204
+ displayHeight?: number | undefined;
205
+ lang?: string | undefined;
206
+ parentName?: string | undefined;
207
+ parentNamespace?: string | undefined;
208
+ trackDuration?: number | undefined;
209
+ connectionUri?: string | undefined;
210
+ token?: string | undefined;
211
+ authInfo?: {
212
+ [x: string]: unknown;
213
+ } | undefined;
214
+ accessibility?: ({
215
+ scheme: string;
216
+ value: string;
217
+ } & {
218
+ [key: string]: unknown;
219
+ })[] | undefined;
220
+ accessibleWindowTime?: number | undefined;
221
+ keyframeSpacing?: number | undefined;
222
+ maxGrpSapStartingType?: number | undefined;
223
+ maxObjSapStartingType?: number | undefined;
224
+ } & {
225
+ [key: string]: unknown;
226
+ }, (issue: v.CheckIssue<{
227
+ namespace?: Tuple | undefined;
228
+ name: string;
229
+ packaging: string;
230
+ packagingMetadata?: Record<string, string> | undefined;
231
+ eventType?: string | undefined;
232
+ role?: string | undefined;
233
+ isLive: boolean;
234
+ targetLatency?: number | undefined;
235
+ buffers?: ({
236
+ target?: number | undefined;
237
+ min?: number | undefined;
238
+ max?: number | undefined;
239
+ } & {
240
+ [key: string]: unknown;
241
+ }) | undefined;
242
+ label?: string | undefined;
243
+ renderGroup?: number | undefined;
244
+ altGroup?: number | undefined;
245
+ initRef?: string | undefined;
246
+ depends?: (string | number)[] | undefined;
247
+ template?: {
248
+ startMediaTime: number;
249
+ deltaMediaTime: number;
250
+ startLocation: [number, number];
251
+ deltaLocation: [number, number];
252
+ startWallclock: number;
253
+ deltaWallclock: number;
254
+ } | undefined;
255
+ temporalId?: number | undefined;
256
+ spatialId?: number | undefined;
257
+ codec?: string | undefined;
258
+ mimeType?: string | undefined;
259
+ framerate?: number | undefined;
260
+ timescale?: number | undefined;
261
+ bitrate?: number | undefined;
262
+ avgBitrate?: number | undefined;
263
+ maxGopDuration?: number | undefined;
264
+ maxGroupDuration?: number | undefined;
265
+ width?: number | undefined;
266
+ height?: number | undefined;
267
+ samplerate?: number | undefined;
268
+ channelConfig?: string | undefined;
269
+ displayWidth?: number | undefined;
270
+ displayHeight?: number | undefined;
271
+ lang?: string | undefined;
272
+ parentName?: string | undefined;
273
+ parentNamespace?: string | undefined;
274
+ trackDuration?: number | undefined;
275
+ connectionUri?: string | undefined;
276
+ token?: string | undefined;
277
+ authInfo?: {
278
+ [x: string]: unknown;
279
+ } | undefined;
280
+ accessibility?: ({
281
+ scheme: string;
282
+ value: string;
283
+ } & {
284
+ [key: string]: unknown;
285
+ })[] | undefined;
286
+ accessibleWindowTime?: number | undefined;
287
+ keyframeSpacing?: number | undefined;
288
+ maxGrpSapStartingType?: number | undefined;
289
+ maxObjSapStartingType?: number | undefined;
290
+ } & {
291
+ [key: string]: unknown;
292
+ }>) => string>, v.CheckAction<{
293
+ namespace?: Tuple | undefined;
294
+ name: string;
295
+ packaging: string;
296
+ packagingMetadata?: Record<string, string> | undefined;
297
+ eventType?: string | undefined;
298
+ role?: string | undefined;
299
+ isLive: boolean;
300
+ targetLatency?: number | undefined;
301
+ buffers?: ({
302
+ target?: number | undefined;
303
+ min?: number | undefined;
304
+ max?: number | undefined;
305
+ } & {
306
+ [key: string]: unknown;
307
+ }) | undefined;
308
+ label?: string | undefined;
309
+ renderGroup?: number | undefined;
310
+ altGroup?: number | undefined;
311
+ initRef?: string | undefined;
312
+ depends?: (string | number)[] | undefined;
313
+ template?: {
314
+ startMediaTime: number;
315
+ deltaMediaTime: number;
316
+ startLocation: [number, number];
317
+ deltaLocation: [number, number];
318
+ startWallclock: number;
319
+ deltaWallclock: number;
320
+ } | undefined;
321
+ temporalId?: number | undefined;
322
+ spatialId?: number | undefined;
323
+ codec?: string | undefined;
324
+ mimeType?: string | undefined;
325
+ framerate?: number | undefined;
326
+ timescale?: number | undefined;
327
+ bitrate?: number | undefined;
328
+ avgBitrate?: number | undefined;
329
+ maxGopDuration?: number | undefined;
330
+ maxGroupDuration?: number | undefined;
331
+ width?: number | undefined;
332
+ height?: number | undefined;
333
+ samplerate?: number | undefined;
334
+ channelConfig?: string | undefined;
335
+ displayWidth?: number | undefined;
336
+ displayHeight?: number | undefined;
337
+ lang?: string | undefined;
338
+ parentName?: string | undefined;
339
+ parentNamespace?: string | undefined;
340
+ trackDuration?: number | undefined;
341
+ connectionUri?: string | undefined;
342
+ token?: string | undefined;
343
+ authInfo?: {
344
+ [x: string]: unknown;
345
+ } | undefined;
346
+ accessibility?: ({
347
+ scheme: string;
348
+ value: string;
349
+ } & {
350
+ [key: string]: unknown;
351
+ })[] | undefined;
352
+ accessibleWindowTime?: number | undefined;
353
+ keyframeSpacing?: number | undefined;
354
+ maxGrpSapStartingType?: number | undefined;
355
+ maxObjSapStartingType?: number | undefined;
356
+ } & {
357
+ [key: string]: unknown;
358
+ }, "eventType goes with, and only with, eventtimeline packaging (MSF 5.2.6)">, v.CheckAction<{
359
+ namespace?: Tuple | undefined;
360
+ name: string;
361
+ packaging: string;
362
+ packagingMetadata?: Record<string, string> | undefined;
363
+ eventType?: string | undefined;
364
+ role?: string | undefined;
365
+ isLive: boolean;
366
+ targetLatency?: number | undefined;
367
+ buffers?: ({
368
+ target?: number | undefined;
369
+ min?: number | undefined;
370
+ max?: number | undefined;
371
+ } & {
372
+ [key: string]: unknown;
373
+ }) | undefined;
374
+ label?: string | undefined;
375
+ renderGroup?: number | undefined;
376
+ altGroup?: number | undefined;
377
+ initRef?: string | undefined;
378
+ depends?: (string | number)[] | undefined;
379
+ template?: {
380
+ startMediaTime: number;
381
+ deltaMediaTime: number;
382
+ startLocation: [number, number];
383
+ deltaLocation: [number, number];
384
+ startWallclock: number;
385
+ deltaWallclock: number;
386
+ } | undefined;
387
+ temporalId?: number | undefined;
388
+ spatialId?: number | undefined;
389
+ codec?: string | undefined;
390
+ mimeType?: string | undefined;
391
+ framerate?: number | undefined;
392
+ timescale?: number | undefined;
393
+ bitrate?: number | undefined;
394
+ avgBitrate?: number | undefined;
395
+ maxGopDuration?: number | undefined;
396
+ maxGroupDuration?: number | undefined;
397
+ width?: number | undefined;
398
+ height?: number | undefined;
399
+ samplerate?: number | undefined;
400
+ channelConfig?: string | undefined;
401
+ displayWidth?: number | undefined;
402
+ displayHeight?: number | undefined;
403
+ lang?: string | undefined;
404
+ parentName?: string | undefined;
405
+ parentNamespace?: string | undefined;
406
+ trackDuration?: number | undefined;
407
+ connectionUri?: string | undefined;
408
+ token?: string | undefined;
409
+ authInfo?: {
410
+ [x: string]: unknown;
411
+ } | undefined;
412
+ accessibility?: ({
413
+ scheme: string;
414
+ value: string;
415
+ } & {
416
+ [key: string]: unknown;
417
+ })[] | undefined;
418
+ accessibleWindowTime?: number | undefined;
419
+ keyframeSpacing?: number | undefined;
420
+ maxGrpSapStartingType?: number | undefined;
421
+ maxObjSapStartingType?: number | undefined;
422
+ } & {
423
+ [key: string]: unknown;
424
+ }, "targetLatency and buffers are mutually exclusive (MSF 5.2.9)">, v.CheckAction<{
425
+ namespace?: Tuple | undefined;
426
+ name: string;
427
+ packaging: string;
428
+ packagingMetadata?: Record<string, string> | undefined;
429
+ eventType?: string | undefined;
430
+ role?: string | undefined;
431
+ isLive: boolean;
432
+ targetLatency?: number | undefined;
433
+ buffers?: ({
434
+ target?: number | undefined;
435
+ min?: number | undefined;
436
+ max?: number | undefined;
437
+ } & {
438
+ [key: string]: unknown;
439
+ }) | undefined;
440
+ label?: string | undefined;
441
+ renderGroup?: number | undefined;
442
+ altGroup?: number | undefined;
443
+ initRef?: string | undefined;
444
+ depends?: (string | number)[] | undefined;
445
+ template?: {
446
+ startMediaTime: number;
447
+ deltaMediaTime: number;
448
+ startLocation: [number, number];
449
+ deltaLocation: [number, number];
450
+ startWallclock: number;
451
+ deltaWallclock: number;
452
+ } | undefined;
453
+ temporalId?: number | undefined;
454
+ spatialId?: number | undefined;
455
+ codec?: string | undefined;
456
+ mimeType?: string | undefined;
457
+ framerate?: number | undefined;
458
+ timescale?: number | undefined;
459
+ bitrate?: number | undefined;
460
+ avgBitrate?: number | undefined;
461
+ maxGopDuration?: number | undefined;
462
+ maxGroupDuration?: number | undefined;
463
+ width?: number | undefined;
464
+ height?: number | undefined;
465
+ samplerate?: number | undefined;
466
+ channelConfig?: string | undefined;
467
+ displayWidth?: number | undefined;
468
+ displayHeight?: number | undefined;
469
+ lang?: string | undefined;
470
+ parentName?: string | undefined;
471
+ parentNamespace?: string | undefined;
472
+ trackDuration?: number | undefined;
473
+ connectionUri?: string | undefined;
474
+ token?: string | undefined;
475
+ authInfo?: {
476
+ [x: string]: unknown;
477
+ } | undefined;
478
+ accessibility?: ({
479
+ scheme: string;
480
+ value: string;
481
+ } & {
482
+ [key: string]: unknown;
483
+ })[] | undefined;
484
+ accessibleWindowTime?: number | undefined;
485
+ keyframeSpacing?: number | undefined;
486
+ maxGrpSapStartingType?: number | undefined;
487
+ maxObjSapStartingType?: number | undefined;
488
+ } & {
489
+ [key: string]: unknown;
490
+ }, "a live track has no trackDuration (MSF 5.2.36)">, v.TransformAction<{
491
+ namespace?: Tuple | undefined;
492
+ name: string;
493
+ packaging: string;
494
+ packagingMetadata?: Record<string, string> | undefined;
495
+ eventType?: string | undefined;
496
+ role?: string | undefined;
497
+ isLive: boolean;
498
+ targetLatency?: number | undefined;
499
+ buffers?: ({
500
+ target?: number | undefined;
501
+ min?: number | undefined;
502
+ max?: number | undefined;
503
+ } & {
504
+ [key: string]: unknown;
505
+ }) | undefined;
506
+ label?: string | undefined;
507
+ renderGroup?: number | undefined;
508
+ altGroup?: number | undefined;
509
+ initRef?: string | undefined;
510
+ depends?: (string | number)[] | undefined;
511
+ template?: {
512
+ startMediaTime: number;
513
+ deltaMediaTime: number;
514
+ startLocation: [number, number];
515
+ deltaLocation: [number, number];
516
+ startWallclock: number;
517
+ deltaWallclock: number;
518
+ } | undefined;
519
+ temporalId?: number | undefined;
520
+ spatialId?: number | undefined;
521
+ codec?: string | undefined;
522
+ mimeType?: string | undefined;
523
+ framerate?: number | undefined;
524
+ timescale?: number | undefined;
525
+ bitrate?: number | undefined;
526
+ avgBitrate?: number | undefined;
527
+ maxGopDuration?: number | undefined;
528
+ maxGroupDuration?: number | undefined;
529
+ width?: number | undefined;
530
+ height?: number | undefined;
531
+ samplerate?: number | undefined;
532
+ channelConfig?: string | undefined;
533
+ displayWidth?: number | undefined;
534
+ displayHeight?: number | undefined;
535
+ lang?: string | undefined;
536
+ parentName?: string | undefined;
537
+ parentNamespace?: string | undefined;
538
+ trackDuration?: number | undefined;
539
+ connectionUri?: string | undefined;
540
+ token?: string | undefined;
541
+ authInfo?: {
542
+ [x: string]: unknown;
543
+ } | undefined;
544
+ accessibility?: ({
545
+ scheme: string;
546
+ value: string;
547
+ } & {
548
+ [key: string]: unknown;
549
+ })[] | undefined;
550
+ accessibleWindowTime?: number | undefined;
551
+ keyframeSpacing?: number | undefined;
552
+ maxGrpSapStartingType?: number | undefined;
553
+ maxObjSapStartingType?: number | undefined;
554
+ } & {
555
+ [key: string]: unknown;
556
+ }, {
557
+ namespace?: Tuple | undefined;
558
+ name: string;
559
+ packaging: string;
560
+ packagingMetadata?: Record<string, string> | undefined;
561
+ eventType?: string | undefined;
562
+ role?: string | undefined;
563
+ isLive: boolean;
564
+ targetLatency?: number | undefined;
565
+ buffers?: ({
566
+ target?: number | undefined;
567
+ min?: number | undefined;
568
+ max?: number | undefined;
569
+ } & {
570
+ [key: string]: unknown;
571
+ }) | undefined;
572
+ label?: string | undefined;
573
+ renderGroup?: number | undefined;
574
+ altGroup?: number | undefined;
575
+ initRef?: string | undefined;
576
+ depends?: (string | number)[] | undefined;
577
+ template?: {
578
+ startMediaTime: number;
579
+ deltaMediaTime: number;
580
+ startLocation: [number, number];
581
+ deltaLocation: [number, number];
582
+ startWallclock: number;
583
+ deltaWallclock: number;
584
+ } | undefined;
585
+ temporalId?: number | undefined;
586
+ spatialId?: number | undefined;
587
+ codec?: string | undefined;
588
+ mimeType?: string | undefined;
589
+ framerate?: number | undefined;
590
+ timescale?: number | undefined;
591
+ bitrate?: number | undefined;
592
+ avgBitrate?: number | undefined;
593
+ maxGopDuration?: number | undefined;
594
+ maxGroupDuration?: number | undefined;
595
+ width?: number | undefined;
596
+ height?: number | undefined;
597
+ samplerate?: number | undefined;
598
+ channelConfig?: string | undefined;
599
+ displayWidth?: number | undefined;
600
+ displayHeight?: number | undefined;
601
+ lang?: string | undefined;
602
+ parentName?: string | undefined;
603
+ parentNamespace?: string | undefined;
604
+ trackDuration?: number | undefined;
605
+ connectionUri?: string | undefined;
606
+ token?: string | undefined;
607
+ authInfo?: {
608
+ [x: string]: unknown;
609
+ } | undefined;
610
+ accessibility?: ({
611
+ scheme: string;
612
+ value: string;
613
+ } & {
614
+ [key: string]: unknown;
615
+ })[] | undefined;
616
+ accessibleWindowTime?: number | undefined;
617
+ keyframeSpacing?: number | undefined;
618
+ maxGrpSapStartingType?: number | undefined;
619
+ maxObjSapStartingType?: number | undefined;
620
+ } & {
621
+ [key: string]: unknown;
622
+ } & {
623
+ nameBytes: Uint8Array;
624
+ namespace: Tuple;
625
+ init?: InitData;
626
+ }>]>, undefined>;
627
+ readonly publishTracks: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.LooseObjectSchema<{
628
+ readonly namespace: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Tuple>]>, undefined>;
629
+ readonly name: v.StringSchema<undefined>;
630
+ readonly packaging: v.StringSchema<undefined>;
631
+ readonly packagingMetadata: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Record<string, string>>]>, undefined>;
632
+ readonly eventType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
633
+ readonly role: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
634
+ readonly isLive: v.BooleanSchema<undefined>;
635
+ readonly targetLatency: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
636
+ readonly buffers: v.OptionalSchema<v.LooseObjectSchema<{
637
+ readonly target: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
638
+ readonly min: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
639
+ readonly max: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
640
+ }, undefined>, undefined>;
641
+ readonly label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
642
+ readonly renderGroup: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
643
+ readonly altGroup: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
644
+ readonly initRef: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
645
+ readonly depends: v.OptionalSchema<v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, undefined>, undefined>;
646
+ readonly template: v.OptionalSchema<v.SchemaWithPipe<readonly [v.TupleSchema<[v.NumberSchema<undefined>, v.NumberSchema<undefined>, v.TupleSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, v.TupleSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, v.NumberSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<[number, number, [number, number], [number, number], number, number], {
647
+ startMediaTime: number;
648
+ deltaMediaTime: number;
649
+ startLocation: [number, number];
650
+ deltaLocation: [number, number];
651
+ startWallclock: number;
652
+ deltaWallclock: number;
653
+ }>]>, undefined>;
654
+ readonly temporalId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
655
+ readonly spatialId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
656
+ readonly codec: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
657
+ readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
658
+ readonly framerate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
659
+ readonly timescale: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
660
+ readonly bitrate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
661
+ readonly avgBitrate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
662
+ readonly maxGopDuration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
663
+ readonly maxGroupDuration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
664
+ readonly width: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
665
+ readonly height: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
666
+ readonly samplerate: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
667
+ readonly channelConfig: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
668
+ readonly displayWidth: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
669
+ readonly displayHeight: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
670
+ readonly lang: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
671
+ readonly parentName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
672
+ readonly parentNamespace: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
673
+ readonly trackDuration: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
674
+ readonly connectionUri: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
675
+ readonly token: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
676
+ readonly authInfo: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
677
+ readonly accessibility: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{
678
+ readonly scheme: v.StringSchema<undefined>;
679
+ readonly value: v.StringSchema<undefined>;
680
+ }, undefined>, undefined>, undefined>;
681
+ readonly accessibleWindowTime: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
682
+ readonly keyframeSpacing: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, v.MinValueAction<number, 1, undefined>]>, undefined>;
683
+ readonly maxGrpSapStartingType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
684
+ readonly maxObjSapStartingType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
685
+ }, undefined>, v.CheckAction<{
686
+ namespace?: Tuple | undefined;
687
+ name: string;
688
+ packaging: string;
689
+ packagingMetadata?: Record<string, string> | undefined;
690
+ eventType?: string | undefined;
691
+ role?: string | undefined;
692
+ isLive: boolean;
693
+ targetLatency?: number | undefined;
694
+ buffers?: ({
695
+ target?: number | undefined;
696
+ min?: number | undefined;
697
+ max?: number | undefined;
698
+ } & {
699
+ [key: string]: unknown;
700
+ }) | undefined;
701
+ label?: string | undefined;
702
+ renderGroup?: number | undefined;
703
+ altGroup?: number | undefined;
704
+ initRef?: string | undefined;
705
+ depends?: (string | number)[] | undefined;
706
+ template?: {
707
+ startMediaTime: number;
708
+ deltaMediaTime: number;
709
+ startLocation: [number, number];
710
+ deltaLocation: [number, number];
711
+ startWallclock: number;
712
+ deltaWallclock: number;
713
+ } | undefined;
714
+ temporalId?: number | undefined;
715
+ spatialId?: number | undefined;
716
+ codec?: string | undefined;
717
+ mimeType?: string | undefined;
718
+ framerate?: number | undefined;
719
+ timescale?: number | undefined;
720
+ bitrate?: number | undefined;
721
+ avgBitrate?: number | undefined;
722
+ maxGopDuration?: number | undefined;
723
+ maxGroupDuration?: number | undefined;
724
+ width?: number | undefined;
725
+ height?: number | undefined;
726
+ samplerate?: number | undefined;
727
+ channelConfig?: string | undefined;
728
+ displayWidth?: number | undefined;
729
+ displayHeight?: number | undefined;
730
+ lang?: string | undefined;
731
+ parentName?: string | undefined;
732
+ parentNamespace?: string | undefined;
733
+ trackDuration?: number | undefined;
734
+ connectionUri?: string | undefined;
735
+ token?: string | undefined;
736
+ authInfo?: {
737
+ [x: string]: unknown;
738
+ } | undefined;
739
+ accessibility?: ({
740
+ scheme: string;
741
+ value: string;
742
+ } & {
743
+ [key: string]: unknown;
744
+ })[] | undefined;
745
+ accessibleWindowTime?: number | undefined;
746
+ keyframeSpacing?: number | undefined;
747
+ maxGrpSapStartingType?: number | undefined;
748
+ maxObjSapStartingType?: number | undefined;
749
+ } & {
750
+ [key: string]: unknown;
751
+ }, (issue: v.CheckIssue<{
752
+ namespace?: Tuple | undefined;
753
+ name: string;
754
+ packaging: string;
755
+ packagingMetadata?: Record<string, string> | undefined;
756
+ eventType?: string | undefined;
757
+ role?: string | undefined;
758
+ isLive: boolean;
759
+ targetLatency?: number | undefined;
760
+ buffers?: ({
761
+ target?: number | undefined;
762
+ min?: number | undefined;
763
+ max?: number | undefined;
764
+ } & {
765
+ [key: string]: unknown;
766
+ }) | undefined;
767
+ label?: string | undefined;
768
+ renderGroup?: number | undefined;
769
+ altGroup?: number | undefined;
770
+ initRef?: string | undefined;
771
+ depends?: (string | number)[] | undefined;
772
+ template?: {
773
+ startMediaTime: number;
774
+ deltaMediaTime: number;
775
+ startLocation: [number, number];
776
+ deltaLocation: [number, number];
777
+ startWallclock: number;
778
+ deltaWallclock: number;
779
+ } | undefined;
780
+ temporalId?: number | undefined;
781
+ spatialId?: number | undefined;
782
+ codec?: string | undefined;
783
+ mimeType?: string | undefined;
784
+ framerate?: number | undefined;
785
+ timescale?: number | undefined;
786
+ bitrate?: number | undefined;
787
+ avgBitrate?: number | undefined;
788
+ maxGopDuration?: number | undefined;
789
+ maxGroupDuration?: number | undefined;
790
+ width?: number | undefined;
791
+ height?: number | undefined;
792
+ samplerate?: number | undefined;
793
+ channelConfig?: string | undefined;
794
+ displayWidth?: number | undefined;
795
+ displayHeight?: number | undefined;
796
+ lang?: string | undefined;
797
+ parentName?: string | undefined;
798
+ parentNamespace?: string | undefined;
799
+ trackDuration?: number | undefined;
800
+ connectionUri?: string | undefined;
801
+ token?: string | undefined;
802
+ authInfo?: {
803
+ [x: string]: unknown;
804
+ } | undefined;
805
+ accessibility?: ({
806
+ scheme: string;
807
+ value: string;
808
+ } & {
809
+ [key: string]: unknown;
810
+ })[] | undefined;
811
+ accessibleWindowTime?: number | undefined;
812
+ keyframeSpacing?: number | undefined;
813
+ maxGrpSapStartingType?: number | undefined;
814
+ maxObjSapStartingType?: number | undefined;
815
+ } & {
816
+ [key: string]: unknown;
817
+ }>) => string>, v.CheckAction<{
818
+ namespace?: Tuple | undefined;
819
+ name: string;
820
+ packaging: string;
821
+ packagingMetadata?: Record<string, string> | undefined;
822
+ eventType?: string | undefined;
823
+ role?: string | undefined;
824
+ isLive: boolean;
825
+ targetLatency?: number | undefined;
826
+ buffers?: ({
827
+ target?: number | undefined;
828
+ min?: number | undefined;
829
+ max?: number | undefined;
830
+ } & {
831
+ [key: string]: unknown;
832
+ }) | undefined;
833
+ label?: string | undefined;
834
+ renderGroup?: number | undefined;
835
+ altGroup?: number | undefined;
836
+ initRef?: string | undefined;
837
+ depends?: (string | number)[] | undefined;
838
+ template?: {
839
+ startMediaTime: number;
840
+ deltaMediaTime: number;
841
+ startLocation: [number, number];
842
+ deltaLocation: [number, number];
843
+ startWallclock: number;
844
+ deltaWallclock: number;
845
+ } | undefined;
846
+ temporalId?: number | undefined;
847
+ spatialId?: number | undefined;
848
+ codec?: string | undefined;
849
+ mimeType?: string | undefined;
850
+ framerate?: number | undefined;
851
+ timescale?: number | undefined;
852
+ bitrate?: number | undefined;
853
+ avgBitrate?: number | undefined;
854
+ maxGopDuration?: number | undefined;
855
+ maxGroupDuration?: number | undefined;
856
+ width?: number | undefined;
857
+ height?: number | undefined;
858
+ samplerate?: number | undefined;
859
+ channelConfig?: string | undefined;
860
+ displayWidth?: number | undefined;
861
+ displayHeight?: number | undefined;
862
+ lang?: string | undefined;
863
+ parentName?: string | undefined;
864
+ parentNamespace?: string | undefined;
865
+ trackDuration?: number | undefined;
866
+ connectionUri?: string | undefined;
867
+ token?: string | undefined;
868
+ authInfo?: {
869
+ [x: string]: unknown;
870
+ } | undefined;
871
+ accessibility?: ({
872
+ scheme: string;
873
+ value: string;
874
+ } & {
875
+ [key: string]: unknown;
876
+ })[] | undefined;
877
+ accessibleWindowTime?: number | undefined;
878
+ keyframeSpacing?: number | undefined;
879
+ maxGrpSapStartingType?: number | undefined;
880
+ maxObjSapStartingType?: number | undefined;
881
+ } & {
882
+ [key: string]: unknown;
883
+ }, "eventType goes with, and only with, eventtimeline packaging (MSF 5.2.6)">, v.CheckAction<{
884
+ namespace?: Tuple | undefined;
885
+ name: string;
886
+ packaging: string;
887
+ packagingMetadata?: Record<string, string> | undefined;
888
+ eventType?: string | undefined;
889
+ role?: string | undefined;
890
+ isLive: boolean;
891
+ targetLatency?: number | undefined;
892
+ buffers?: ({
893
+ target?: number | undefined;
894
+ min?: number | undefined;
895
+ max?: number | undefined;
896
+ } & {
897
+ [key: string]: unknown;
898
+ }) | undefined;
899
+ label?: string | undefined;
900
+ renderGroup?: number | undefined;
901
+ altGroup?: number | undefined;
902
+ initRef?: string | undefined;
903
+ depends?: (string | number)[] | undefined;
904
+ template?: {
905
+ startMediaTime: number;
906
+ deltaMediaTime: number;
907
+ startLocation: [number, number];
908
+ deltaLocation: [number, number];
909
+ startWallclock: number;
910
+ deltaWallclock: number;
911
+ } | undefined;
912
+ temporalId?: number | undefined;
913
+ spatialId?: number | undefined;
914
+ codec?: string | undefined;
915
+ mimeType?: string | undefined;
916
+ framerate?: number | undefined;
917
+ timescale?: number | undefined;
918
+ bitrate?: number | undefined;
919
+ avgBitrate?: number | undefined;
920
+ maxGopDuration?: number | undefined;
921
+ maxGroupDuration?: number | undefined;
922
+ width?: number | undefined;
923
+ height?: number | undefined;
924
+ samplerate?: number | undefined;
925
+ channelConfig?: string | undefined;
926
+ displayWidth?: number | undefined;
927
+ displayHeight?: number | undefined;
928
+ lang?: string | undefined;
929
+ parentName?: string | undefined;
930
+ parentNamespace?: string | undefined;
931
+ trackDuration?: number | undefined;
932
+ connectionUri?: string | undefined;
933
+ token?: string | undefined;
934
+ authInfo?: {
935
+ [x: string]: unknown;
936
+ } | undefined;
937
+ accessibility?: ({
938
+ scheme: string;
939
+ value: string;
940
+ } & {
941
+ [key: string]: unknown;
942
+ })[] | undefined;
943
+ accessibleWindowTime?: number | undefined;
944
+ keyframeSpacing?: number | undefined;
945
+ maxGrpSapStartingType?: number | undefined;
946
+ maxObjSapStartingType?: number | undefined;
947
+ } & {
948
+ [key: string]: unknown;
949
+ }, "targetLatency and buffers are mutually exclusive (MSF 5.2.9)">, v.CheckAction<{
950
+ namespace?: Tuple | undefined;
951
+ name: string;
952
+ packaging: string;
953
+ packagingMetadata?: Record<string, string> | undefined;
954
+ eventType?: string | undefined;
955
+ role?: string | undefined;
956
+ isLive: boolean;
957
+ targetLatency?: number | undefined;
958
+ buffers?: ({
959
+ target?: number | undefined;
960
+ min?: number | undefined;
961
+ max?: number | undefined;
962
+ } & {
963
+ [key: string]: unknown;
964
+ }) | undefined;
965
+ label?: string | undefined;
966
+ renderGroup?: number | undefined;
967
+ altGroup?: number | undefined;
968
+ initRef?: string | undefined;
969
+ depends?: (string | number)[] | undefined;
970
+ template?: {
971
+ startMediaTime: number;
972
+ deltaMediaTime: number;
973
+ startLocation: [number, number];
974
+ deltaLocation: [number, number];
975
+ startWallclock: number;
976
+ deltaWallclock: number;
977
+ } | undefined;
978
+ temporalId?: number | undefined;
979
+ spatialId?: number | undefined;
980
+ codec?: string | undefined;
981
+ mimeType?: string | undefined;
982
+ framerate?: number | undefined;
983
+ timescale?: number | undefined;
984
+ bitrate?: number | undefined;
985
+ avgBitrate?: number | undefined;
986
+ maxGopDuration?: number | undefined;
987
+ maxGroupDuration?: number | undefined;
988
+ width?: number | undefined;
989
+ height?: number | undefined;
990
+ samplerate?: number | undefined;
991
+ channelConfig?: string | undefined;
992
+ displayWidth?: number | undefined;
993
+ displayHeight?: number | undefined;
994
+ lang?: string | undefined;
995
+ parentName?: string | undefined;
996
+ parentNamespace?: string | undefined;
997
+ trackDuration?: number | undefined;
998
+ connectionUri?: string | undefined;
999
+ token?: string | undefined;
1000
+ authInfo?: {
1001
+ [x: string]: unknown;
1002
+ } | undefined;
1003
+ accessibility?: ({
1004
+ scheme: string;
1005
+ value: string;
1006
+ } & {
1007
+ [key: string]: unknown;
1008
+ })[] | undefined;
1009
+ accessibleWindowTime?: number | undefined;
1010
+ keyframeSpacing?: number | undefined;
1011
+ maxGrpSapStartingType?: number | undefined;
1012
+ maxObjSapStartingType?: number | undefined;
1013
+ } & {
1014
+ [key: string]: unknown;
1015
+ }, "a live track has no trackDuration (MSF 5.2.36)">, v.TransformAction<{
1016
+ namespace?: Tuple | undefined;
1017
+ name: string;
1018
+ packaging: string;
1019
+ packagingMetadata?: Record<string, string> | undefined;
1020
+ eventType?: string | undefined;
1021
+ role?: string | undefined;
1022
+ isLive: boolean;
1023
+ targetLatency?: number | undefined;
1024
+ buffers?: ({
1025
+ target?: number | undefined;
1026
+ min?: number | undefined;
1027
+ max?: number | undefined;
1028
+ } & {
1029
+ [key: string]: unknown;
1030
+ }) | undefined;
1031
+ label?: string | undefined;
1032
+ renderGroup?: number | undefined;
1033
+ altGroup?: number | undefined;
1034
+ initRef?: string | undefined;
1035
+ depends?: (string | number)[] | undefined;
1036
+ template?: {
1037
+ startMediaTime: number;
1038
+ deltaMediaTime: number;
1039
+ startLocation: [number, number];
1040
+ deltaLocation: [number, number];
1041
+ startWallclock: number;
1042
+ deltaWallclock: number;
1043
+ } | undefined;
1044
+ temporalId?: number | undefined;
1045
+ spatialId?: number | undefined;
1046
+ codec?: string | undefined;
1047
+ mimeType?: string | undefined;
1048
+ framerate?: number | undefined;
1049
+ timescale?: number | undefined;
1050
+ bitrate?: number | undefined;
1051
+ avgBitrate?: number | undefined;
1052
+ maxGopDuration?: number | undefined;
1053
+ maxGroupDuration?: number | undefined;
1054
+ width?: number | undefined;
1055
+ height?: number | undefined;
1056
+ samplerate?: number | undefined;
1057
+ channelConfig?: string | undefined;
1058
+ displayWidth?: number | undefined;
1059
+ displayHeight?: number | undefined;
1060
+ lang?: string | undefined;
1061
+ parentName?: string | undefined;
1062
+ parentNamespace?: string | undefined;
1063
+ trackDuration?: number | undefined;
1064
+ connectionUri?: string | undefined;
1065
+ token?: string | undefined;
1066
+ authInfo?: {
1067
+ [x: string]: unknown;
1068
+ } | undefined;
1069
+ accessibility?: ({
1070
+ scheme: string;
1071
+ value: string;
1072
+ } & {
1073
+ [key: string]: unknown;
1074
+ })[] | undefined;
1075
+ accessibleWindowTime?: number | undefined;
1076
+ keyframeSpacing?: number | undefined;
1077
+ maxGrpSapStartingType?: number | undefined;
1078
+ maxObjSapStartingType?: number | undefined;
1079
+ } & {
1080
+ [key: string]: unknown;
1081
+ }, {
1082
+ namespace?: Tuple | undefined;
1083
+ name: string;
1084
+ packaging: string;
1085
+ packagingMetadata?: Record<string, string> | undefined;
1086
+ eventType?: string | undefined;
1087
+ role?: string | undefined;
1088
+ isLive: boolean;
1089
+ targetLatency?: number | undefined;
1090
+ buffers?: ({
1091
+ target?: number | undefined;
1092
+ min?: number | undefined;
1093
+ max?: number | undefined;
1094
+ } & {
1095
+ [key: string]: unknown;
1096
+ }) | undefined;
1097
+ label?: string | undefined;
1098
+ renderGroup?: number | undefined;
1099
+ altGroup?: number | undefined;
1100
+ initRef?: string | undefined;
1101
+ depends?: (string | number)[] | undefined;
1102
+ template?: {
1103
+ startMediaTime: number;
1104
+ deltaMediaTime: number;
1105
+ startLocation: [number, number];
1106
+ deltaLocation: [number, number];
1107
+ startWallclock: number;
1108
+ deltaWallclock: number;
1109
+ } | undefined;
1110
+ temporalId?: number | undefined;
1111
+ spatialId?: number | undefined;
1112
+ codec?: string | undefined;
1113
+ mimeType?: string | undefined;
1114
+ framerate?: number | undefined;
1115
+ timescale?: number | undefined;
1116
+ bitrate?: number | undefined;
1117
+ avgBitrate?: number | undefined;
1118
+ maxGopDuration?: number | undefined;
1119
+ maxGroupDuration?: number | undefined;
1120
+ width?: number | undefined;
1121
+ height?: number | undefined;
1122
+ samplerate?: number | undefined;
1123
+ channelConfig?: string | undefined;
1124
+ displayWidth?: number | undefined;
1125
+ displayHeight?: number | undefined;
1126
+ lang?: string | undefined;
1127
+ parentName?: string | undefined;
1128
+ parentNamespace?: string | undefined;
1129
+ trackDuration?: number | undefined;
1130
+ connectionUri?: string | undefined;
1131
+ token?: string | undefined;
1132
+ authInfo?: {
1133
+ [x: string]: unknown;
1134
+ } | undefined;
1135
+ accessibility?: ({
1136
+ scheme: string;
1137
+ value: string;
1138
+ } & {
1139
+ [key: string]: unknown;
1140
+ })[] | undefined;
1141
+ accessibleWindowTime?: number | undefined;
1142
+ keyframeSpacing?: number | undefined;
1143
+ maxGrpSapStartingType?: number | undefined;
1144
+ maxObjSapStartingType?: number | undefined;
1145
+ } & {
1146
+ [key: string]: unknown;
1147
+ } & {
1148
+ nameBytes: Uint8Array;
1149
+ namespace: Tuple;
1150
+ init?: InitData;
1151
+ }>]>, undefined>, undefined>;
1152
+ readonly initDataList: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
1153
+ readonly id: v.StringSchema<undefined>;
1154
+ readonly type: v.PicklistSchema<["inline", "track-property", "object-property"], undefined>;
1155
+ readonly data: v.StringSchema<undefined>;
1156
+ }, undefined>, v.CheckAction<{
1157
+ id: string;
1158
+ type: "inline" | "track-property" | "object-property";
1159
+ data: string;
1160
+ }, "initDataList data must be base64, or a property type in hex (MSF 5.1.7)">, v.TransformAction<{
1161
+ id: string;
1162
+ type: "inline" | "track-property" | "object-property";
1163
+ data: string;
1164
+ }, {
1165
+ id: string;
1166
+ init: InitData;
1167
+ }>]>, undefined>, undefined>;
1168
+ }, undefined>, v.CheckAction<{
1169
+ version: "draft-01";
1170
+ generatedAt?: number | undefined;
1171
+ isComplete?: true | undefined;
1172
+ tracks: ({
1173
+ namespace?: Tuple | undefined;
1174
+ name: string;
1175
+ packaging: string;
1176
+ packagingMetadata?: Record<string, string> | undefined;
1177
+ eventType?: string | undefined;
1178
+ role?: string | undefined;
1179
+ isLive: boolean;
1180
+ targetLatency?: number | undefined;
1181
+ buffers?: ({
1182
+ target?: number | undefined;
1183
+ min?: number | undefined;
1184
+ max?: number | undefined;
1185
+ } & {
1186
+ [key: string]: unknown;
1187
+ }) | undefined;
1188
+ label?: string | undefined;
1189
+ renderGroup?: number | undefined;
1190
+ altGroup?: number | undefined;
1191
+ initRef?: string | undefined;
1192
+ depends?: (string | number)[] | undefined;
1193
+ template?: {
1194
+ startMediaTime: number;
1195
+ deltaMediaTime: number;
1196
+ startLocation: [number, number];
1197
+ deltaLocation: [number, number];
1198
+ startWallclock: number;
1199
+ deltaWallclock: number;
1200
+ } | undefined;
1201
+ temporalId?: number | undefined;
1202
+ spatialId?: number | undefined;
1203
+ codec?: string | undefined;
1204
+ mimeType?: string | undefined;
1205
+ framerate?: number | undefined;
1206
+ timescale?: number | undefined;
1207
+ bitrate?: number | undefined;
1208
+ avgBitrate?: number | undefined;
1209
+ maxGopDuration?: number | undefined;
1210
+ maxGroupDuration?: number | undefined;
1211
+ width?: number | undefined;
1212
+ height?: number | undefined;
1213
+ samplerate?: number | undefined;
1214
+ channelConfig?: string | undefined;
1215
+ displayWidth?: number | undefined;
1216
+ displayHeight?: number | undefined;
1217
+ lang?: string | undefined;
1218
+ parentName?: string | undefined;
1219
+ parentNamespace?: string | undefined;
1220
+ trackDuration?: number | undefined;
1221
+ connectionUri?: string | undefined;
1222
+ token?: string | undefined;
1223
+ authInfo?: {
1224
+ [x: string]: unknown;
1225
+ } | undefined;
1226
+ accessibility?: ({
1227
+ scheme: string;
1228
+ value: string;
1229
+ } & {
1230
+ [key: string]: unknown;
1231
+ })[] | undefined;
1232
+ accessibleWindowTime?: number | undefined;
1233
+ keyframeSpacing?: number | undefined;
1234
+ maxGrpSapStartingType?: number | undefined;
1235
+ maxObjSapStartingType?: number | undefined;
1236
+ } & {
1237
+ [key: string]: unknown;
1238
+ } & {
1239
+ nameBytes: Uint8Array;
1240
+ namespace: Tuple;
1241
+ init?: InitData;
1242
+ })[];
1243
+ publishTracks?: ({
1244
+ namespace?: Tuple | undefined;
1245
+ name: string;
1246
+ packaging: string;
1247
+ packagingMetadata?: Record<string, string> | undefined;
1248
+ eventType?: string | undefined;
1249
+ role?: string | undefined;
1250
+ isLive: boolean;
1251
+ targetLatency?: number | undefined;
1252
+ buffers?: ({
1253
+ target?: number | undefined;
1254
+ min?: number | undefined;
1255
+ max?: number | undefined;
1256
+ } & {
1257
+ [key: string]: unknown;
1258
+ }) | undefined;
1259
+ label?: string | undefined;
1260
+ renderGroup?: number | undefined;
1261
+ altGroup?: number | undefined;
1262
+ initRef?: string | undefined;
1263
+ depends?: (string | number)[] | undefined;
1264
+ template?: {
1265
+ startMediaTime: number;
1266
+ deltaMediaTime: number;
1267
+ startLocation: [number, number];
1268
+ deltaLocation: [number, number];
1269
+ startWallclock: number;
1270
+ deltaWallclock: number;
1271
+ } | undefined;
1272
+ temporalId?: number | undefined;
1273
+ spatialId?: number | undefined;
1274
+ codec?: string | undefined;
1275
+ mimeType?: string | undefined;
1276
+ framerate?: number | undefined;
1277
+ timescale?: number | undefined;
1278
+ bitrate?: number | undefined;
1279
+ avgBitrate?: number | undefined;
1280
+ maxGopDuration?: number | undefined;
1281
+ maxGroupDuration?: number | undefined;
1282
+ width?: number | undefined;
1283
+ height?: number | undefined;
1284
+ samplerate?: number | undefined;
1285
+ channelConfig?: string | undefined;
1286
+ displayWidth?: number | undefined;
1287
+ displayHeight?: number | undefined;
1288
+ lang?: string | undefined;
1289
+ parentName?: string | undefined;
1290
+ parentNamespace?: string | undefined;
1291
+ trackDuration?: number | undefined;
1292
+ connectionUri?: string | undefined;
1293
+ token?: string | undefined;
1294
+ authInfo?: {
1295
+ [x: string]: unknown;
1296
+ } | undefined;
1297
+ accessibility?: ({
1298
+ scheme: string;
1299
+ value: string;
1300
+ } & {
1301
+ [key: string]: unknown;
1302
+ })[] | undefined;
1303
+ accessibleWindowTime?: number | undefined;
1304
+ keyframeSpacing?: number | undefined;
1305
+ maxGrpSapStartingType?: number | undefined;
1306
+ maxObjSapStartingType?: number | undefined;
1307
+ } & {
1308
+ [key: string]: unknown;
1309
+ } & {
1310
+ nameBytes: Uint8Array;
1311
+ namespace: Tuple;
1312
+ init?: InitData;
1313
+ })[] | undefined;
1314
+ initDataList?: {
1315
+ id: string;
1316
+ init: InitData;
1317
+ }[] | undefined;
1318
+ } & {
1319
+ [key: string]: unknown;
1320
+ }, "an initRef names no initDataList entry (MSF 5.2.14)">]>;
1321
+ type CatalogSchema = ReturnType<typeof catalogSchema>;
1322
+ /** @public A catalog as a publisher writes it (MSF 5.1). */
1323
+ type CatalogJson = v.InferInput<CatalogSchema>;
1324
+ /** @public A parsed, validated catalog. */
1325
+ type Catalog = v.InferOutput<CatalogSchema> & {
1326
+ /** The document after variable substitution, which delta updates apply to (MSF 5.3). */
1327
+ json: CatalogDocument;
1328
+ };
1329
+ /**
1330
+ * @public
1331
+ * A parsed catalog track. Field names follow MSF 5.2 and CMSF 3.5.2, unknown fields are kept.
1332
+ * `nameBytes` and `namespace` are the MOQT bytes (MSF 11.2), the namespace inherited from the
1333
+ * catalog track when the track has none, and `init` is resolved from `initRef`.
1334
+ */
1335
+ type CatalogTrack = Catalog['tracks'][number];
1336
+ /** @public The media timeline template of MSF 7.4.1, with named fields. */
1337
+ type MediaTimelineTemplate = NonNullable<CatalogTrack['template']>;
1338
+ /** A valid catalog document, as JSON. */
1339
+ interface CatalogDocument {
1340
+ tracks: Record<string, unknown>[];
1341
+ [field: string]: unknown;
1342
+ }
1343
+ /** @public Key of {@link MediaSinkElement}. */
1344
+ declare const MEDIA_SINK: unique symbol;
1345
+ /** @public Key of {@link MediaSourceElement}. */
1346
+ declare const MEDIA_SOURCE: unique symbol;
1347
+ /** @public Marks a {@link MediaSourceElement} that switches among its selected renditions itself (ABR). */
1348
+ declare const ABR: unique symbol;
1349
+ /** @public Maps each interface key to its interface. New interfaces add a line here. */
1350
+ interface ElementInterfaces {
1351
+ [MEDIA_SINK]: MediaSinkElement;
1352
+ [MEDIA_SOURCE]: MediaSourceElement;
1353
+ [ABR]: MediaSourceElement;
1354
+ }
1355
+ /** @public */
1356
+ type InterfaceKey = keyof ElementInterfaces;
1357
+ /**
1358
+ * @public
1359
+ * Implemented by sinks that drive a display backend. Times are in seconds.
1360
+ * Dispatches `playing`, `pause`, `stalled`, `waiting`, `ended`, and `timeupdate`.
1361
+ */
1362
+ interface MediaSinkElement extends EventTarget {
1363
+ readonly currentTime: number;
1364
+ readonly buffered: TimeRanges;
1365
+ readonly paused: boolean;
1366
+ readonly seeking: boolean;
1367
+ readonly ended: boolean;
1368
+ readonly playbackRate: number;
1369
+ /** Where the live edge starts (media-ui-extensions proposal 0007); `NaN` on demand. */
1370
+ readonly liveEdgeStart: number;
1371
+ setPlaybackRate(rate: number): void;
1372
+ play(): Promise<void>;
1373
+ pause(): Promise<void>;
1374
+ seek(mediaTime: number): Promise<void>;
1375
+ }
1376
+ /** @public Implemented by sources that deliver media and handle a switching set. */
1377
+ interface MediaSourceElement {
1378
+ getRenditions(): Rendition[];
1379
+ switch(renditionId: string): Promise<void>;
1380
+ /** Sets which renditions ABR may choose from. */
1381
+ selectRenditions(renditionIds: string[]): Promise<void>;
1382
+ /** Called by the catalog element when an update changes this source's switching set. */
1383
+ setTracks(tracks: readonly CatalogTrack[]): void;
1384
+ }
1385
+ /** @public One track of a media source's switching set. */
1386
+ interface Rendition {
1387
+ /** Track name, with the namespace when it differs from the catalog's. */
1388
+ id: string;
1389
+ src: string;
1390
+ bitrate: number;
1391
+ codec: string;
1392
+ width?: number;
1393
+ height?: number;
1394
+ frameRate?: number;
1395
+ /** Currently playing. */
1396
+ active: boolean;
1397
+ /** Considered for ABR. */
1398
+ selected: boolean;
1399
+ }
1400
+ /** @public What the catalog element offers the elements it loads. Updates arrive with the player's `catalog` event. */
1401
+ interface CatalogReader {
1402
+ /** The catalog's session URL, `moqt://authority/path[?query]` without a fragment. */
1403
+ readonly url: string;
1404
+ /** The catalog track's namespace. */
1405
+ readonly namespace: Tuple;
1406
+ /** The last good catalog. */
1407
+ readonly tracks: readonly CatalogTrack[];
1408
+ readonly isComplete: boolean;
1409
+ /** Loads (shared) the media timeline element for the track, or wraps its template. Undefined if neither exists. */
1410
+ timeline(track: CatalogTrack): Promise<TimelineReader | undefined>;
1411
+ }
1412
+ /** @public Translates between media time, wallclock time, and locations. Times in milliseconds. */
1413
+ interface TimelineReader {
1414
+ /** The group containing that time. */
1415
+ timeToLocation(mediaTimeMs: number): Location | undefined;
1416
+ locationToTime(location: Location): number | undefined;
1417
+ wallclockToLocation(wallclockMs: number): Location | undefined;
1418
+ /** When that media time was produced (MSF 11.6). Undefined without wallclock values. */
1419
+ timeToWallclock(mediaTimeMs: number): number | undefined;
1420
+ /** Media time, after `accessibleWindowTime`. */
1421
+ readonly range: {
1422
+ start: number;
1423
+ end: number;
1424
+ } | undefined;
1425
+ }
1426
+ /**
1427
+ * @public
1428
+ * Load options every media source takes. The catalog element, and wrapping sources such as
1429
+ * the SSTS one, pass them to whichever source the probe picks.
1430
+ */
1431
+ interface MediaSourceOptions {
1432
+ /** From the catalog source options: switch with `SWITCH_FROM`. */
1433
+ switchFrom?: boolean;
1434
+ /** From the catalog URL. */
1435
+ ranges?: Pick<MsfSource, 'locationRanges' | 'mediaTimeRanges' | 'wallclockRanges'>;
1436
+ /** How a parent adds to every SUBSCRIBE and FETCH the source sends. */
1437
+ requests?: RequestHooks;
1438
+ }
1439
+ /**
1440
+ * @public
1441
+ * What an extension's switching set source is loaded with: the media source options, and the
1442
+ * definition the probe picked for the set's tracks.
1443
+ */
1444
+ interface SwitchingSetOptions extends MediaSourceOptions {
1445
+ child: SourceElementDefinition;
1446
+ }
1447
+ /**
1448
+ * @public
1449
+ * Called for every SUBSCRIBE and FETCH a media source sends: start, retry, reconnect,
1450
+ * seek, switch, ranges. How a parent such as an SSTS source adds to the requests. The
1451
+ * hooks run last, after the source built its own options, and `subscribed` and `fetched`
1452
+ * get the options that were actually sent. They aren't called for rejected requests.
1453
+ */
1454
+ interface RequestHooks {
1455
+ subscribe?(track: CatalogTrack, options: SubscribeOptions): SubscribeOptions;
1456
+ subscribed?(track: CatalogTrack, result: SubscribeResult, options: SubscribeOptions): void;
1457
+ fetch?(track: CatalogTrack, options: FetchOptions): FetchOptions;
1458
+ fetched?(track: CatalogTrack, result: FetchResult, options: FetchOptions): void;
1459
+ }
1460
+ /** @public What a capability describes. */
1461
+ declare enum CapabilityCode {
1462
+ PACKAGING = 0,
1463
+ ROLE = 1,
1464
+ CODEC = 2,
1465
+ MIME_TYPE = 3,
1466
+ EVENT_TYPE = 4
1467
+ }
1468
+ /** @public `in` describes a sink pad, `out` a source pad. */
1469
+ interface Capability {
1470
+ direction: 'in' | 'out';
1471
+ code: CapabilityCode;
1472
+ value: string;
1473
+ }
1474
+ /** @public */
1475
+ type Capabilities = Capability[];
1476
+ /** @public Each bundle describes one pad the element can create. */
1477
+ type CapabilityBundles = Capabilities[];
1478
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
1479
+ /** @public The intersection of every interface listed in `provides`. */
1480
+ type Provided<P extends readonly InterfaceKey[]> = [P[number]] extends [never] ? unknown : UnionToIntersection<ElementInterfaces[P[number]]>;
1481
+ /**
1482
+ * @public
1483
+ * What identifies a track: `MsfSource` fields from the URI, plus catalog fields (MSF 5.2)
1484
+ * once a catalog exists.
1485
+ */
1486
+ type Identifiers = Partial<MsfSource> & Partial<CatalogTrack>;
1487
+ /** @public Among the probes that accept a track, the lowest priority wins. */
1488
+ declare const DEFAULT_PRIORITY = 100;
1489
+ /** @public What the registry stores. */
1490
+ interface ElementDefinition<E extends BaseElement = BaseElement, P extends readonly InterfaceKey[] = readonly InterfaceKey[]> {
1491
+ readonly type: 'source' | 'transform' | 'sink';
1492
+ readonly name: string;
1493
+ readonly capabilities: CapabilityBundles;
1494
+ /** Ranks the probes that accept a track: lower wins, then the earlier definition. Default 100. */
1495
+ readonly priority?: number;
1496
+ /** The optional interfaces this element implements. */
1497
+ readonly provides?: P;
1498
+ /** Rejection might mean a browser API or a peer dependency is missing. */
1499
+ init(context: ElementContext, options?: Record<string, any>): Promise<E>;
1500
+ }
1501
+ /** @public */
1502
+ interface SourceElementDefinition<E extends SourceElement = SourceElement, P extends readonly InterfaceKey[] = readonly InterfaceKey[]> extends ElementDefinition<E, P> {
1503
+ readonly type: 'source';
1504
+ /** Whether this element handles the track. */
1505
+ probe(identifiers: Identifiers): boolean;
1506
+ }
1507
+ /** @public */
1508
+ interface TransformElementDefinition<E extends TransformElement = TransformElement, P extends readonly InterfaceKey[] = readonly InterfaceKey[]> extends ElementDefinition<E, P> {
1509
+ readonly type: 'transform';
1510
+ }
1511
+ /** @public */
1512
+ interface SinkElementDefinition<E extends SinkElement = SinkElement, P extends readonly InterfaceKey[] = readonly InterfaceKey[]> extends ElementDefinition<E, P> {
1513
+ readonly type: 'sink';
1514
+ }
1515
+ /**
1516
+ * @public
1517
+ * Checks an element definition and returns it with its types preserved. The instance
1518
+ * `init` returns gets a read-only `definition` property pointing at the returned object.
1519
+ * Invalid definitions throw `TypeError`, since they're programming errors.
1520
+ */
1521
+ declare function defineElement<E extends SourceElement & Provided<P>, const P extends readonly InterfaceKey[] = []>(definition: SourceElementDefinition<E, P>): SourceElementDefinition<E, P>;
1522
+ declare function defineElement<E extends TransformElement & Provided<P>, const P extends readonly InterfaceKey[] = []>(definition: TransformElementDefinition<E, P>): TransformElementDefinition<E, P>;
1523
+ declare function defineElement<E extends SinkElement & Provided<P>, const P extends readonly InterfaceKey[] = []>(definition: SinkElementDefinition<E, P>): SinkElementDefinition<E, P>;
1524
+ /** @public Narrows an element to an interface it lists in `provides`. */
1525
+ declare function hasInterface<E extends BaseElement, K extends InterfaceKey>(element: E, key: K): element is E & ElementInterfaces[K];
1526
+ /** @public What elements see of the player: its events and options. */
1527
+ type PlayerHandle = Emitter<PlayerEvents> & Pick<MOQtailPlayer, 'options' | 'bufferController'>;
1528
+ /** @public Given to `init`, one per element instance. */
1529
+ interface ElementContext {
1530
+ readonly player: PlayerHandle;
1531
+ /** Always the current client, it changes after a reconnect. */
1532
+ readonly client: MOQtailClient;
1533
+ /** Aborted when the instance is destroyed. */
1534
+ readonly signal: AbortSignal;
1535
+ /** The tracks this instance was loaded for, empty without a catalog. */
1536
+ readonly tracks: readonly CatalogTrack[];
1537
+ /** Set for elements the catalog loads, and inherited by what they load. */
1538
+ readonly catalog?: CatalogReader;
1539
+ /** Called by the `BaseElement` constructor, so the player hears what the instance emits. */
1540
+ attach(element: BaseElement): void;
1541
+ /** Returns the existing instance when the same definition and tracks are already loaded. */
1542
+ load<E extends BaseElement>(definition: ElementDefinition<E>, request?: ElementLoadRequest): Promise<E>;
1543
+ /** Drops this element's reference to one it loaded; it's destroyed once no holder is left. */
1544
+ release(element: BaseElement): Promise<void>;
1545
+ /** The source definition the player would pick for `identifiers`, as `source()` does. */
1546
+ probe(identifiers: Identifiers): SourceElementDefinition | undefined;
1547
+ /** The active plugins' switch source that ranks first for `identifiers`, as `probe()` ranks. */
1548
+ switchSource(identifiers: Identifiers): SourceElementDefinition | undefined;
1549
+ }
1550
+ /** @public */
1551
+ interface ElementLoadRequest {
1552
+ tracks?: readonly CatalogTrack[];
1553
+ /** The first load's options apply; a later load with different options is an error. */
1554
+ options?: Record<string, any>;
1555
+ /** Defaults to the caller's catalog. */
1556
+ catalog?: CatalogReader;
1557
+ /** `false` always creates a new instance that later loads never find, so its options aren't compared. */
1558
+ shared?: false;
1559
+ }
1560
+ /** @public What an element receives on a sink pad. */
1561
+ type PadItem = {
1562
+ type: 'packet';
1563
+ object: MoqtObject;
1564
+ } | {
1565
+ type: 'properties';
1566
+ properties: Partial<PadProperties>;
1567
+ };
1568
+ /** @public What an element can write to a source pad. */
1569
+ type PadOutput = PadItem | {
1570
+ type: 'event';
1571
+ event: PadEvent;
1572
+ };
1573
+ /** @public Well-known pad properties. Elements add their own by augmenting this interface. */
1574
+ interface PadProperties {
1575
+ /** The active track of the switching set. */
1576
+ track?: string;
1577
+ /** Including codec, e.g. `video/mp4; codecs="avc1.64001f"`. */
1578
+ mimeType?: string;
1579
+ initData?: Uint8Array;
1580
+ live?: boolean;
1581
+ /** Seconds, for VOD `MediaSource.duration`. */
1582
+ duration?: number;
1583
+ /** Seconds: the catalog's `targetLatency`, else `buffers.target`. */
1584
+ targetLatency?: number;
1585
+ /** Seconds: the catalog's `maxGroupDuration`, else the observed group duration. */
1586
+ groupDuration?: number;
1587
+ /** Seconds: the media timeline's range, after `accessibleWindowTime`. */
1588
+ seekable?: {
1589
+ start: number;
1590
+ end: number;
1591
+ };
1592
+ }
1593
+ /** @public Written to a source pad, delivered in order with the packets around it. */
1594
+ type PadEvent = {
1595
+ type: 'discontinuity';
1596
+ reason: 'seek' | 'gap';
1597
+ mediaTime?: number;
1598
+ failed?: boolean;
1599
+ } | {
1600
+ type: 'eos';
1601
+ };
1602
+ /** @public Sent with `signal()`, delivered immediately ahead of anything written. */
1603
+ type PadSignal = {
1604
+ type: 'seek';
1605
+ mediaTime: number;
1606
+ } | {
1607
+ type: 'flush';
1608
+ };
1609
+ /** @public Items a connection holds before `write()` waits. */
1610
+ declare const CONNECTION_CAPACITY = 32;
1611
+ /** A transform, a sink, or a source taking a pad of an element it loaded. */
1612
+ type Consumer = BaseElement & {
1613
+ receive(pad: Pad, item: PadItem): void | Promise<void>;
1614
+ };
1615
+ type ErrorHandler = (error: unknown, destination: Pad) => void;
1616
+ /** @public One end of a connection between two elements. */
1617
+ declare class Pad {
1618
+ #private;
1619
+ readonly direction: 'src' | 'sink';
1620
+ readonly element: BaseElement;
1621
+ readonly capabilities: Capabilities;
1622
+ /** Connected pads: sink pads for a source pad, source pads for a sink pad. */
1623
+ readonly peers: Pad[];
1624
+ constructor(direction: 'src' | 'sink', element: BaseElement, capabilities: Capabilities);
1625
+ /** Source pads only. Resolves once every connection has room, await it to apply backpressure. */
1626
+ write(item: PadOutput): Promise<void>;
1627
+ /**
1628
+ * Delivers `signal` immediately to the connected pads: upstream from a sink pad, downstream
1629
+ * from a source pad, ahead of anything written. An element that doesn't handle it passes it
1630
+ * on through its other pads. Returns whether any element handled it.
1631
+ */
1632
+ signal(signal: PadSignal): boolean;
1633
+ /** Sink pads only. Return true when the event is handled; false forwards it past this pad's element. */
1634
+ onEvent(listener: (event: PadEvent) => boolean): () => void;
1635
+ /** Return true when the signal is handled; false forwards it past this pad's element. */
1636
+ onSignal(listener: (signal: PadSignal) => boolean): () => void;
1637
+ /** @internal Delivers an event; unhandled ones land behind what the element already wrote. */
1638
+ deliverEvent(event: PadEvent): Promise<void>;
1639
+ /** @internal Holds writes until the returned function is called, once the pad is routed. */
1640
+ holdWrites(): () => void;
1641
+ /** @internal Connects this source pad to a new sink pad on `element`, which then emits `padadded`. */
1642
+ connect(element: Consumer, onError: ErrorHandler): void;
1643
+ /** @internal */
1644
+ unlink(peer: Pad): void;
1645
+ }
1646
+ /** @public Signals between an element and the player. */
1647
+ interface ElementEvents {
1648
+ padadded: (pad: Pad) => void;
1649
+ /** `failed` is true when the pad was lost to a failure rather than, say, a catalog update. */
1650
+ padremoved: (pad: Pad, failed: boolean) => void;
1651
+ /** Sources emit it once every expected pad exists; the player then emits it on sinks. */
1652
+ nomorepads: () => void;
1653
+ /** Sinks emit it once they can play. */
1654
+ ready: () => void;
1655
+ }
1656
+ /** @public Base of every element instance. */
1657
+ declare abstract class BaseElement extends Emitter<ElementEvents> {
1658
+ protected readonly context: ElementContext;
1659
+ /** Set by `defineElement` once `init` resolves, so it can't be used from a constructor. */
1660
+ readonly definition: ElementDefinition;
1661
+ readonly pads: Pad[];
1662
+ /** Calls `context.attach(this)`, so the player hears everything the instance emits. */
1663
+ constructor(context: ElementContext);
1664
+ /**
1665
+ * Removes the element's pads. The runtime aborts `context.signal` before and releases the
1666
+ * elements this one loaded after. Override for your own cleanup and call `super.destroy()`.
1667
+ */
1668
+ destroy(): Promise<void>;
1669
+ /** True if the pad matches one of the definition's `in` capability bundles. */
1670
+ protected matchesCapabilities(pad: Pad): boolean;
1671
+ /** Creates a pad and emits `padadded`. */
1672
+ protected createPad(direction: 'src' | 'sink', capabilities: Capabilities): Pad;
1673
+ /** Removes a pad and emits `padremoved`. Pass `failed` when a failure, not a catalog update, lost it. */
1674
+ protected removePad(pad: Pad, failed?: boolean): void;
1675
+ }
1676
+ /** @public Writes to its source pads from anywhere, and emits `nomorepads` once every expected pad exists. */
1677
+ declare abstract class SourceElement extends BaseElement {
1678
+ /**
1679
+ * Optional: whether to take a source pad of an element this one loaded. A taken pad
1680
+ * connects to a new sink pad here instead of reaching the sinks, and its items arrive
1681
+ * through `receive()`.
1682
+ */
1683
+ negotiate?(pad: Pad): boolean;
1684
+ /** Called once per item on a taken pad; the pad's next item waits for the returned promise. */
1685
+ receive?(pad: Pad, item: PadItem): void | Promise<void>;
1686
+ }
1687
+ /** @public Takes pads from upstream and writes its output to source pads it creates. */
1688
+ declare abstract class TransformElement extends BaseElement {
1689
+ /** Whether to take this upstream source pad. */
1690
+ abstract negotiate(pad: Pad): boolean;
1691
+ /** Called once per item; the pad's next item waits for the returned promise. */
1692
+ abstract receive(pad: Pad, item: PadItem): void | Promise<void>;
1693
+ }
1694
+ /** @public Consumes pads. Listens for `nomorepads` to learn every source has reported, and emits `ready`. */
1695
+ declare abstract class SinkElement extends BaseElement {
1696
+ /** Whether to take this upstream source pad. */
1697
+ abstract negotiate(pad: Pad): boolean;
1698
+ /** Called once per item; the pad's next item waits for the returned promise. */
1699
+ abstract receive(pad: Pad, item: PadItem): void | Promise<void>;
1700
+ }
1701
+ /** @public One event timeline record (MSF 8.2): exactly one of `T` (wallclock), `L`, or `M` (media time, ms). */
1702
+ interface TimelineRecord {
1703
+ T?: number;
1704
+ L?: Location;
1705
+ M?: number;
1706
+ data: unknown;
1707
+ }
1708
+ /** @public What the player's `timelineevent` event carries. */
1709
+ interface TimelineEvent {
1710
+ track: CatalogTrack;
1711
+ eventType: string;
1712
+ record: TimelineRecord;
1713
+ }
1714
+ interface CatalogOptions {
1715
+ /** Passed to the media sources: switch with `SWITCH_FROM`. */
1716
+ switchFrom?: boolean;
1717
+ /** The parsed catalog URL, from the player. */
1718
+ source?: MsfSource;
1719
+ }
1720
+ /** @public The catalog element, emitted with the player's `catalog` event. */
1721
+ declare class CatalogElement extends SourceElement implements CatalogReader {
1722
+ #private;
1723
+ readonly url: string;
1724
+ readonly namespace: Tuple;
1725
+ constructor(context: ElementContext, options: CatalogOptions & {
1726
+ source: MsfSource;
1727
+ });
1728
+ /** The last good catalog's tracks, roles inferred. */
1729
+ get tracks(): readonly CatalogTrack[];
1730
+ get publishTracks(): readonly CatalogTrack[];
1731
+ get isComplete(): boolean;
1732
+ /** The last good catalog document, deltas applied and variables substituted. */
1733
+ get json(): CatalogJson | undefined;
1734
+ /** An update was missed or rejected since the last good catalog. */
1735
+ get stale(): boolean;
1736
+ /** From the tracks of the loaded sources. */
1737
+ get streamType(): StreamType;
1738
+ /** Seconds: the longest `trackDuration` of the loaded sources' tracks, `Infinity` while live, `NaN` unknown. */
1739
+ get duration(): number;
1740
+ /** A track by name bytes, in the catalog's namespace unless given (MSF 11.2.2). */
1741
+ find(name: string | Uint8Array, namespace?: Tuple): CatalogTrack | undefined;
1742
+ byRole(role: string): CatalogTrack[];
1743
+ /** Tracks referencing other catalogs (MSF 5.6.16); loading one is up to the user. */
1744
+ references(): CatalogTrack[];
1745
+ /**
1746
+ * The track's `template`, which needs no subscription; else the media timeline track whose
1747
+ * `depends` names the track or its render group (MSF 7.2), loaded once and shared; else
1748
+ * undefined. A media timeline that can't be read is a warning, and undefined from then on,
1749
+ * so seeks don't wait for it again.
1750
+ */
1751
+ timeline(track: CatalogTrack): Promise<TimelineReader | undefined>;
1752
+ /**
1753
+ * Subscribes, waits for the first catalog with tracks or `isComplete`, loads the default
1754
+ * sources, and emits `nomorepads`.
1755
+ * @throws PlayerError `CATALOG_TIMEOUT` without a usable catalog in time, `UNSUPPORTED_SOURCE`
1756
+ * for an invalid first catalog or one with nothing playable.
1757
+ */
1758
+ start(): Promise<void>;
1759
+ destroy(): Promise<void>;
1760
+ }
1761
+ /** @public Options of the `MSE` sink, given through `player.sink(video, options)`. Seconds. */
1762
+ interface MSEOptions {
1763
+ video: HTMLVideoElement;
1764
+ /** Kept behind `currentTime`. Default 90. */
1765
+ backBuffer?: number;
1766
+ /** VOD only: most buffered ahead of `currentTime`, more than 0; appends wait for room. Live keeps everything ahead. Default 60. */
1767
+ forwardCap?: number;
1768
+ /** How far behind the end of the buffer the sink's live jumps land. Default 0.75. */
1769
+ liveEdgeDelay?: number;
1770
+ }
1771
+ /**
1772
+ * Drives an `HTMLVideoElement` through `ManagedMediaSource` or `MediaSource`: one
1773
+ * source buffer per pad, created together once negotiation is over, appends through
1774
+ * one queue per buffer, retention, seeking, gap jumping, and end of stream.
1775
+ */
1776
+ declare class MSESink extends SinkElement implements MediaSinkElement {
1777
+ #private;
1778
+ readonly addEventListener: {
1779
+ (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
1780
+ (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
1781
+ };
1782
+ readonly removeEventListener: {
1783
+ (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
1784
+ (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
1785
+ };
1786
+ readonly dispatchEvent: {
1787
+ (event: Event): boolean;
1788
+ (event: Event): boolean;
1789
+ };
1790
+ constructor(context: ElementContext, options: MSEOptions, Backend: typeof MediaSource, managed: boolean);
1791
+ get currentTime(): number;
1792
+ get buffered(): TimeRanges;
1793
+ get paused(): boolean;
1794
+ get seeking(): boolean;
1795
+ get ended(): boolean;
1796
+ get playbackRate(): number;
1797
+ get liveEdgeStart(): number;
1798
+ setPlaybackRate(rate: number): void;
1799
+ play(): Promise<void>;
1800
+ pause(): Promise<void>;
1801
+ /** Only sets `currentTime`; the element's `seeking` listener does the rest. */
1802
+ seek(mediaTime: number): Promise<void>;
1803
+ /** One pad per role. */
1804
+ negotiate(pad: Pad): boolean;
1805
+ receive(pad: Pad, item: PadItem): Promise<void>;
1806
+ destroy(): Promise<void>;
1807
+ }
1808
+ /**
1809
+ * @public
1810
+ * The player attaches it once a live stream is ready, and detaches it on `destroy()` and when
1811
+ * the stream turns on-demand. Times are in seconds.
1812
+ */
1813
+ interface BufferController {
1814
+ attach(player: MOQtailPlayer, sink: MediaSinkElement): void;
1815
+ detach(): void;
1816
+ /** Seconds kept behind `currentTime`; replaces the sink's own `backBuffer` while attached. */
1817
+ backBuffer?(): number;
1818
+ }
1819
+ /**
1820
+ * @public
1821
+ * Picks renditions for the media sources that don't switch themselves. The player attaches it
1822
+ * once a live stream is ready, and detaches it on `destroy()`, when the stream turns on-demand,
1823
+ * while a media source provides `ABR`, and while a rendition is picked manually.
1824
+ */
1825
+ interface AbrController {
1826
+ attach(player: MOQtailPlayer, sink: MediaSinkElement): void;
1827
+ detach(): void;
1828
+ }
1829
+ /** @public What a plugin offers. */
1830
+ type Feature =
1831
+ /** Loaded by the catalog for a media switching set whose first track it accepts, with `{ child }` (`SwitchingSetOptions`). */
1832
+ {
1833
+ type: 'switch-source';
1834
+ item: SourceElementDefinition;
1835
+ } | {
1836
+ type: 'buffer-controller';
1837
+ item: BufferController;
1838
+ } | {
1839
+ type: 'abr-controller';
1840
+ item: AbrController;
1841
+ } |
1842
+ /** A source, transform, or sink, registered like `registerElement`. */
1843
+ {
1844
+ type: 'element';
1845
+ item: ElementDefinition;
1846
+ };
1847
+ /** @public Every hook is optional: no `init` means ctx is `undefined`, no `setup` or `negotiated` means true. */
1848
+ interface PluginDefinition<Config = void, Ctx = undefined> {
1849
+ readonly name: string;
1850
+ /** Lower wins, like `ElementDefinition.priority`. Default 100. Ties go to the earlier entry in `opts.plugins`. */
1851
+ readonly priority?: number;
1852
+ /** Once per player, in the constructor. The config comes from `opts.plugins`. */
1853
+ init?(config: Config): Ctx;
1854
+ /** Synchronous, in the constructor. Adds setup parameters to its own `clientSetup`; false drops the plugin. */
1855
+ setup?(ctx: Ctx, clientSetup: SetupOptions): boolean;
1856
+ /** After SERVER_SETUP. False means none of its features are used (its parameters were already sent). */
1857
+ negotiated?(ctx: Ctx, serverSetup: Setup): boolean;
1858
+ /** What the plugin offers, once per player after `init`. */
1859
+ features?(ctx: Ctx): Feature[];
1860
+ }
1861
+ /** @public An entry for `opts.plugins`, from calling what `definePlugin` returns. */
1862
+ interface Plugin {
1863
+ readonly definition: PluginDefinition<any, any>;
1864
+ readonly config: unknown;
1865
+ }
1866
+ /**
1867
+ * @public
1868
+ * Checks a plugin definition and returns a factory: calling it with the config gives an entry
1869
+ * for `opts.plugins`. A plugin whose config is all optional can be called with no arguments.
1870
+ */
1871
+ declare function definePlugin<Config = void, Ctx = undefined>(definition: PluginDefinition<Config, Ctx>): (...config: [Config] extends [void] ? [] : {} extends Config ? [config?: Config] : [config: Config]) => Plugin;
1872
+ /**
1873
+ * Copyright 2026 The MOQtail Authors
1874
+ *
1875
+ * Licensed under the Apache License, Version 2.0 (the "License");
1876
+ * you may not use this file except in compliance with the License.
1877
+ * You may obtain a copy of the License at
1878
+ *
1879
+ * http://www.apache.org/licenses/LICENSE-2.0
1880
+ *
1881
+ * Unless required by applicable law or agreed to in writing, software
1882
+ * distributed under the License is distributed on an "AS IS" BASIS,
1883
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1884
+ * See the License for the specific language governing permissions and
1885
+ * limitations under the License.
1886
+ */
1887
+ /** @public The player's lifecycle state. */
1888
+ type PlayerState = 'idle' | 'connecting' | 'ready' | 'playing' | 'paused' | 'stalled' | 'reconnecting' | 'ended' | 'error' | 'destroyed';
1889
+ /** @public */
1890
+ interface MOQtailPlayerOptions {
1891
+ /** Shared by every player on the client, compared for `UNSUPPORTED_ORIGIN`. */
1892
+ client?: {
1893
+ setupOptions?: SetupOptions;
1894
+ transportOptions?: MOQtailClientOptions['transportOptions'];
1895
+ /** Default 5. */
1896
+ reconnectAttempts?: number;
1897
+ };
1898
+ /** Entries made with `definePlugin`. Their setup parameters are shared; their features apply to this player. */
1899
+ plugins?: Plugin[];
1900
+ preferredLanguage?: string;
1901
+ eventTimelines?: string[] | 'all';
1902
+ /** Default 10 000. */
1903
+ catalogTimeoutMs?: number;
1904
+ /** Default 16 MiB. */
1905
+ maxCatalogBytes?: number;
1906
+ /** How media sources order each request's objects. Default: a 150 ms window. */
1907
+ objectOrdering?: ObjectOrdering;
1908
+ }
1909
+ /** @public The media-ui-extensions stream type (proposal 0010). */
1910
+ type StreamType = 'unknown' | 'live' | 'on-demand';
1911
+ /** @public */
1912
+ interface PlayerEvents {
1913
+ statechange: (state: PlayerState, previous: PlayerState) => void;
1914
+ error: (error: PlayerError) => void;
1915
+ warning: (warning: PlayerError) => void;
1916
+ playing: () => void;
1917
+ pause: () => void;
1918
+ stalled: () => void;
1919
+ ended: () => void;
1920
+ /** The catalog element, after the first catalog and every applied update. */
1921
+ catalog: (catalog: CatalogElement) => void;
1922
+ reconnecting: (attempt: number) => void;
1923
+ reconnected: () => void;
1924
+ /** The client this player uses, once connected and again before each `reconnected`. */
1925
+ client: (client: MOQtailClient) => void;
1926
+ /** A record of an opted-in event timeline, on arrival (`opts.eventTimelines`). */
1927
+ timelineevent: (event: TimelineEvent) => void;
1928
+ autoplayblocked: () => void;
1929
+ /** A source switched to another rendition. Not emitted for the one it starts with: read `active` from `getRenditions()`. */
1930
+ renditionchange: (source: MediaSourceElement, rendition: Rendition) => void;
1931
+ /** A source's selected renditions were set (`selectRenditions`). */
1932
+ selectionchange: (source: MediaSourceElement) => void;
1933
+ /** The catalog element's `streamType` changed. */
1934
+ streamtypechange: (type: StreamType) => void;
1935
+ }
1936
+ /** @public */
1937
+ declare class MOQtailPlayer extends Emitter<PlayerEvents> {
1938
+ #private;
1939
+ readonly options: Readonly<MOQtailPlayerOptions>;
1940
+ /**
1941
+ * Runs each plugin's `init` and `setup`.
1942
+ * @throws PlayerError `UNSUPPORTED_ORIGIN` when two plugins set a setup parameter differently.
1943
+ * @throws TypeError for a plugin listed twice, or a config its `init` rejects.
1944
+ */
1945
+ constructor(options?: MOQtailPlayerOptions);
1946
+ get state(): PlayerState;
1947
+ get sources(): readonly SourceElement[];
1948
+ /** Sources that provide `MEDIA_SOURCE`, except those loaded by another media source. */
1949
+ get mediaSources(): readonly (SourceElement & MediaSourceElement)[];
1950
+ /** The first sink in chain order that provides `MEDIA_SINK`. */
1951
+ get mediaSink(): (SinkElement & MediaSinkElement) | undefined;
1952
+ /** The shared client while this player holds it; a reconnect replaces it (see the `client` event). */
1953
+ get client(): MOQtailClient | undefined;
1954
+ /** The active plugins' buffer controller while it's attached. */
1955
+ get bufferController(): BufferController | undefined;
1956
+ /** The active plugins' ABR controller while it's attached. */
1957
+ get abrController(): AbrController | undefined;
1958
+ /**
1959
+ * Whether `source` switches renditions automatically: it provides `ABR`, or an ABR controller can
1960
+ * drive it, since the stream is live and no media source provides `ABR`. A rendition picked
1961
+ * manually detaches the controller but leaves this true, so selecting every rendition again resumes it.
1962
+ */
1963
+ isAbrAvailable(source: SourceElement): boolean;
1964
+ /** Registers an element on this player only. Call it before `source()`. */
1965
+ registerElement(definition: ElementDefinition): this;
1966
+ /**
1967
+ * Adds a top-level source for a moqt URI. `init()` picks its element, once the peer's SETUP
1968
+ * decided which plugins are active, and gives it `{ ...options, source }`.
1969
+ * @throws PlayerError `UNSUPPORTED_SOURCE` for a URI that can't be used here, `UNSUPPORTED_ORIGIN`
1970
+ * for another origin or client setup; the player stays `idle`.
1971
+ */
1972
+ source(uri: string, options?: {
1973
+ switchFrom?: boolean;
1974
+ [key: string]: unknown;
1975
+ }): this;
1976
+ transform(element: TransformElement): this;
1977
+ /** A video element gets the `MSE` sink with `options`. */
1978
+ sink(video: HTMLVideoElement, options?: Omit<MSEOptions, 'video'>): this;
1979
+ sink(definition: SinkElementDefinition, options?: Record<string, unknown>): this;
1980
+ /** Connects and negotiates the chain; rejects with `UNSUPPORTED_SOURCE` when no element accepts a source. Idempotent. */
1981
+ init(): Promise<void>;
1982
+ /** `init()`, then `play()`. Idempotent. */
1983
+ start(): Promise<void>;
1984
+ /** A `NotAllowedError` moves the player to `paused` and emits `autoplayblocked`. */
1985
+ play(): Promise<void>;
1986
+ pause(): Promise<void>;
1987
+ /** Seconds. Resolves or rejects as the media sink's `seek()` does. */
1988
+ seek(mediaTime: number): Promise<void>;
1989
+ setPlaybackRate(rate: number): void;
1990
+ /** Aborts in-flight work, destroys sinks then sources, and releases the client last. Callable in any state. */
1991
+ destroy(): Promise<void>;
1992
+ }
1993
+ /**
1994
+ * @public
1995
+ * Plays CMAF video and audio pads on an `HTMLVideoElement`, through `ManagedMediaSource`
1996
+ * where it exists and `MediaSource` otherwise. `player.sink(video)` adds it with `{ video }`.
1997
+ */
1998
+ declare const MSE: SinkElementDefinition<MSESink, readonly [typeof MEDIA_SINK]>;
1999
+ /**
2000
+ * Copyright 2026 The MOQtail Authors
2001
+ *
2002
+ * Licensed under the Apache License, Version 2.0 (the "License");
2003
+ * you may not use this file except in compliance with the License.
2004
+ * You may obtain a copy of the License at
2005
+ *
2006
+ * http://www.apache.org/licenses/LICENSE-2.0
2007
+ *
2008
+ * Unless required by applicable law or agreed to in writing, software
2009
+ * distributed under the License is distributed on an "AS IS" BASIS,
2010
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2011
+ * See the License for the specific language governing permissions and
2012
+ * limitations under the License.
2013
+ */
2014
+ /** @public */
2015
+ interface LiveBufferConfig {
2016
+ /** The playback rate when behind the target latency; `2 - catchupRate` when ahead. Between 1 and 2, default 1.1. */
2017
+ catchupRate?: number;
2018
+ /**
2019
+ * Seconds of latency to hold when the catalog sets no `targetLatency` or `buffers`. Measured like the
2020
+ * catalog's: wallclock latency when the timeline has it, else the forward buffer. Above 0, default 1.
2021
+ */
2022
+ targetLatency?: number;
2023
+ }
2024
+ /**
2025
+ * @public
2026
+ * A buffer controller that holds the catalog's target latency, else `targetLatency` (1 s), through the playback rate,
2027
+ * or on WebKit through jumps, where every rate change stalls playback.
2028
+ * Priority `Infinity`, so any other active buffer plugin wins over it.
2029
+ */
2030
+ declare const liveBuffer: (config?: LiveBufferConfig | undefined) => Plugin;
2031
+ /** @public The `abr()` controller. For now it keeps the current quality: it never switches. */
2032
+ declare class DefaultAbrController implements AbrController {
2033
+ attach(_player: MOQtailPlayer, _sink: MediaSinkElement): void;
2034
+ detach(): void;
2035
+ }
2036
+ /**
2037
+ * @public
2038
+ * An ABR controller for media sources that don't switch themselves. Priority `Infinity`, so any
2039
+ * other active ABR plugin wins over it.
2040
+ */
2041
+ declare const abr: () => Plugin;
2042
+ /** @public The switching set source of the `ssts()` plugin. */
2043
+ declare class SstsSource extends SourceElement implements MediaSourceElement {
2044
+ #private;
2045
+ readonly options: SwitchingSetOptions;
2046
+ readonly pad: Pad;
2047
+ /** The negotiated algorithms (`sstsAlgorithms`), most preferred first, read at init. */
2048
+ readonly algorithms: readonly bigint[];
2049
+ /** `preferred` is the plugin's list, most preferred first; the source starts on the first negotiated one. */
2050
+ constructor(context: ElementContext, options: SwitchingSetOptions, preferred: readonly bigint[]);
2051
+ get algorithm(): bigint;
2052
+ /**
2053
+ * @internal Loads a child per track, in parallel: the publisher activates once all are assigned
2054
+ * (SSTS 6.3). The set plays on the children that loaded; it fails only when none did.
2055
+ */
2056
+ start(): Promise<void>;
2057
+ /** The chain only offers pads of elements this one loaded: take them all. */
2058
+ negotiate(): boolean;
2059
+ receive(pad: Pad, item: PadItem): Promise<void>;
2060
+ getRenditions(): Rendition[];
2061
+ /** Pins the relay to one track: the same as selecting only it. */
2062
+ switch(renditionId: string): Promise<void>;
2063
+ /**
2064
+ * Changes the switching set (SSTS 6.2): a deselected track is unsubscribed, a selected one
2065
+ * subscribed again. A single selection keeps every track in the set and pins it by threshold.
2066
+ */
2067
+ selectRenditions(renditionIds: string[]): Promise<void>;
2068
+ /** New tracks get a child, selected unless a track is pinned; removed ones are released. */
2069
+ setTracks(tracks: readonly CatalogTrack[]): void;
2070
+ /** Pauses automatic switching: `activate` 0 on the set (SSTS 6.2). */
2071
+ pauseSwitching(): Promise<void>;
2072
+ /** Resumes automatic switching: `activate` back to the set size. */
2073
+ resumeSwitching(): Promise<void>;
2074
+ /**
2075
+ * Moves the whole set to another negotiated algorithm with a REQUEST_UPDATE per subscription;
2076
+ * a rejected update rolls the others back, so the set never carries two algorithms.
2077
+ * With concurrent calls the latest wins and earlier ones reject with `ABORTED`.
2078
+ */
2079
+ setAlgorithm(id: bigint): Promise<void>;
2080
+ }
2081
+ /** @public The algorithms `ssts()` offers by default: 0 (the draft's default) and demo-abr's 0xff01. */
2082
+ declare const SSTS_ALGORITHMS: readonly bigint[];
2083
+ /** @public */
2084
+ interface SstsConfig {
2085
+ /** Offered at setup, most preferred first; the source starts on the first negotiated one. Default `SSTS_ALGORITHMS`. */
2086
+ algorithms?: readonly bigint[];
2087
+ }
2088
+ /** @public The SSTS plugin, for `opts.plugins`. */
2089
+ declare const ssts: (config?: SstsConfig | undefined) => Plugin;
2090
+ export { ABR as $, CONNECTION_CAPACITY as A, Capabilities as B, TimelineEvent as C, formatMsfUrl as Ct, SinkElement as D, ElementEvents as E, PadProperties as F, ElementDefinition as G, CapabilityBundles as H, PadSignal as I, SinkElementDefinition as J, Identifiers as K, ElementContext as L, PadEvent as M, PadItem as N, SourceElement as O, PadOutput as P, hasInterface as Q, ElementLoadRequest as R, CatalogElement as S, TimeRange as St, BaseElement as T, CapabilityCode as U, Capability as V, DEFAULT_PRIORITY as W, TransformElementDefinition as X, SourceElementDefinition as Y, defineElement as Z, Feature as _, PlayerError as _t, abr as a, MediaSinkElement as at, definePlugin as b, LocationRange as bt, liveBuffer as c, Rendition as ct, MOQtailPlayerOptions as d, TimelineReader as dt, CatalogReader as et, PlayerEvents as f, Catalog as ft, BufferController as g, InitData as gt, AbrController as h, MediaTimelineTemplate as ht, SstsSource as i, MEDIA_SOURCE as it, Pad as j, TransformElement as k, MSE as l, RequestHooks as lt, PlayerState as m, CatalogTrack as mt, ssts as n, InterfaceKey as nt, DefaultAbrController as o, MediaSourceElement as ot, StreamType as p, CatalogJson as pt, Provided as q, SSTS_ALGORITHMS as r, MEDIA_SINK as rt, LiveBufferConfig as s, MediaSourceOptions as st, SstsConfig as t, ElementInterfaces as tt, MOQtailPlayer as u, SwitchingSetOptions as ut, Plugin as v, PlayerErrorCategory as vt, TimelineRecord as w, parseMsfUrl as wt, MSEOptions as x, MsfSource as xt, PluginDefinition as y, PlayerErrorCode as yt, PlayerHandle as z };