@moq/watch 0.1.1 → 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/broadcast.d.ts CHANGED
@@ -4,14 +4,14 @@ import { type Getter, Signal } from "@moq/signals";
4
4
  export interface BroadcastProps {
5
5
  connection?: Moq.Connection.Established | Signal<Moq.Connection.Established | undefined>;
6
6
  enabled?: boolean | Signal<boolean>;
7
- path?: Moq.Path.Valid | Signal<Moq.Path.Valid | undefined>;
7
+ name?: Moq.Path.Valid | Signal<Moq.Path.Valid | undefined>;
8
8
  reload?: boolean | Signal<boolean>;
9
9
  }
10
10
  export declare class Broadcast {
11
11
  #private;
12
12
  connection: Signal<Moq.Connection.Established | undefined>;
13
13
  enabled: Signal<boolean>;
14
- path: Signal<Moq.Path.Valid | undefined>;
14
+ name: Signal<Moq.Path.Valid | undefined>;
15
15
  status: Moq.Signals.Signal<"offline" | "loading" | "live">;
16
16
  reload: Signal<boolean>;
17
17
  readonly active: Getter<Moq.Broadcast | undefined>;
package/element.d.ts CHANGED
@@ -1,30 +1,30 @@
1
1
  import type { Time } from "@moq/lite";
2
2
  import * as Moq from "@moq/lite";
3
- import { Signal } from "@moq/signals";
4
- import type * as Audio from "./audio";
5
- import { type Backend } from "./backend";
3
+ import { MultiBackend } from "./backend";
6
4
  import { Broadcast } from "./broadcast";
7
5
  import { Sync } from "./sync";
8
- import type * as Video from "./video";
9
- declare const OBSERVED: readonly ["url", "name", "path", "paused", "volume", "muted", "reload", "jitter", "latency"];
6
+ declare const OBSERVED: readonly ["url", "name", "paused", "volume", "muted", "reload", "jitter"];
10
7
  type Observed = (typeof OBSERVED)[number];
11
- export default class MoqWatch extends HTMLElement implements Backend {
8
+ export default class MoqWatch extends HTMLElement {
12
9
  #private;
13
- static observedAttributes: readonly ["url", "name", "path", "paused", "volume", "muted", "reload", "jitter", "latency"];
10
+ static observedAttributes: readonly ["url", "name", "paused", "volume", "muted", "reload", "jitter"];
14
11
  connection: Moq.Connection.Reload;
15
12
  broadcast: Broadcast;
16
13
  sync: Sync;
14
+ backend: MultiBackend;
17
15
  signals: Moq.Signals.Effect;
18
16
  constructor();
19
17
  connectedCallback(): void;
20
18
  disconnectedCallback(): void;
21
19
  attributeChangedCallback(name: Observed, oldValue: string | null, newValue: string | null): void;
22
- get url(): Signal<URL | undefined>;
23
- get path(): Signal<Moq.Path.Valid | undefined>;
24
- get jitter(): Signal<Time.Milli>;
25
- get paused(): Signal<boolean>;
26
- get audio(): Audio.Backend;
27
- get video(): Video.Backend;
20
+ get url(): URL | undefined;
21
+ set url(value: string | URL | undefined);
22
+ get name(): Moq.Path.Valid | undefined;
23
+ set name(value: string | Moq.Path.Valid | undefined);
24
+ get paused(): boolean;
25
+ set paused(value: boolean);
26
+ get jitter(): Time.Milli;
27
+ set jitter(value: number);
28
28
  }
29
29
  declare global {
30
30
  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,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,OAAO,EAAU,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAItC,QAAA,MAAM,QAAQ,8FAA+F,CAAC;AAC9G,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAQ1C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAY,Y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AM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;;IAChD,MAAM,CAAC,kBAAkB,4EAAY;IAGrC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;IAGlC,SAAS,EAAE,SAAS,CAAC;IAGrB,IAAI,OAAc;IAGlB,OAAO,EAAE,YAAY,CAAC;IAMtB,OAAO,qBAAgB;;IA2FvB,iBAAiB;IAMjB,oBAAoB;IAKpB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IA0BzF,IAAI,GAAG,IAAI,GAAG,GAAG,SAAS,CAEzB;IAED,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,EAEtC;IAED,IAAI,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAErC;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,EAElD;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAExB;IAED,IAAI,MAAM,IAAI,IAAI,CAAC,KAAK,CAEvB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;CACD;AAID,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD"}
package/element.js CHANGED
@@ -1,101 +1,107 @@
1
- import * as o from "@moq/lite";
2
- import { Signal as n, Effect as a } from "@moq/signals";
3
- import { h as l, B as h, g as u } from "./broadcast-BFfLDq15.js";
4
- const c = ["url", "name", "path", "paused", "volume", "muted", "reload", "jitter", "latency"], d = new FinalizationRegistry((r) => r.close());
1
+ import * as n from "@moq/lite";
2
+ import { Signal as a, Effect as r } from "@moq/signals";
3
+ import { h as c, B as l, g as d } from "./broadcast-DhcOJtcZ.js";
4
+ const u = ["url", "name", "paused", "volume", "muted", "reload", "jitter"], h = new FinalizationRegistry((o) => o.close());
5
5
  class b extends HTMLElement {
6
- static observedAttributes = c;
6
+ static observedAttributes = u;
7
7
  // The connection to the moq-relay server.
8
8
  connection;
9
9
  // The broadcast being watched.
10
10
  broadcast;
11
11
  // Used to sync audio and video playback at a target latency.
12
- sync = new l();
12
+ sync = new c();
13
13
  // The backend that powers this element.
14
- #t;
14
+ backend;
15
15
  // Set when the element is connected to the DOM.
16
- #e = new n(!1);
16
+ #t = new a(!1);
17
17
  // Expose the Effect class, so users can easily create effects scoped to this element.
18
- signals = new a();
18
+ signals = new r();
19
19
  constructor() {
20
- super(), d.register(this, this.signals), this.connection = new o.Connection.Reload({
21
- enabled: this.#e
22
- }), this.signals.cleanup(() => this.connection.close()), this.broadcast = new h({
20
+ super(), h.register(this, this.signals), this.connection = new n.Connection.Reload({
21
+ enabled: this.#t
22
+ }), this.signals.cleanup(() => this.connection.close()), this.broadcast = new l({
23
23
  connection: this.connection.established,
24
- enabled: this.#e
25
- }), this.signals.cleanup(() => this.broadcast.close()), this.#t = new u({
24
+ enabled: this.#t
25
+ }), this.signals.cleanup(() => this.broadcast.close()), this.backend = new d({
26
26
  broadcast: this.broadcast
27
- }), this.signals.cleanup(() => this.#t.close());
28
- const s = () => {
29
- const t = this.querySelector("canvas"), e = this.querySelector("video");
30
- if (t && e)
27
+ }), this.signals.cleanup(() => this.backend.close());
28
+ const e = () => {
29
+ const t = this.querySelector("canvas"), s = this.querySelector("video");
30
+ if (t && s)
31
31
  throw new Error("Cannot have both canvas and video elements");
32
- this.#t.element.set(t ?? e);
33
- }, i = new MutationObserver(s);
34
- i.observe(this, { childList: !0, subtree: !0 }), this.signals.cleanup(() => i.disconnect()), s(), this.signals.run((t) => {
35
- const e = t.get(this.url);
36
- e ? this.setAttribute("url", e.toString()) : this.removeAttribute("url");
32
+ this.backend.element.set(t ?? s);
33
+ }, i = new MutationObserver(e);
34
+ i.observe(this, { childList: !0, subtree: !0 }), this.signals.cleanup(() => i.disconnect()), e(), this.signals.run((t) => {
35
+ const s = t.get(this.connection.url);
36
+ s ? this.setAttribute("url", s.toString()) : this.removeAttribute("url");
37
37
  }), this.signals.run((t) => {
38
- const e = t.get(this.path);
39
- e ? this.setAttribute("path", e.toString()) : this.removeAttribute("path");
38
+ const s = t.get(this.broadcast.name);
39
+ s ? this.setAttribute("name", s.toString()) : this.removeAttribute("name");
40
40
  }), this.signals.run((t) => {
41
- t.get(this.audio.muted) ? this.setAttribute("muted", "") : this.removeAttribute("muted");
41
+ t.get(this.backend.audio.muted) ? this.setAttribute("muted", "") : this.removeAttribute("muted");
42
42
  }), this.signals.run((t) => {
43
- t.get(this.paused) ? this.setAttribute("paused", "true") : this.removeAttribute("paused");
43
+ t.get(this.backend.paused) ? this.setAttribute("paused", "true") : this.removeAttribute("paused");
44
44
  }), this.signals.run((t) => {
45
- const e = t.get(this.audio.volume);
46
- this.setAttribute("volume", e.toString());
45
+ const s = t.get(this.backend.audio.volume);
46
+ this.setAttribute("volume", s.toString());
47
47
  }), this.signals.run((t) => {
48
- const e = Math.floor(t.get(this.jitter));
49
- this.setAttribute("jitter", e.toString());
48
+ const s = Math.floor(t.get(this.backend.jitter));
49
+ this.setAttribute("jitter", s.toString());
50
50
  });
51
51
  }
52
52
  // Annoyingly, we have to use these callbacks to figure out when the element is connected to the DOM.
53
53
  // This wouldn't be so bad if there was a destructor for web components to clean up our effects.
54
54
  connectedCallback() {
55
- this.#e.set(!0), this.style.display = "block", this.style.position = "relative";
55
+ this.#t.set(!0), this.style.display = "block", this.style.position = "relative";
56
56
  }
57
57
  disconnectedCallback() {
58
- this.#e.set(!1);
58
+ this.#t.set(!1);
59
59
  }
60
- attributeChangedCallback(s, i, t) {
60
+ attributeChangedCallback(e, i, t) {
61
61
  if (i !== t)
62
- if (s === "url")
63
- this.url.set(t ? new URL(t) : void 0);
64
- else if (s === "name" || s === "path")
65
- this.path.set(t ? o.Path.from(t) : void 0);
66
- else if (s === "paused")
67
- this.paused.set(t !== null);
68
- else if (s === "volume") {
69
- const e = t ? Number.parseFloat(t) : 0.5;
70
- this.audio.volume.set(e);
71
- } else if (s === "muted")
72
- this.audio.muted.set(t !== null);
73
- else if (s === "reload")
62
+ if (e === "url")
63
+ this.connection.url.set(t ? new URL(t) : void 0);
64
+ else if (e === "name")
65
+ this.broadcast.name.set(t ? n.Path.from(t) : void 0);
66
+ else if (e === "paused")
67
+ this.backend.paused.set(t !== null);
68
+ else if (e === "volume") {
69
+ const s = t ? Number.parseFloat(t) : 0.5;
70
+ this.backend.audio.volume.set(s);
71
+ } else if (e === "muted")
72
+ this.backend.audio.muted.set(t !== null);
73
+ else if (e === "reload")
74
74
  this.broadcast.reload.set(t !== null);
75
- else if (s === "jitter" || s === "latency")
76
- this.jitter.set(t ? Number.parseFloat(t) : 100);
75
+ else if (e === "jitter")
76
+ this.backend.jitter.set(t ? Number.parseFloat(t) : 100);
77
77
  else {
78
- const e = s;
79
- throw new Error(`Invalid attribute: ${e}`);
78
+ const s = e;
79
+ throw new Error(`Invalid attribute: ${s}`);
80
80
  }
81
81
  }
82
82
  get url() {
83
- return this.connection.url;
83
+ return this.connection.url.peek();
84
84
  }
85
- get path() {
86
- return this.broadcast.path;
85
+ set url(e) {
86
+ this.connection.url.set(e ? new URL(e) : void 0);
87
87
  }
88
- get jitter() {
89
- return this.#t.jitter;
88
+ get name() {
89
+ return this.broadcast.name.peek();
90
+ }
91
+ set name(e) {
92
+ this.broadcast.name.set(e ? n.Path.from(e) : void 0);
90
93
  }
91
94
  get paused() {
92
- return this.#t.paused;
95
+ return this.backend.paused.peek();
93
96
  }
94
- get audio() {
95
- return this.#t.audio;
97
+ set paused(e) {
98
+ this.backend.paused.set(e);
99
+ }
100
+ get jitter() {
101
+ return this.backend.jitter.peek();
96
102
  }
97
- get video() {
98
- return this.#t.video;
103
+ set jitter(e) {
104
+ this.backend.jitter.set(e);
99
105
  }
100
106
  }
101
107
  customElements.define("moq-watch", b);
package/element.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"element.js","sources":["../src/element.ts"],"sourcesContent":["import type { Time } from \"@moq/lite\";\nimport * as Moq from \"@moq/lite\";\nimport { Effect, Signal } from \"@moq/signals\";\nimport type * as Audio from \"./audio\";\nimport { type Backend, MultiBackend } from \"./backend\";\nimport { Broadcast } from \"./broadcast\";\nimport { Sync } from \"./sync\";\nimport type * as Video from \"./video\";\n\n// TODO remove name; replaced with path\n// TODO remove latency; replaced with buffer\nconst OBSERVED = [\"url\", \"name\", \"path\", \"paused\", \"volume\", \"muted\", \"reload\", \"jitter\", \"latency\"] as const;\ntype Observed = (typeof OBSERVED)[number];\n\n// Close everything when this element is garbage collected.\n// This is primarily to avoid a console.warn that we didn't close() before GC.\n// There's no destructor for web components so this is the best we can do.\nconst cleanup = new FinalizationRegistry<Effect>((signals) => signals.close());\n\n// An optional web component that wraps a <canvas>\nexport default class MoqWatch extends HTMLElement implements Backend {\n\tstatic observedAttributes = OBSERVED;\n\n\t// The connection to the moq-relay server.\n\tconnection: Moq.Connection.Reload;\n\n\t// The broadcast being watched.\n\tbroadcast: Broadcast;\n\n\t// Used to sync audio and video playback at a target latency.\n\tsync = new Sync();\n\n\t// The backend that powers this element.\n\t#backend: MultiBackend;\n\n\t// Set when the element is connected to the DOM.\n\t#enabled = new Signal(false);\n\n\t// Expose the Effect class, so users can easily create effects scoped to this element.\n\tsignals = new Effect();\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tcleanup.register(this, this.signals);\n\n\t\tthis.connection = new Moq.Connection.Reload({\n\t\t\tenabled: this.#enabled,\n\t\t});\n\t\tthis.signals.cleanup(() => this.connection.close());\n\n\t\tthis.broadcast = new Broadcast({\n\t\t\tconnection: this.connection.established,\n\t\t\tenabled: this.#enabled,\n\t\t});\n\t\tthis.signals.cleanup(() => this.broadcast.close());\n\n\t\tthis.#backend = new MultiBackend({\n\t\t\tbroadcast: this.broadcast,\n\t\t});\n\t\tthis.signals.cleanup(() => this.#backend.close());\n\n\t\t// Watch to see if the canvas element is added or removed.\n\t\tconst setElement = () => {\n\t\t\tconst canvas = this.querySelector(\"canvas\") as HTMLCanvasElement | undefined;\n\t\t\tconst video = this.querySelector(\"video\") as HTMLVideoElement | undefined;\n\t\t\tif (canvas && video) {\n\t\t\t\tthrow new Error(\"Cannot have both canvas and video elements\");\n\t\t\t}\n\t\t\tthis.#backend.element.set(canvas ?? video);\n\t\t};\n\n\t\tconst observer = new MutationObserver(setElement);\n\t\tobserver.observe(this, { childList: true, subtree: true });\n\t\tthis.signals.cleanup(() => observer.disconnect());\n\t\tsetElement();\n\n\t\t// Optionally update attributes to match the library state.\n\t\t// This is kind of dangerous because it can create loops.\n\t\t// NOTE: This only runs when the element is connected to the DOM, which is not obvious.\n\t\t// This is because there's no destructor for web components to clean up our effects.\n\t\tthis.signals.run((effect) => {\n\t\t\tconst url = effect.get(this.url);\n\t\t\tif (url) {\n\t\t\t\tthis.setAttribute(\"url\", url.toString());\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"url\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst broadcast = effect.get(this.path);\n\t\t\tif (broadcast) {\n\t\t\t\tthis.setAttribute(\"path\", broadcast.toString());\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"path\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst muted = effect.get(this.audio.muted);\n\t\t\tif (muted) {\n\t\t\t\tthis.setAttribute(\"muted\", \"\");\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"muted\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst paused = effect.get(this.paused);\n\t\t\tif (paused) {\n\t\t\t\tthis.setAttribute(\"paused\", \"true\");\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"paused\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst volume = effect.get(this.audio.volume);\n\t\t\tthis.setAttribute(\"volume\", volume.toString());\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst jitter = Math.floor(effect.get(this.jitter));\n\t\t\tthis.setAttribute(\"jitter\", jitter.toString());\n\t\t});\n\t}\n\n\t// Annoyingly, we have to use these callbacks to figure out when the element is connected to the DOM.\n\t// This wouldn't be so bad if there was a destructor for web components to clean up our effects.\n\tconnectedCallback() {\n\t\tthis.#enabled.set(true);\n\t\tthis.style.display = \"block\";\n\t\tthis.style.position = \"relative\";\n\t}\n\n\tdisconnectedCallback() {\n\t\t// Stop everything but don't actually cleanup just in case we get added back to the DOM.\n\t\tthis.#enabled.set(false);\n\t}\n\n\tattributeChangedCallback(name: Observed, oldValue: string | null, newValue: string | null) {\n\t\tif (oldValue === newValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (name === \"url\") {\n\t\t\tthis.url.set(newValue ? new URL(newValue) : undefined);\n\t\t} else if (name === \"name\" || name === \"path\") {\n\t\t\tthis.path.set(newValue ? Moq.Path.from(newValue) : undefined);\n\t\t} else if (name === \"paused\") {\n\t\t\tthis.paused.set(newValue !== null);\n\t\t} else if (name === \"volume\") {\n\t\t\tconst volume = newValue ? Number.parseFloat(newValue) : 0.5;\n\t\t\tthis.audio.volume.set(volume);\n\t\t} else if (name === \"muted\") {\n\t\t\tthis.audio.muted.set(newValue !== null);\n\t\t} else if (name === \"reload\") {\n\t\t\tthis.broadcast.reload.set(newValue !== null);\n\t\t} else if (name === \"jitter\" || name === \"latency\") {\n\t\t\t// \"latency\" is a legacy alias for \"jitter\"\n\t\t\tthis.jitter.set((newValue ? Number.parseFloat(newValue) : 100) as Time.Milli);\n\t\t} else {\n\t\t\tconst exhaustive: never = name;\n\t\t\tthrow new Error(`Invalid attribute: ${exhaustive}`);\n\t\t}\n\t}\n\n\tget url(): Signal<URL | undefined> {\n\t\treturn this.connection.url;\n\t}\n\n\tget path(): Signal<Moq.Path.Valid | undefined> {\n\t\treturn this.broadcast.path;\n\t}\n\n\tget jitter(): Signal<Time.Milli> {\n\t\treturn this.#backend.jitter;\n\t}\n\n\tget paused(): Signal<boolean> {\n\t\treturn this.#backend.paused;\n\t}\n\n\tget audio(): Audio.Backend {\n\t\treturn this.#backend.audio;\n\t}\n\n\tget video(): Video.Backend {\n\t\treturn this.#backend.video;\n\t}\n}\n\ncustomElements.define(\"moq-watch\", MoqWatch);\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"moq-watch\": MoqWatch;\n\t}\n}\n"],"names":["OBSERVED","cleanup","signals","MoqWatch","Sync","#backend","#enabled","Signal","Effect","Moq","Broadcast","MultiBackend","setElement","canvas","video","observer","effect","url","broadcast","volume","jitter","name","oldValue","newValue","exhaustive"],"mappings":";;;AAWA,MAAMA,IAAW,CAAC,OAAO,QAAQ,QAAQ,UAAU,UAAU,SAAS,UAAU,UAAU,SAAS,GAM7FC,IAAU,IAAI,qBAA6B,CAACC,MAAYA,EAAQ,OAAO;AAG7E,MAAqBC,UAAiB,YAA+B;AAAA,EACpE,OAAO,qBAAqBH;AAAA;AAAA,EAG5B;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA,OAAO,IAAII,EAAA;AAAA;AAAA,EAGXC;AAAA;AAAA,EAGAC,KAAW,IAAIC,EAAO,EAAK;AAAA;AAAA,EAG3B,UAAU,IAAIC,EAAA;AAAA,EAEd,cAAc;AACb,UAAA,GAEAP,EAAQ,SAAS,MAAM,KAAK,OAAO,GAEnC,KAAK,aAAa,IAAIQ,EAAI,WAAW,OAAO;AAAA,MAC3C,SAAS,KAAKH;AAAA,IAAA,CACd,GACD,KAAK,QAAQ,QAAQ,MAAM,KAAK,WAAW,OAAO,GAElD,KAAK,YAAY,IAAII,EAAU;AAAA,MAC9B,YAAY,KAAK,WAAW;AAAA,MAC5B,SAAS,KAAKJ;AAAA,IAAA,CACd,GACD,KAAK,QAAQ,QAAQ,MAAM,KAAK,U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AEA,IAAI,MAA+B;AAClC,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA,EAEA,IAAI,OAA2C;AAC9C,WAAO,KAAK,UAAU;AAAA,EACvB;AAAA,EAEA,IAAI,SAA6B;AAChC,WAAO,KAAKnB,GAAS;AAAA,EACtB;AAAA,EAEA,IAAI,SAA0B;AAC7B,WAAO,KAAKA,GAAS;AAAA,EACtB;AAAA,EAEA,IAAI,QAAuB;AAC1B,WAAO,KAAKA,GAAS;AAAA,EACtB;AAAA,EAEA,IAAI,QAAuB;AAC1B,WAAO,KAAKA,GAAS;AAAA,EACtB;AACD;AAEA,eAAe,OAAO,aAAaF,CAAQ;"}
1
+ {"version":3,"file":"element.js","sources":["../src/element.ts"],"sourcesContent":["import type { Time } from \"@moq/lite\";\nimport * as Moq from \"@moq/lite\";\nimport { Effect, Signal } from \"@moq/signals\";\nimport { MultiBackend } from \"./backend\";\nimport { Broadcast } from \"./broadcast\";\nimport { Sync } from \"./sync\";\n\nconst OBSERVED = [\"url\", \"name\", \"paused\", \"volume\", \"muted\", \"reload\", \"jitter\"] as const;\ntype Observed = (typeof OBSERVED)[number];\n\n// Close everything when this element is garbage collected.\n// This is primarily to avoid a console.warn that we didn't close() before GC.\n// There's no destructor for web components so this is the best we can do.\nconst cleanup = new FinalizationRegistry<Effect>((signals) => signals.close());\n\n// An optional web component that wraps a <canvas>\nexport default class MoqWatch extends HTMLElement {\n\tstatic observedAttributes = OBSERVED;\n\n\t// The connection to the moq-relay server.\n\tconnection: Moq.Connection.Reload;\n\n\t// The broadcast being watched.\n\tbroadcast: Broadcast;\n\n\t// Used to sync audio and video playback at a target latency.\n\tsync = new Sync();\n\n\t// The backend that powers this element.\n\tbackend: MultiBackend;\n\n\t// Set when the element is connected to the DOM.\n\t#enabled = new Signal(false);\n\n\t// Expose the Effect class, so users can easily create effects scoped to this element.\n\tsignals = new Effect();\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tcleanup.register(this, this.signals);\n\n\t\tthis.connection = new Moq.Connection.Reload({\n\t\t\tenabled: this.#enabled,\n\t\t});\n\t\tthis.signals.cleanup(() => this.connection.close());\n\n\t\tthis.broadcast = new Broadcast({\n\t\t\tconnection: this.connection.established,\n\t\t\tenabled: this.#enabled,\n\t\t});\n\t\tthis.signals.cleanup(() => this.broadcast.close());\n\n\t\tthis.backend = new MultiBackend({\n\t\t\tbroadcast: this.broadcast,\n\t\t});\n\t\tthis.signals.cleanup(() => this.backend.close());\n\n\t\t// Watch to see if the canvas element is added or removed.\n\t\tconst setElement = () => {\n\t\t\tconst canvas = this.querySelector(\"canvas\") as HTMLCanvasElement | undefined;\n\t\t\tconst video = this.querySelector(\"video\") as HTMLVideoElement | undefined;\n\t\t\tif (canvas && video) {\n\t\t\t\tthrow new Error(\"Cannot have both canvas and video elements\");\n\t\t\t}\n\t\t\tthis.backend.element.set(canvas ?? video);\n\t\t};\n\n\t\tconst observer = new MutationObserver(setElement);\n\t\tobserver.observe(this, { childList: true, subtree: true });\n\t\tthis.signals.cleanup(() => observer.disconnect());\n\t\tsetElement();\n\n\t\t// Optionally update attributes to match the library state.\n\t\t// This is kind of dangerous because it can create loops.\n\t\t// NOTE: This only runs when the element is connected to the DOM, which is not obvious.\n\t\t// This is because there's no destructor for web components to clean up our effects.\n\t\tthis.signals.run((effect) => {\n\t\t\tconst url = effect.get(this.connection.url);\n\t\t\tif (url) {\n\t\t\t\tthis.setAttribute(\"url\", url.toString());\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"url\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst name = effect.get(this.broadcast.name);\n\t\t\tif (name) {\n\t\t\t\tthis.setAttribute(\"name\", name.toString());\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"name\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst muted = effect.get(this.backend.audio.muted);\n\t\t\tif (muted) {\n\t\t\t\tthis.setAttribute(\"muted\", \"\");\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"muted\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst paused = effect.get(this.backend.paused);\n\t\t\tif (paused) {\n\t\t\t\tthis.setAttribute(\"paused\", \"true\");\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"paused\");\n\t\t\t}\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst volume = effect.get(this.backend.audio.volume);\n\t\t\tthis.setAttribute(\"volume\", volume.toString());\n\t\t});\n\n\t\tthis.signals.run((effect) => {\n\t\t\tconst jitter = Math.floor(effect.get(this.backend.jitter));\n\t\t\tthis.setAttribute(\"jitter\", jitter.toString());\n\t\t});\n\t}\n\n\t// Annoyingly, we have to use these callbacks to figure out when the element is connected to the DOM.\n\t// This wouldn't be so bad if there was a destructor for web components to clean up our effects.\n\tconnectedCallback() {\n\t\tthis.#enabled.set(true);\n\t\tthis.style.display = \"block\";\n\t\tthis.style.position = \"relative\";\n\t}\n\n\tdisconnectedCallback() {\n\t\t// Stop everything but don't actually cleanup just in case we get added back to the DOM.\n\t\tthis.#enabled.set(false);\n\t}\n\n\tattributeChangedCallback(name: Observed, oldValue: string | null, newValue: string | null) {\n\t\tif (oldValue === newValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (name === \"url\") {\n\t\t\tthis.connection.url.set(newValue ? new URL(newValue) : undefined);\n\t\t} else if (name === \"name\") {\n\t\t\tthis.broadcast.name.set(newValue ? Moq.Path.from(newValue) : undefined);\n\t\t} else if (name === \"paused\") {\n\t\t\tthis.backend.paused.set(newValue !== null);\n\t\t} else if (name === \"volume\") {\n\t\t\tconst volume = newValue ? Number.parseFloat(newValue) : 0.5;\n\t\t\tthis.backend.audio.volume.set(volume);\n\t\t} else if (name === \"muted\") {\n\t\t\tthis.backend.audio.muted.set(newValue !== null);\n\t\t} else if (name === \"reload\") {\n\t\t\tthis.broadcast.reload.set(newValue !== null);\n\t\t} else if (name === \"jitter\") {\n\t\t\tthis.backend.jitter.set((newValue ? Number.parseFloat(newValue) : 100) as Time.Milli);\n\t\t} else {\n\t\t\tconst exhaustive: never = name;\n\t\t\tthrow new Error(`Invalid attribute: ${exhaustive}`);\n\t\t}\n\t}\n\n\tget url(): URL | undefined {\n\t\treturn this.connection.url.peek();\n\t}\n\n\tset url(value: string | URL | undefined) {\n\t\tthis.connection.url.set(value ? new URL(value) : undefined);\n\t}\n\n\tget name(): Moq.Path.Valid | undefined {\n\t\treturn this.broadcast.name.peek();\n\t}\n\n\tset name(value: string | Moq.Path.Valid | undefined) {\n\t\tthis.broadcast.name.set(value ? Moq.Path.from(value) : undefined);\n\t}\n\n\tget paused(): boolean {\n\t\treturn this.backend.paused.peek();\n\t}\n\n\tset paused(value: boolean) {\n\t\tthis.backend.paused.set(value);\n\t}\n\n\tget jitter(): Time.Milli {\n\t\treturn this.backend.jitter.peek();\n\t}\n\n\tset jitter(value: number) {\n\t\tthis.backend.jitter.set(value as Time.Milli);\n\t}\n}\n\ncustomElements.define(\"moq-watch\", MoqWatch);\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"moq-watch\": MoqWatch;\n\t}\n}\n"],"names":["OBSERVED","cleanup","signals","MoqWatch","Sync","#enabled","Signal","Effect","Moq","Broadcast","MultiBackend","setElement","canvas","video","observer","effect","url","name","volume","jitter","oldValue","newValue","exhaustive","value"],"mappings":";;;AAOA,MAAMA,IAAW,CAAC,OAAO,QAAQ,UAAU,UAAU,SAAS,UAAU,QAAQ,GAM1EC,IAAU,IAAI,qBAA6B,CAACC,MAAYA,EAAQ,OAAO;AAG7E,MAAqBC,UAAiB,YAAY;AAAA,EACjD,OAAO,qBAAqBH;AAAA;AAAA,EAG5B;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA,OAAO,IAAII,EAAA;AAAA;AAAA,EAGX;AAAA;AAAA,EAGAC,KAAW,IAAIC,EAAO,EAAK;AAAA;AAAA,EAG3B,UAAU,IAAIC,EAAA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as P, f } from "./broadcast-BFfLDq15.js";
2
- import { B as L, m as N, g as V, h as W, t as Y } from "./broadcast-BFfLDq15.js";
1
+ import { D as w, M as p, R as v, S as m, a as y, E as _, b as S, c as k, P as h, d as M, e as P, f } from "./broadcast-DhcOJtcZ.js";
2
+ import { B as L, m as N, g as V, h as W, t as Y } from "./broadcast-DhcOJtcZ.js";
3
3
  import { Signal as i, Effect as c } from "@moq/signals";
4
4
  const B = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
5
  __proto__: null,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@moq/watch",
3
3
  "type": "module",
4
- "version": "0.1.1",
5
- "description": "Watch/subscribe to Media over QUIC streams",
4
+ "version": "0.2.0",
5
+ "description": "Watch Media over QUIC broadcasts",
6
6
  "license": "(MIT OR Apache-2.0)",
7
7
  "repository": "github:moq-dev/moq",
8
8
  "exports": {
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@moq/hang": "^0.2.0",
37
- "@moq/lite": "^0.1.3",
37
+ "@moq/lite": "^0.1.4",
38
38
  "@moq/signals": "^0.1.3",
39
39
  "@moq/ui-core": "^0.1.0"
40
40
  }