@norskvideo/moq-watch 0.1.8 → 0.2.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.
- package/README.md +43 -31
- package/audio/config.d.ts +19 -0
- package/audio/config.d.ts.map +1 -0
- package/audio/decoder.d.ts +9 -2
- package/audio/decoder.d.ts.map +1 -1
- package/audio/emitter.d.ts +6 -1
- package/audio/emitter.d.ts.map +1 -1
- package/audio/latency.d.ts +11 -0
- package/audio/latency.d.ts.map +1 -0
- package/audio/ring-buffer.d.ts.map +1 -1
- package/audio/shared-ring-buffer.d.ts +8 -1
- package/audio/shared-ring-buffer.d.ts.map +1 -1
- package/audio/source.d.ts.map +1 -1
- package/audio/terminal.d.ts +1 -0
- package/audio/terminal.d.ts.map +1 -1
- package/broadcast.d.ts +19 -5
- package/broadcast.d.ts.map +1 -1
- package/duration.d.ts +2 -0
- package/duration.d.ts.map +1 -0
- package/element.d.ts +50 -26
- package/element.d.ts.map +1 -1
- package/element.js +142 -160
- package/element.js.map +1 -1
- package/index.d.ts +4 -2
- package/index.d.ts.map +1 -1
- package/index.js +25 -17
- package/index.js.map +1 -1
- package/media.d.ts +2 -0
- package/media.d.ts.map +1 -0
- package/msf.d.ts.map +1 -1
- package/package.json +12 -7
- package/player-C19uf7Dc.js +2172 -0
- package/player-C19uf7Dc.js.map +1 -0
- package/player.d.ts +78 -0
- package/player.d.ts.map +1 -0
- package/sync.d.ts +27 -41
- package/sync.d.ts.map +1 -1
- package/text/index.d.ts +9 -0
- package/text/index.d.ts.map +1 -0
- package/text/renderer.d.ts +31 -0
- package/text/renderer.d.ts.map +1 -0
- package/text/source.d.ts +30 -0
- package/text/source.d.ts.map +1 -0
- package/ui/components/captions-button.d.ts +11 -0
- package/ui/components/captions-button.d.ts.map +1 -0
- package/ui/components/captions.d.ts +5 -0
- package/ui/components/captions.d.ts.map +1 -0
- package/ui/components/control-bar.d.ts.map +1 -1
- package/ui/components/hidden-indicator.d.ts +5 -0
- package/ui/components/hidden-indicator.d.ts.map +1 -0
- package/ui/components/latency.d.ts +1 -1
- package/ui/components/latency.d.ts.map +1 -1
- package/ui/components/settings-panel.d.ts.map +1 -1
- package/ui/element.d.ts.map +1 -1
- package/ui/element.js +257 -193
- package/ui/element.js.map +1 -1
- package/ui/icons.d.ts +2 -1
- package/ui/icons.d.ts.map +1 -1
- package/ui/state.d.ts +1 -1
- package/ui/state.d.ts.map +1 -1
- package/video/decoder.d.ts +10 -11
- package/video/decoder.d.ts.map +1 -1
- package/video/playhead.d.ts +14 -4
- package/video/playhead.d.ts.map +1 -1
- package/video/renderer.d.ts +6 -1
- package/video/renderer.d.ts.map +1 -1
- package/video/source.d.ts +1 -1
- package/video/source.d.ts.map +1 -1
- package/audio/subscription.d.ts +0 -10
- package/audio/subscription.d.ts.map +0 -1
- package/audio/unlock.d.ts +0 -20
- package/audio/unlock.d.ts.map +0 -1
- package/source-BeABanvB.js +0 -1723
- package/source-BeABanvB.js.map +0 -1
- package/sync-DNQkgnlX.js +0 -132
- package/sync-DNQkgnlX.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/@moq/watch)
|
|
8
8
|
[](https://www.typescriptlang.org/)
|
|
9
9
|
|
|
10
|
-
Subscribe to and render [Media over QUIC](https://moq.dev/) (MoQ) broadcasts, built on top of [@moq/hang](../hang) and [@moq/net](../
|
|
10
|
+
Subscribe to and render [Media over QUIC](https://moq.dev/) (MoQ) broadcasts, built on top of [@moq/hang](../hang) and [@moq/net](../net).
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -38,7 +38,7 @@ import map required:
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Pin a version range in the URL for production, e.g.
|
|
41
|
-
`https://esm.sh/@moq/watch@0.
|
|
41
|
+
`https://esm.sh/@moq/watch@0.6/element`. jsDelivr's `+esm` endpoint
|
|
42
42
|
(`https://cdn.jsdelivr.net/npm/@moq/watch/element.js/+esm`) works the same way
|
|
43
43
|
if you prefer it.
|
|
44
44
|
|
|
@@ -54,25 +54,26 @@ The simplest way to watch a stream:
|
|
|
54
54
|
import "@moq/watch/element";
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
|
-
<moq-watch
|
|
58
|
-
url="https://relay.example.com/anon"
|
|
59
|
-
name="room/alice.hang"
|
|
60
|
-
controls>
|
|
57
|
+
<moq-watch url="https://relay.example.com/anon" name="room/alice.hang">
|
|
61
58
|
<canvas></canvas>
|
|
62
59
|
</moq-watch>
|
|
63
60
|
```
|
|
64
61
|
|
|
65
62
|
### Attributes
|
|
66
63
|
|
|
67
|
-
| Attribute
|
|
68
|
-
|
|
69
|
-
| `url`
|
|
70
|
-
| `name`
|
|
71
|
-
| `paused`
|
|
72
|
-
| `muted`
|
|
73
|
-
| `visible`
|
|
74
|
-
| `volume`
|
|
75
|
-
| `
|
|
64
|
+
| Attribute | Type | Default | Description |
|
|
65
|
+
|------------------|----------------------------|---------------|------------------------------------------|
|
|
66
|
+
| `url` | string | required | Relay server URL |
|
|
67
|
+
| `name` | string | required | Broadcast name/path |
|
|
68
|
+
| `paused` | boolean | false | Pause playback |
|
|
69
|
+
| `muted` | boolean | false | Mute audio |
|
|
70
|
+
| `visible` | never, distance, or always | `20%` | When to download video (see below) |
|
|
71
|
+
| `volume` | number | 0.5 | Audio volume (0-1) |
|
|
72
|
+
| `announced` | boolean | true | Wait for (re)announcement before subscribing. Ignored when the relay does not support broadcast discovery. |
|
|
73
|
+
| `delay` | `auto`, duration, `instant` | `auto` | Distance from the live edge. `instant` paints frames as they decode and disables audio. |
|
|
74
|
+
| `buffer` | duration | `0ms` | Future-dated media held before playback skips ahead. |
|
|
75
|
+
| `captions` | string | off | Text rendition to render. |
|
|
76
|
+
| `catalog-format` | hang, hangz, msf, manual | auto-detected | The catalog format; detected from the name suffix unless set. `hangz` (compressed) is opt-in. |
|
|
76
77
|
|
|
77
78
|
The `visible` attribute controls when the video track is downloaded, based on the canvas
|
|
78
79
|
position relative to the viewport:
|
|
@@ -87,26 +88,37 @@ Only the distance mode suspends video while the tab is hidden; `always` keeps do
|
|
|
87
88
|
|
|
88
89
|
## JavaScript API
|
|
89
90
|
|
|
90
|
-
For
|
|
91
|
+
For a headless player, construct `Player` with a connection origin and a canvas.
|
|
92
|
+
It owns the broadcast, rendition selection, synchronized decoders, video
|
|
93
|
+
renderer, audio emitter, and captions. Pass `Signal` values to change controls
|
|
94
|
+
later; call `close()` when playback ends.
|
|
91
95
|
|
|
92
96
|
```typescript
|
|
93
97
|
import * as Watch from "@moq/watch";
|
|
98
|
+
import { Signal } from "@moq/signals";
|
|
94
99
|
|
|
95
|
-
const
|
|
100
|
+
const connection = new Watch.Net.Connection({
|
|
101
|
+
url: new URL("https://relay.example.com/anon"),
|
|
96
102
|
enabled: true,
|
|
97
|
-
name: "alice.hang",
|
|
98
|
-
video: { enabled: true },
|
|
99
|
-
audio: { enabled: true },
|
|
100
103
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const muted = new Signal(false);
|
|
105
|
+
const player = new Watch.Player({
|
|
106
|
+
origin: connection.origin,
|
|
107
|
+
probe: connection.probe,
|
|
108
|
+
name: Watch.Net.Path.from("room/alice.hang"),
|
|
109
|
+
canvas,
|
|
110
|
+
muted,
|
|
107
111
|
});
|
|
112
|
+
|
|
113
|
+
// player.broadcast, player.video, player.audio, player.text,
|
|
114
|
+
// player.renderer, player.emitter, and player.sync expose the pipeline.
|
|
115
|
+
// Later: player.close(); connection.close();
|
|
108
116
|
```
|
|
109
117
|
|
|
118
|
+
`<moq-watch>` wraps this same `Player` and maps attributes to its controls.
|
|
119
|
+
`Broadcast`, `Sync`, and the `Video`, `Audio`, and `Text` components remain
|
|
120
|
+
available when an application needs a different pipeline.
|
|
121
|
+
|
|
110
122
|
## UI Web Component
|
|
111
123
|
|
|
112
124
|
`@moq/watch` includes a Web Component UI overlay (`<moq-watch-ui>`) with playback controls, volume, buffering indicator, unsupported-codec indicator, quality selector, and stats panel. It is built on top of `@moq/signals` with no framework dependency.
|
|
@@ -128,11 +140,11 @@ The `<moq-watch-ui>` element automatically discovers the nested `<moq-watch>` el
|
|
|
128
140
|
|
|
129
141
|
## Features
|
|
130
142
|
|
|
131
|
-
- **WebCodecs decoding
|
|
132
|
-
- **Reactive state
|
|
133
|
-
- **
|
|
134
|
-
- **
|
|
135
|
-
- **
|
|
143
|
+
- **WebCodecs decoding**: Hardware-accelerated video and audio decoding
|
|
144
|
+
- **Reactive state**: All properties are signals from `@moq/signals`
|
|
145
|
+
- **Latency control**: A delay target plus optional buffering for future-dated frames
|
|
146
|
+
- **Quality selection**: Switch between available renditions
|
|
147
|
+
- **Custom tracks**: Unknown catalog sections pass through, and `broadcast.out.active` subscribes your own tracks
|
|
136
148
|
|
|
137
149
|
## License
|
|
138
150
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as Catalog from "@norskvideo/moq-hang/catalog";
|
|
2
|
+
import { Time } from "@norskvideo/moq-net";
|
|
3
|
+
/** The catalog fields that determine the demuxer and WebCodecs decoder instance. */
|
|
4
|
+
export type DecoderConfig = Pick<Catalog.AudioConfig, "codec" | "container" | "description" | "sampleRate" | "numberOfChannels">;
|
|
5
|
+
/** The routing and decoder state whose changes require a replacement subscription. */
|
|
6
|
+
export type PlaybackIdentity = {
|
|
7
|
+
broadcast: Catalog.AudioConfig["broadcast"];
|
|
8
|
+
decoder: DecoderConfig;
|
|
9
|
+
};
|
|
10
|
+
/** Reduce a rendition config to the fields that require a new decoder. */
|
|
11
|
+
export declare function decoderConfig(config: Catalog.AudioConfig): DecoderConfig;
|
|
12
|
+
/** Reduce a rendition config to the fields that require a replacement subscription. */
|
|
13
|
+
export declare function playbackIdentity(config: Catalog.AudioConfig): PlaybackIdentity;
|
|
14
|
+
/**
|
|
15
|
+
* The sync buffer a rendition needs, in milliseconds: its catalog `delay` behind the broadcast's
|
|
16
|
+
* earliest rendition plus its own jitter.
|
|
17
|
+
*/
|
|
18
|
+
export declare function playbackJitter(config: Catalog.AudioConfig): Time.Milli;
|
|
19
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/audio/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAUhC,oFAAoF;AACpF,MAAM,MAAM,aAAa,GAAG,IAAI,CAC/B,OAAO,CAAC,WAAW,EACnB,OAAO,GAAG,WAAW,GAAG,aAAa,GAAG,YAAY,GAAG,kBAAkB,CACzE,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,aAAa,CAQxE;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,gBAAgB,CAK9E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAQtE"}
|
package/audio/decoder.d.ts
CHANGED
|
@@ -2,11 +2,18 @@ import * as Catalog from "@norskvideo/moq-hang/catalog";
|
|
|
2
2
|
import * as Container from "@norskvideo/moq-hang/container";
|
|
3
3
|
import { Time } from "@norskvideo/moq-net";
|
|
4
4
|
import { type Getter, type Inputs, type Readonlys, Signal } from "@norskvideo/moq-signals";
|
|
5
|
-
import {
|
|
5
|
+
import type { Sync } from "../sync";
|
|
6
6
|
import type { Source } from "./source";
|
|
7
7
|
export type DecoderInput = {
|
|
8
8
|
enabled: Getter<boolean>;
|
|
9
9
|
};
|
|
10
|
+
/** Constructor properties for {@link Decoder}. */
|
|
11
|
+
export type DecoderProps = Inputs<DecoderInput> & {
|
|
12
|
+
/** Rendition selector supplying encoded audio. */
|
|
13
|
+
source: Source;
|
|
14
|
+
/** Shared playback clock. */
|
|
15
|
+
sync: Sync;
|
|
16
|
+
};
|
|
10
17
|
type DecoderOutput = {
|
|
11
18
|
context: Signal<AudioContext | undefined>;
|
|
12
19
|
root: Signal<AudioNode | undefined>;
|
|
@@ -32,7 +39,7 @@ export declare class Decoder {
|
|
|
32
39
|
readonly source: Source;
|
|
33
40
|
readonly sync: Sync;
|
|
34
41
|
readonly out: Readonlys<DecoderOutput>;
|
|
35
|
-
constructor(
|
|
42
|
+
constructor(props: DecoderProps);
|
|
36
43
|
reset(): void;
|
|
37
44
|
close(): void;
|
|
38
45
|
static supported: typeof supported;
|
package/audio/decoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/audio/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/audio/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAGN,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,SAAS,EAEd,MAAM,EACN,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM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CAC7B;AAED,iBAAe,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAsCtE"}
|
package/audio/emitter.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export type EmitterInput = {
|
|
|
5
5
|
muted: Getter<boolean>;
|
|
6
6
|
paused: Getter<boolean>;
|
|
7
7
|
};
|
|
8
|
+
/** Constructor properties for {@link Emitter}. */
|
|
9
|
+
export type EmitterProps = Inputs<EmitterInput> & {
|
|
10
|
+
/** Decoder supplying PCM. */
|
|
11
|
+
source: Decoder;
|
|
12
|
+
};
|
|
8
13
|
type EmitterOutput = {
|
|
9
14
|
enabled: Signal<boolean>;
|
|
10
15
|
};
|
|
@@ -13,7 +18,7 @@ export declare class Emitter {
|
|
|
13
18
|
readonly source: Decoder;
|
|
14
19
|
readonly in: Readonlys<EmitterInput>;
|
|
15
20
|
readonly out: Readonlys<EmitterOutput>;
|
|
16
|
-
constructor(
|
|
21
|
+
constructor(props: EmitterProps);
|
|
17
22
|
close(): void;
|
|
18
23
|
}
|
|
19
24
|
export {};
|
package/audio/emitter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/audio/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,KAAK,SAAS,EAAa,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,MAAM,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAIvB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAGvB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACxB,CAAC;AAEF,KAAK,aAAa,GAAG;IAEpB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACzB,CAAC;AAGF,qBAAa,OAAO;;IACnB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAKrC,QAAQ,CAAC,GAAG,2BAAwB;IAOpC,YAAY,
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/audio/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,KAAK,SAAS,EAAa,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,MAAM,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAIvB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAGvB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACxB,CAAC;AAEF,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG;IACjD,6BAA6B;IAC7B,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,KAAK,aAAa,GAAG;IAEpB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACzB,CAAC;AAGF,qBAAa,OAAO;;IACnB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAKrC,QAAQ,CAAC,GAAG,2BAAwB;IAOpC,YAAY,KAAK,EAAE,YAAY,EAiD9B;IAED,KAAK,SAEJ;CACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Time } from "@norskvideo/moq-net";
|
|
2
|
+
/**
|
|
3
|
+
* The ring depth for a target delay, floored at one AudioWorklet render quantum.
|
|
4
|
+
*
|
|
5
|
+
* `delay="instant"` reports a zero buffer, which the ring rejects outright: construction throws,
|
|
6
|
+
* the worklet is left with no backend, and every later resize is gated on that backend existing, so
|
|
7
|
+
* audio never recovers. Audio keeps its own floor rather than deriving its depth verbatim from a
|
|
8
|
+
* buffer whose meaning is "video holds nothing".
|
|
9
|
+
*/
|
|
10
|
+
export declare function ringSamples(rate: number, delay: Time.Milli): number;
|
|
11
|
+
//# sourceMappingURL=latency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latency.d.ts","sourceRoot":"","sources":["../../src/audio/latency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAMhC;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,MAAM,CAEnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ring-buffer.d.ts","sourceRoot":"","sources":["../../src/audio/ring-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,qBAAa,eAAe;;IAK3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAU1B,YAAY,KAAK,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACnB,EAqBA;IAMD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,CAE1B;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"ring-buffer.d.ts","sourceRoot":"","sources":["../../src/audio/ring-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,qBAAa,eAAe;;IAK3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAU1B,YAAY,KAAK,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACnB,EAqBA;IAMD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,CAE1B;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAgBhC;IAgCD,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CA8EvD;IAED;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAKpC;IAGD,KAAK,IAAI,IAAI,CAKZ;IAED,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAqBnC;CACD"}
|
|
@@ -41,7 +41,14 @@ export declare class SharedRingBuffer {
|
|
|
41
41
|
* AudioWorklet only. Returns the number of samples read.
|
|
42
42
|
*/
|
|
43
43
|
read(output: Float32Array[]): number;
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Update the target latency in samples. Main thread only.
|
|
46
|
+
*
|
|
47
|
+
* A deeper floor parks playback until it refills. Video holds the extra delay on its own, so
|
|
48
|
+
* audio that kept draining at the old depth would run ahead by the difference. Parking keeps
|
|
49
|
+
* what is buffered, so a rise costs only its own size in silence, and none if the buffer
|
|
50
|
+
* already covers the new floor.
|
|
51
|
+
*/
|
|
45
52
|
setLatency(samples: number): void;
|
|
46
53
|
/**
|
|
47
54
|
* Drop buffered samples at or after `timestamp`, keeping whatever is already due.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-ring-buffer.d.ts","sourceRoot":"","sources":["../../src/audio/shared-ring-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-ring-buffer.d.ts","sourceRoot":"","sources":["../../src/audio/shared-ring-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAkDhC,MAAM,WAAW,oBAAoB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,iBAAiB,CAAC;IAEzB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAOD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,UAAQ,GACd,oBAAoB,CAgBtB;AAkBD,qBAAa,gBAAgB;;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAuBpC;;;;;;;OAOG;IACH,YAAY,IAAI,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,gBAAgB,EAiBlE;IAwDD;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CA+ExD;IAYD;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAwDnC;IAED;;;;;;;OAOG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAchC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAmBpC;IAED;;;OAGG;IACH,KAAK,IAAI,IAAI,CAMZ;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,CAsC5C;IAiBD;;;;;OAKG;IACH,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,CAE1B;IAED,uDAAuD;IACvD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;CACD"}
|
package/audio/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/audio/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/audio/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AACrC,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;AAG9C,MAAM,MAAM,MAAM,GAAG;IAEpB,IAAI,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AAED,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,0EAA0E;AAC1E,qBAAa,QAAQ;;IASpB,4DAA4D;IAC5D,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,GAAG,SAAS,CAEhC;IAED,oFAAoF;IACpF,KAAK,CAAC,OAAO,SAAI,GAAG,IAAI,CAKvB;IAED,oFAAoF;IACpF,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAe5B;IAED,0EAA0E;IAC1E,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CAuBpC;CAMD"}
|
package/broadcast.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as Catalog from "@norskvideo/moq-hang/catalog";
|
|
2
2
|
import type * as Moq from "@norskvideo/moq-net";
|
|
3
|
+
import { Path } from "@norskvideo/moq-net";
|
|
3
4
|
import { Effect, type Getter, type Inputs, type Readonlys, Signal } from "@norskvideo/moq-signals";
|
|
4
5
|
export declare const CATALOG_FORMATS: readonly ["hang", "msf", "hangz", "manual"];
|
|
5
6
|
export type CatalogFormat = (typeof CATALOG_FORMATS)[number];
|
|
6
|
-
export declare function parseCatalogFormat(value: string | null): CatalogFormat | undefined;
|
|
7
7
|
type Status = "offline" | "loading" | "live";
|
|
8
8
|
export type BroadcastInput = {
|
|
9
|
-
|
|
9
|
+
origin: Getter<Moq.Origin.Table | undefined>;
|
|
10
10
|
enabled: Getter<boolean>;
|
|
11
11
|
name: Getter<Moq.Path.Valid>;
|
|
12
|
-
|
|
12
|
+
announced: Getter<boolean>;
|
|
13
13
|
catalogFormat: Getter<CatalogFormat | undefined>;
|
|
14
14
|
catalog: Getter<Catalog.Root | undefined>;
|
|
15
15
|
};
|
|
@@ -23,8 +23,22 @@ export declare class Broadcast {
|
|
|
23
23
|
readonly in: Readonlys<BroadcastInput>;
|
|
24
24
|
readonly out: Readonlys<BroadcastOutput>;
|
|
25
25
|
constructor(props?: Inputs<BroadcastInput>);
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the `Moq.Broadcast.Consumer` that publishes a given track.
|
|
28
|
+
*
|
|
29
|
+
* If `rel` is set (a rendition's catalog `broadcast` field), treat it as a path
|
|
30
|
+
* relative to this broadcast's name and consume the resolved broadcast on the same
|
|
31
|
+
* connection. Otherwise return the catalog's own active broadcast.
|
|
32
|
+
*
|
|
33
|
+
* Returns `undefined` for a reference that walks above the root: hang requires such a
|
|
34
|
+
* rendition to be ignored, since clamping at the root would point it at an unrelated
|
|
35
|
+
* broadcast.
|
|
36
|
+
*
|
|
37
|
+
* The consumer is scoped to the caller's `effect` (closed on its next run), so a
|
|
38
|
+
* reference resolves lazily and reacts to `enabled` / connection / announcement
|
|
39
|
+
* changes exactly like the catalog broadcast.
|
|
40
|
+
*/
|
|
41
|
+
relativeBroadcast(effect: Effect, rel: Path.Relative | undefined): Moq.Broadcast.Consumer | undefined;
|
|
28
42
|
close(): void;
|
|
29
43
|
}
|
|
30
44
|
export {};
|
package/broadcast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../src/broadcast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAG7C,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../src/broadcast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAG7C,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AACrC,OAAO,EAA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B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,GAAG,SAAS,CAWpG;IAED,KAAK,SAEJ;CACD"}
|
package/duration.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../src/duration.ts"],"names":[],"mappings":""}
|
package/element.d.ts
CHANGED
|
@@ -9,16 +9,26 @@ import type * as Catalog from "@norskvideo/moq-hang/catalog";
|
|
|
9
9
|
import type { Time } from "@norskvideo/moq-net";
|
|
10
10
|
import * as Moq from "@norskvideo/moq-net";
|
|
11
11
|
import { Effect, Signal } from "@norskvideo/moq-signals";
|
|
12
|
-
import * as Audio from "./audio";
|
|
13
|
-
import { Broadcast, type CatalogFormat } from "./broadcast";
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
12
|
+
import type * as Audio from "./audio";
|
|
13
|
+
import { type Broadcast, type CatalogFormat } from "./broadcast";
|
|
14
|
+
import { Player } from "./player";
|
|
15
|
+
import type { Delay, Sync } from "./sync";
|
|
16
|
+
import type * as Text from "./text";
|
|
17
|
+
import type * as Video from "./video";
|
|
18
|
+
declare const OBSERVED: readonly ["url", "name", "paused", "volume", "muted", "visible", "announced", "delay", "buffer", "reload", "latency", "latency-min", "jitter", "catalog-format", "captions"];
|
|
17
19
|
type Observed = (typeof OBSERVED)[number];
|
|
20
|
+
/** Parse the element's catalog-format attribute. */
|
|
21
|
+
export declare function parseCatalogFormat(value: string | null): CatalogFormat | undefined;
|
|
18
22
|
export default class MoqWatch extends HTMLElement {
|
|
19
23
|
#private;
|
|
20
|
-
static observedAttributes: readonly ["url", "name", "paused", "volume", "muted", "visible", "
|
|
21
|
-
|
|
24
|
+
static observedAttributes: readonly ["url", "name", "paused", "volume", "muted", "visible", "announced", "delay", "buffer", "reload", "latency", "latency-min", "jitter", "catalog-format", "captions"];
|
|
25
|
+
/**
|
|
26
|
+
* The relay connection, shared with every other element on the page pointing at the
|
|
27
|
+
* same URL. Its `origin` is where the broadcasts live.
|
|
28
|
+
*/
|
|
29
|
+
connection: Moq.Connection;
|
|
30
|
+
/** Headless playback pipeline behind this element. */
|
|
31
|
+
readonly player: Player;
|
|
22
32
|
broadcast: Broadcast;
|
|
23
33
|
/** Downloads and decodes the video track. `video.source` picks the rendition. */
|
|
24
34
|
video: Video.Decoder;
|
|
@@ -28,16 +38,22 @@ export default class MoqWatch extends HTMLElement {
|
|
|
28
38
|
renderer: Video.Renderer;
|
|
29
39
|
/** Plays decoded samples through the speakers. */
|
|
30
40
|
emitter: Audio.Emitter;
|
|
31
|
-
/**
|
|
41
|
+
/** Selects the caption track. `text.out.available` lists the renditions for a picker. */
|
|
42
|
+
text: Text.Source;
|
|
43
|
+
/** Renders the selected text cues into an overlay above the canvas. */
|
|
44
|
+
textRenderer: Text.Renderer;
|
|
45
|
+
/** Keeps audio and video playing at the configured delay. */
|
|
32
46
|
sync: Sync;
|
|
33
47
|
readonly controls: {
|
|
34
48
|
paused: Signal<boolean>;
|
|
35
49
|
volume: Signal<number>;
|
|
36
50
|
muted: Signal<boolean>;
|
|
37
51
|
visible: Signal<Video.Visible>;
|
|
38
|
-
|
|
52
|
+
delay: Signal<Delay>;
|
|
53
|
+
buffer: Signal<Time.Milli>;
|
|
39
54
|
target: Signal<Video.Target | undefined>;
|
|
40
55
|
audioTarget: Signal<Audio.Target | undefined>;
|
|
56
|
+
captions: Signal<string | undefined>;
|
|
41
57
|
};
|
|
42
58
|
/**
|
|
43
59
|
* Effects scoped to this element's lifetime, closed on disconnect.
|
|
@@ -62,30 +78,31 @@ export default class MoqWatch extends HTMLElement {
|
|
|
62
78
|
set muted(value: boolean);
|
|
63
79
|
get visible(): Video.Visible;
|
|
64
80
|
set visible(value: Video.Visible);
|
|
65
|
-
get
|
|
66
|
-
set
|
|
81
|
+
get announced(): boolean;
|
|
82
|
+
set announced(value: boolean);
|
|
67
83
|
/**
|
|
68
|
-
*
|
|
69
|
-
* `{ min, max }` to open a range and buffer future-dated frames. See {@link Latency}.
|
|
84
|
+
* How far playback trails the live edge, in milliseconds. See {@link Delay}.
|
|
70
85
|
*
|
|
71
|
-
* `"
|
|
72
|
-
*
|
|
86
|
+
* `"auto"` (the default) sizes the jitter buffer from the connection RTT. `"instant"` drops the
|
|
87
|
+
* clock instead: video paints the moment it decodes and audio is disabled.
|
|
73
88
|
*/
|
|
74
|
-
get
|
|
75
|
-
set
|
|
76
|
-
/** The latency floor (jitter/startup buffer). Read-modify-writes `latency`, leaving the ceiling. */
|
|
77
|
-
get latencyMin(): Bound;
|
|
78
|
-
set latencyMin(value: Bound);
|
|
89
|
+
get delay(): Delay;
|
|
90
|
+
set delay(value: Delay);
|
|
79
91
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* (
|
|
83
|
-
*
|
|
92
|
+
* Future-dated media held beyond the live edge before playback skips ahead, in milliseconds.
|
|
93
|
+
*
|
|
94
|
+
* Zero (the default) minimizes latency. A larger value enables buffered playback: build up a
|
|
95
|
+
* buffer from future-dated frames (e.g. TTS written faster than real-time) and only skip ahead
|
|
96
|
+
* once they would sit further than `delay + buffer` past the playhead. Call `reset()` at each
|
|
97
|
+
* utterance boundary.
|
|
84
98
|
*/
|
|
85
|
-
get
|
|
86
|
-
set
|
|
99
|
+
get buffer(): Time.Milli;
|
|
100
|
+
set buffer(value: Time.Milli);
|
|
101
|
+
set latency(_value: unknown);
|
|
102
|
+
set latencyMin(_value: unknown);
|
|
87
103
|
/** The jitter buffer in milliseconds. */
|
|
88
104
|
get jitter(): Time.Milli;
|
|
105
|
+
set jitter(_value: unknown);
|
|
89
106
|
/**
|
|
90
107
|
* Re-anchor playback at an utterance boundary in buffered mode: reset the sync reference
|
|
91
108
|
* and flush the audio buffer so the next utterance plays from its own first frame.
|
|
@@ -99,6 +116,13 @@ export default class MoqWatch extends HTMLElement {
|
|
|
99
116
|
*/
|
|
100
117
|
get catalog(): Catalog.Root | undefined;
|
|
101
118
|
set catalog(value: Catalog.Root | undefined);
|
|
119
|
+
/**
|
|
120
|
+
* The selected caption track name, or `undefined` for off (the default). Captions are opt-in:
|
|
121
|
+
* assign a track name from `text.out.available` to turn them on. See the `text` source for the
|
|
122
|
+
* list of renditions the broadcast publishes.
|
|
123
|
+
*/
|
|
124
|
+
get captions(): string | undefined;
|
|
125
|
+
set captions(value: string | undefined);
|
|
102
126
|
}
|
|
103
127
|
declare global {
|
|
104
128
|
interface HTMLElementTagNameMap {
|
package/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,KAAK,SAAS,EAAmB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE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