@norskvideo/moq-watch 0.1.8 → 0.2.1

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 (76) hide show
  1. package/README.md +43 -31
  2. package/audio/config.d.ts +19 -0
  3. package/audio/config.d.ts.map +1 -0
  4. package/audio/decoder.d.ts +9 -2
  5. package/audio/decoder.d.ts.map +1 -1
  6. package/audio/emitter.d.ts +6 -1
  7. package/audio/emitter.d.ts.map +1 -1
  8. package/audio/latency.d.ts +11 -0
  9. package/audio/latency.d.ts.map +1 -0
  10. package/audio/ring-buffer.d.ts.map +1 -1
  11. package/audio/shared-ring-buffer.d.ts +8 -1
  12. package/audio/shared-ring-buffer.d.ts.map +1 -1
  13. package/audio/source.d.ts.map +1 -1
  14. package/audio/terminal.d.ts +1 -0
  15. package/audio/terminal.d.ts.map +1 -1
  16. package/broadcast.d.ts +19 -5
  17. package/broadcast.d.ts.map +1 -1
  18. package/duration.d.ts +2 -0
  19. package/duration.d.ts.map +1 -0
  20. package/element.d.ts +57 -26
  21. package/element.d.ts.map +1 -1
  22. package/element.js +171 -174
  23. package/element.js.map +1 -1
  24. package/index.d.ts +4 -2
  25. package/index.d.ts.map +1 -1
  26. package/index.js +25 -17
  27. package/index.js.map +1 -1
  28. package/media.d.ts +2 -0
  29. package/media.d.ts.map +1 -0
  30. package/msf.d.ts.map +1 -1
  31. package/package.json +12 -7
  32. package/player-BFRzc5zw.js +2172 -0
  33. package/player-BFRzc5zw.js.map +1 -0
  34. package/player.d.ts +78 -0
  35. package/player.d.ts.map +1 -0
  36. package/sync.d.ts +27 -41
  37. package/sync.d.ts.map +1 -1
  38. package/text/index.d.ts +9 -0
  39. package/text/index.d.ts.map +1 -0
  40. package/text/renderer.d.ts +31 -0
  41. package/text/renderer.d.ts.map +1 -0
  42. package/text/source.d.ts +30 -0
  43. package/text/source.d.ts.map +1 -0
  44. package/ui/components/captions-button.d.ts +11 -0
  45. package/ui/components/captions-button.d.ts.map +1 -0
  46. package/ui/components/captions.d.ts +5 -0
  47. package/ui/components/captions.d.ts.map +1 -0
  48. package/ui/components/control-bar.d.ts.map +1 -1
  49. package/ui/components/hidden-indicator.d.ts +5 -0
  50. package/ui/components/hidden-indicator.d.ts.map +1 -0
  51. package/ui/components/latency.d.ts +1 -1
  52. package/ui/components/latency.d.ts.map +1 -1
  53. package/ui/components/settings-panel.d.ts.map +1 -1
  54. package/ui/element.d.ts.map +1 -1
  55. package/ui/element.js +257 -193
  56. package/ui/element.js.map +1 -1
  57. package/ui/icons.d.ts +2 -1
  58. package/ui/icons.d.ts.map +1 -1
  59. package/ui/state.d.ts +1 -1
  60. package/ui/state.d.ts.map +1 -1
  61. package/video/decoder.d.ts +10 -11
  62. package/video/decoder.d.ts.map +1 -1
  63. package/video/playhead.d.ts +14 -4
  64. package/video/playhead.d.ts.map +1 -1
  65. package/video/renderer.d.ts +6 -1
  66. package/video/renderer.d.ts.map +1 -1
  67. package/video/source.d.ts +1 -1
  68. package/video/source.d.ts.map +1 -1
  69. package/audio/subscription.d.ts +0 -10
  70. package/audio/subscription.d.ts.map +0 -1
  71. package/audio/unlock.d.ts +0 -20
  72. package/audio/unlock.d.ts.map +0 -1
  73. package/source-BeABanvB.js +0 -1723
  74. package/source-BeABanvB.js.map +0 -1
  75. package/sync-DNQkgnlX.js +0 -132
  76. package/sync-DNQkgnlX.js.map +0 -1
package/player.d.ts ADDED
@@ -0,0 +1,78 @@
1
+ import type * as Catalog from "@norskvideo/moq-hang/catalog";
2
+ import type * as Moq from "@norskvideo/moq-net";
3
+ import { Time } from "@norskvideo/moq-net";
4
+ import { type Getter, type Inputs, type Readonlys } from "@norskvideo/moq-signals";
5
+ import * as Audio from "./audio";
6
+ import { Broadcast, type CatalogFormat } from "./broadcast";
7
+ import { type Delay, Sync } from "./sync";
8
+ import * as Text from "./text";
9
+ import * as Video from "./video";
10
+ /** Inputs for a complete broadcast playback pipeline. */
11
+ export type PlayerInput = {
12
+ /** Origin that supplies the broadcast. */
13
+ origin: Getter<Moq.Origin.Table | undefined>;
14
+ /** Broadcast path relative to the origin. */
15
+ name: Getter<Moq.Path.Valid>;
16
+ /** Whether the pipeline may subscribe. */
17
+ enabled: Getter<boolean>;
18
+ /** Wait for a broadcast announcement before subscribing. */
19
+ announced: Getter<boolean>;
20
+ /** Catalog format override, or automatic detection when absent. */
21
+ catalogFormat: Getter<CatalogFormat | undefined>;
22
+ /** Catalog supplied when the format is `manual`. */
23
+ catalog: Getter<Catalog.Root | undefined>;
24
+ /** Connection probe used for rendition selection and delay. */
25
+ probe: Getter<Moq.Connection.Probe | undefined>;
26
+ /** Canvas to paint video into. */
27
+ canvas: Getter<HTMLCanvasElement | undefined>;
28
+ /** Container to render captions into. */
29
+ container: Getter<HTMLElement | undefined>;
30
+ /** Pause media and captions. */
31
+ paused: Getter<boolean>;
32
+ /** Speaker volume from zero to one. */
33
+ volume: Getter<number>;
34
+ /** Silence audio and stop its download. */
35
+ muted: Getter<boolean>;
36
+ /** Canvas visibility policy for video downloads. */
37
+ visible: Getter<Video.Visible>;
38
+ /** Playback distance from the live edge. */
39
+ delay: Getter<Delay>;
40
+ /** Future-dated media held beyond the live edge. */
41
+ buffer: Getter<Time.Milli>;
42
+ /** Desired video rendition or quality limits. */
43
+ target: Getter<Video.Target | undefined>;
44
+ /** Desired audio rendition by track name (a language, say); unset takes the first playable. */
45
+ audioTarget: Getter<Audio.Target | undefined>;
46
+ /** Selected caption track, or undefined for off. */
47
+ captions: Getter<string | undefined>;
48
+ };
49
+ /** Constructor options for {@link Player}; omitted controls use the element defaults. */
50
+ export type PlayerProps = Inputs<PlayerInput>;
51
+ /** Owns the broadcast, synchronized media pipelines, and their download policy. */
52
+ export declare class Player {
53
+ #private;
54
+ /** Inputs wired into the pipeline. Pass signals to change them after construction. */
55
+ readonly in: Readonlys<PlayerInput>;
56
+ /** Broadcast subscription and effective catalog. */
57
+ readonly broadcast: Broadcast;
58
+ /** Shared audio, video, and caption clock. */
59
+ readonly sync: Sync;
60
+ /** Selected caption rendition. */
61
+ readonly text: Text.Source;
62
+ /** Video decoder; `video.source` selects its rendition. */
63
+ readonly video: Video.Decoder;
64
+ /** Audio decoder; `audio.source` selects its rendition. */
65
+ readonly audio: Audio.Decoder;
66
+ /** Canvas video output. */
67
+ readonly renderer: Video.Renderer;
68
+ /** Speaker audio output. */
69
+ readonly emitter: Audio.Emitter;
70
+ /** Caption overlay output. */
71
+ readonly textRenderer: Text.Renderer;
72
+ constructor(props?: PlayerProps);
73
+ /** Re-anchor buffered playback at a content boundary. */
74
+ reset(): void;
75
+ /** Release all subscriptions and media resources. */
76
+ close(): void;
77
+ }
78
+ //# sourceMappingURL=player.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"player.d.ts","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AACrC,OAAO,EAAQ,IAAI,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAU,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,KAAK,SAAS,EAAqB,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,KAAK,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG;IACzB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IAC7C,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,IAA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C,CAAC;AAEF,yFAAyF;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAE9C,mFAAmF;AACnF,qBAAa,MAAM;;IAClB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACpC,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;IAC9B,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IAClC,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC;IAOrC,YAAY,KAAK,GAAE,WAAgB,EA+FlC;IAED,yDAAyD;IACzD,KAAK,IAAI,IAAI,CAGZ;IAED,qDAAqD;IACrD,KAAK,IAAI,IAAI,CAEZ;CACD"}
package/sync.d.ts CHANGED
@@ -1,65 +1,51 @@
1
1
  import type * as Moq from "@norskvideo/moq-net";
2
2
  import { Time } from "@norskvideo/moq-net";
3
- import { type Getter, type Inputs, type Readonlys, Signal } from "@norskvideo/moq-signals";
4
- /** A single latency bound: `"real-time"` adapts to the RTT; a `Time.Milli` fixes the jitter buffer. */
5
- export type Bound = "real-time" | Time.Milli;
3
+ import { type Dispose, type Getter, type Inputs, type Readonlys, Signal } from "@norskvideo/moq-signals";
6
4
  /**
7
- * Latency target. A scalar (or `"real-time"`) collapses the range and minimizes latency, the live
8
- * default. An object opens a range `[min, max]`: playback buffers freely between the floor and the
9
- * ceiling and only skips ahead once latency would exceed the ceiling, so faster-than-real-time
10
- * frames (e.g. a TTS response with future timestamps) build up instead of being skipped. Both
11
- * bounds default to `"real-time"` when omitted. The ceiling is always finite (no uncapped buffering),
12
- * so worst case the audio ring drops its oldest samples rather than exhausting memory.
5
+ * How far playback trails the live edge.
13
6
  *
14
- * `"instant"` drops the clock instead of bounding it: video paints the moment it decodes and
15
- * audio is disabled. It replaces the range rather than sitting inside it, so it is not a
16
- * {@link Bound} and cannot be used as a floor or ceiling. Not pacing video and disabling audio is
17
- * the owner's job, so a {@link Sync} handed this value resolves it to a zero buffer and no more.
18
- */
19
- export type Latency = "instant" | Paced;
20
- /** A latency target the playback clock can pace off on its own: every {@link Latency} but `"instant"`. */
21
- export type Paced = Bound | {
22
- min?: Bound;
23
- max?: Bound;
24
- };
25
- /**
26
- * Resolve a {@link Latency} into explicit floor/ceiling bounds (a scalar collapses to `min == max`).
27
- * `"instant"` holds nothing, so both bounds are zero.
7
+ * `"auto"` (the default) sizes the jitter buffer from the connection RTT; a `Time.Milli` fixes it.
8
+ *
9
+ * `"instant"` drops the buffer and the pacing together: nothing is held, and {@link Sync.wait}
10
+ * returns without sleeping, so a frame presents as soon as it exists. It also overrides
11
+ * {@link SyncInput.buffer}, since holding a lookahead would contradict holding nothing. Audio is
12
+ * the owner's business: a ring with no depth underruns, so whoever wants this mode is expected to
13
+ * turn audio off.
28
14
  */
29
- export declare function latencyBounds(latency: Latency): {
30
- min: Bound;
31
- max: Bound;
32
- };
33
- /** Build a {@link Paced} latency from explicit bounds, collapsing to a scalar when they're equal. */
34
- export declare function latencyFromBounds(min: Bound, max: Bound): Paced;
15
+ export type Delay = "instant" | "auto" | Time.Milli;
35
16
  export type SyncInput = {
17
+ /** How far playback trails the live edge. See {@link Delay}. */
18
+ delay: Getter<Delay>;
36
19
  /**
37
- * Latency target: a scalar minimizes (collapsed range), an object opens a range. See {@link Paced}.
20
+ * Future-dated media held beyond the live edge before playback skips ahead (default: zero).
38
21
  *
39
- * A clock cannot implement `"instant"` on its own, since not pacing video and disabling audio
40
- * are the owner's job. Pass a {@link Paced} value: `"instant"` resolves to a zero buffer here.
22
+ * Zero minimizes latency, the live default: playback re-anchors as soon as anything arrives
23
+ * early. A larger value lets faster-than-real-time frames (a TTS response with future
24
+ * timestamps) build up instead of being skipped. Always finite, so worst case the audio ring
25
+ * drops its oldest samples rather than exhausting memory.
26
+ */
27
+ buffer: Getter<Time.Milli>;
28
+ /**
29
+ * The connection's PROBE estimates, whose RTT drives "auto" jitter. Usually wired
30
+ * from a `Connection`'s `probe`.
41
31
  */
42
- latency: Getter<Latency>;
43
- /** The connection used for "real-time" jitter: PROBE supplies RTT. */
44
- connection: Getter<Moq.Connection.Established | undefined>;
45
- /** Any additional delay required for audio (wired from the per-rendition source). */
46
- audio: Getter<Time.Milli | undefined>;
47
- /** Any additional delay required for video (wired from the per-rendition source). */
48
- video: Getter<Time.Milli | undefined>;
32
+ probe: Getter<Moq.Connection.Probe | undefined>;
49
33
  };
50
34
  type SyncOutput = {
51
35
  reference: Signal<Time.Milli | undefined>;
52
- buffer: Signal<Time.Milli>;
36
+ delay: Signal<Time.Milli>;
53
37
  jitter: Signal<Time.Milli>;
54
38
  timestamp: Signal<Time.Milli | undefined>;
55
39
  buffered: Signal<boolean>;
56
- maxBuffer: Signal<Time.Milli>;
40
+ maxAge: Signal<Time.Milli>;
57
41
  };
58
42
  export declare class Sync {
59
43
  #private;
60
44
  readonly in: Readonlys<SyncInput>;
61
45
  readonly out: Readonlys<SyncOutput>;
62
46
  constructor(props?: Inputs<SyncInput>);
47
+ /** Include a decoder's rendition delay in the shared playback clock until disposed. */
48
+ register(jitter: Getter<Time.Milli | undefined>): Dispose;
63
49
  received(timestamp: Time.Milli, label?: string): void;
64
50
  reset(): void;
65
51
  now(): Time.Milli | undefined;
package/sync.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":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A8BD,KAAK,SAEJ;CACD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Caption / subtitle playback: select a text rendition from the catalog and render its cues into an
3
+ * overlay element, synced to the shared media clock.
4
+ *
5
+ * @module
6
+ */
7
+ export * from "./renderer";
8
+ export * from "./source";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type Getter, type Inputs, type Readonlys } from "@norskvideo/moq-signals";
2
+ import type { Sync } from "../sync";
3
+ import type { Source } from "./source";
4
+ export type RendererInput = {
5
+ container: Getter<HTMLElement | undefined>;
6
+ enabled: Getter<boolean>;
7
+ };
8
+ /** Constructor properties for {@link Renderer}. */
9
+ export type RendererProps = Inputs<RendererInput> & {
10
+ /** Caption rendition selector. */
11
+ source: Source;
12
+ /** Shared playback clock. */
13
+ sync: Sync;
14
+ };
15
+ /**
16
+ * Subscribes to the selected caption track, parses each cue, and renders it into an overlay element
17
+ * via [media-captions](https://github.com/vidstack/captions).
18
+ *
19
+ * There is no WebCodecs decoder for text, so this parses cue payloads directly. Cues are scheduled
20
+ * against the shared {@link Sync} clock (not wall time) so they line up with the audio/video frames.
21
+ * A caption-only broadcast (no audio/video to anchor the clock) shows nothing until media arrives.
22
+ */
23
+ export declare class Renderer {
24
+ #private;
25
+ readonly source: Source;
26
+ readonly sync: Sync;
27
+ readonly in: Readonlys<RendererInput>;
28
+ constructor(props: RendererProps);
29
+ close(): void;
30
+ }
31
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/text/renderer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAOxF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAmJvC,MAAM,MAAM,aAAa,GAAG;IAG3B,SAAS,EAAE,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAG3C,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACzB,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG;IACnD,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,IAAI,EAAE,IAAI,CAAC;CACX,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,QAAQ;;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IAQtC,YAAY,KAAK,EAAE,aAAa,EAS/B;IA+JD,KAAK,IAAI,IAAI,CAEZ;CACD"}
@@ -0,0 +1,30 @@
1
+ import type * as Catalog from "@norskvideo/moq-hang/catalog";
2
+ import { type Getter, type Inputs, type Readonlys, Signal } from "@norskvideo/moq-signals";
3
+ import type { Broadcast } from "../broadcast";
4
+ /** Whether the renderer can display a text rendition's cue format. */
5
+ export declare function renderable(config: Catalog.TextConfig): boolean;
6
+ export type SourceInput = {
7
+ broadcast: Getter<Broadcast | undefined>;
8
+ target: Getter<string | undefined>;
9
+ };
10
+ type SourceOutput = {
11
+ catalog: Signal<Catalog.Text | undefined>;
12
+ available: Signal<Record<string, Catalog.TextConfig>>;
13
+ track: Signal<string | undefined>;
14
+ config: Signal<Catalog.TextConfig | undefined>;
15
+ };
16
+ /**
17
+ * Selects a caption rendition from the catalog `text` section.
18
+ *
19
+ * Unlike audio/video there is no support probe and no automatic selection: captions are opt-in, so
20
+ * nothing is chosen until `target` names a track. The {@link Renderer} consumes whatever it picks.
21
+ */
22
+ export declare class Source {
23
+ #private;
24
+ readonly in: Readonlys<SourceInput>;
25
+ readonly out: Readonlys<SourceOutput>;
26
+ constructor(props?: Inputs<SourceInput>);
27
+ close(): void;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/text/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAU,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,KAAK,SAAS,EAAa,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAM9C,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,GAAG,OAAO,CAE9D;AAED,MAAM,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAGzC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF,KAAK,YAAY,GAAG;IAEnB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IAG1C,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAGtD,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,MAAM;;IAClB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAQpC,QAAQ,CAAC,GAAG,0BAAwB;IAIpC,YAAY,KAAK,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,EAQtC;IA6BD,KAAK,IAAI,IAAI,CAEZ;CACD"}
@@ -0,0 +1,11 @@
1
+ import type { Effect } from "@norskvideo/moq-signals";
2
+ import type MoqWatch from "../../element";
3
+ /**
4
+ * CC button toggling captions on and off.
5
+ *
6
+ * Hidden entirely when the broadcast publishes no text renditions, so a caption-less stream gets no
7
+ * dead control. Toggling on selects the first rendition; the Captions tab in the settings panel is
8
+ * where a viewer picks between several.
9
+ */
10
+ export declare function captionsButton(parent: Effect, watch: MoqWatch): HTMLElement;
11
+ //# sourceMappingURL=captions-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captions-button.d.ts","sourceRoot":"","sources":["../../../src/ui/components/captions-button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAI1C;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW,CAwB3E"}
@@ -0,0 +1,5 @@
1
+ import type { Effect } from "@norskvideo/moq-signals";
2
+ import type MoqWatch from "../../element";
3
+ /** The Captions tab: turn captions off or pick a text rendition (usually one per language). */
4
+ export declare function captionsTab(parent: Effect, watch: MoqWatch): HTMLElement;
5
+ //# sourceMappingURL=captions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captions.d.ts","sourceRoot":"","sources":["../../../src/ui/components/captions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAwC1C,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW,CAgCxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"control-bar.d.ts","sourceRoot":"","sources":["../../../src/ui/components/control-bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAOxC,0FAA0F;AAC1F,wBAAgB,UAAU,CACzB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,WAAW,EACnB,IAAI,UAAQ,GACV,WAAW,CAgBb"}
1
+ {"version":3,"file":"control-bar.d.ts","sourceRoot":"","sources":["../../../src/ui/components/control-bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAQxC,0FAA0F;AAC1F,wBAAgB,UAAU,CACzB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,WAAW,EACnB,IAAI,UAAQ,GACV,WAAW,CAgBb"}
@@ -0,0 +1,5 @@
1
+ import { type Effect } from "@norskvideo/moq-signals";
2
+ import type MoqWatch from "../../element";
3
+ /** Explains why video isn't downloading when the `visible` gate holds it back. */
4
+ export declare function hiddenIndicator(parent: Effect, watch: MoqWatch): HTMLElement;
5
+ //# sourceMappingURL=hidden-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hidden-indicator.d.ts","sourceRoot":"","sources":["../../../src/ui/components/hidden-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW,CAkC5E"}
@@ -1,5 +1,5 @@
1
1
  import type { Effect } from "@norskvideo/moq-signals";
2
2
  import type MoqWatch from "../../element";
3
- /** The Latency tab: choose a buffer target and watch the live buffer timeline. */
3
+ /** The Latency tab: choose a playback delay and watch the live buffer timeline. */
4
4
  export declare function latencyTab(parent: Effect, watch: MoqWatch): HTMLElement;
5
5
  //# sourceMappingURL=latency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"latency.d.ts","sourceRoot":"","sources":["../../../src/ui/components/latency.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAgB1C,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW,CAmDvE"}
1
+ {"version":3,"file":"latency.d.ts","sourceRoot":"","sources":["../../../src/ui/components/latency.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAe1C,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW,CAmDvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"settings-panel.d.ts","sourceRoot":"","sources":["../../../src/ui/components/settings-panel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAO,OAAO,EAAE,MAAM,UAAU,CAAC;AAW7C,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,CAmE1F"}
1
+ {"version":3,"file":"settings-panel.d.ts","sourceRoot":"","sources":["../../../src/ui/components/settings-panel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAU1C,OAAO,KAAK,EAAO,OAAO,EAAE,MAAM,UAAU,CAAC;AAa7C,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,CAqE1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/ui/element.ts"],"names":[],"mappings":"AAoCA,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;;IAMlD,cASC;IAED,iBAAiB,SAOhB;IAED,oBAAoB,SAInB;CA6KD;AAID,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,UAAU,CAAC;KAC3B;CACD"}
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/ui/element.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;;IAMlD,cASC;IAED,iBAAiB,SAOhB;IAED,oBAAoB,SAInB;CA8KD;AAID,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,UAAU,CAAC;KAC3B;CACD"}