@moq/watch 0.2.13 → 0.2.15
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 +10 -9
- package/audio/source.d.ts.map +1 -1
- package/broadcast-jtLUfuyL.js +4291 -0
- package/broadcast-jtLUfuyL.js.map +1 -0
- package/broadcast.d.ts.map +1 -1
- package/dom-Yz3UT5ap.js +29 -0
- package/dom-Yz3UT5ap.js.map +1 -0
- package/element.js +162 -178
- package/element.js.map +1 -1
- package/index.d.ts +1 -3
- package/index.d.ts.map +1 -1
- package/index.js +5 -254
- package/libav-opus-af-CzuaKpJb.js +252 -0
- package/libav-opus-af-CzuaKpJb.js.map +1 -0
- package/main-bFFHfuX4.js +1999 -0
- package/main-bFFHfuX4.js.map +1 -0
- package/package.json +5 -4
- package/support/element.js +122 -172
- package/support/element.js.map +1 -1
- package/support/index.js +52 -53
- package/support/index.js.map +1 -1
- package/ui/element.js +335 -359
- package/ui/element.js.map +1 -1
- package/video/source.d.ts.map +1 -1
- package/broadcast-CLjMphZS.js +0 -5000
- package/broadcast-CLjMphZS.js.map +0 -1
- package/chat/index.d.ts +0 -17
- package/chat/index.d.ts.map +0 -1
- package/chat/message.d.ts +0 -16
- package/chat/message.d.ts.map +0 -1
- package/chat/typing.d.ts +0 -16
- package/chat/typing.d.ts.map +0 -1
- package/dom-BsFrLb_F.js +0 -35
- package/dom-BsFrLb_F.js.map +0 -1
- package/index.js.map +0 -1
- package/libav-opus-af-BlMWboA7.js +0 -368
- package/libav-opus-af-BlMWboA7.js.map +0 -1
- package/location/index.d.ts +0 -17
- package/location/index.d.ts.map +0 -1
- package/location/peers.d.ts +0 -16
- package/location/peers.d.ts.map +0 -1
- package/location/window.d.ts +0 -17
- package/location/window.d.ts.map +0 -1
- package/main-DGBFe0O7.js +0 -2301
- package/main-DGBFe0O7.js.map +0 -1
- package/preview.d.ts +0 -23
- package/preview.d.ts.map +0 -1
- package/user.d.ts +0 -17
- package/user.d.ts.map +0 -1
package/ui/element.js
CHANGED
|
@@ -1,382 +1,358 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { n as e, t } from "../dom-Yz3UT5ap.js";
|
|
2
|
+
import { Effect as n, Signal as r } from "@moq/signals";
|
|
3
|
+
//#region src/ui/components/buffer-control.ts
|
|
4
|
+
var i = 0, a = 10, o = 4e3, s = 48;
|
|
5
|
+
function c(e, t, n, r, i) {
|
|
6
|
+
let a = e.getContext("2d");
|
|
7
|
+
if (!a) return;
|
|
8
|
+
let o = window.devicePixelRatio || 1, s = e.getBoundingClientRect(), c = s.width, l = s.height, u = Math.round(c * o), d = Math.round(l * o);
|
|
9
|
+
if ((e.width !== u || e.height !== d) && (e.width = u, e.height = d), a.setTransform(o, 0, 0, o, 0, 0), a.clearRect(0, 0, c, l), n === void 0) return;
|
|
10
|
+
let f = l - 4;
|
|
11
|
+
for (let e = 0; e < t.length; e++) {
|
|
12
|
+
let o = t[e], s = o.start - n, u = o.end - n, d = Math.max(0, s), p = Math.min(u, r);
|
|
13
|
+
if (p <= d) continue;
|
|
14
|
+
let m = d / r * c, h = Math.max(2, (p - d) / r * c);
|
|
15
|
+
if (a.globalAlpha = .85, a.fillStyle = i ? "#f87171" : e > 0 ? "#facc15" : "#4ade80", typeof a.roundRect == "function" ? (a.beginPath(), a.roundRect(m, 2, h, f, 2), a.fill()) : a.fillRect(m, 2, h, f), u > r) {
|
|
16
|
+
let e = ((u - r) / 1e3).toFixed(1);
|
|
17
|
+
a.globalAlpha = .7, a.fillStyle = "black", a.font = "500 9px system-ui, sans-serif", a.textAlign = "right", a.textBaseline = "middle", a.fillText(`+${e}s`, m + h - 4, l / 2);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
S(l, t.backend.video.buffered.peek(), u, e, g), S(d, t.backend.audio.buffered.peek(), u, e, g), o.animate(N);
|
|
79
|
-
};
|
|
80
|
-
return o.animate(N), r;
|
|
21
|
+
function l(e, t, n = o) {
|
|
22
|
+
let r = document.createElement("div");
|
|
23
|
+
r.className = "buffer";
|
|
24
|
+
let l = document.createElement("div");
|
|
25
|
+
l.className = "buffer-visualization", l.setAttribute("role", "slider"), l.tabIndex = 0, l.setAttribute("aria-valuemin", i.toString()), l.setAttribute("aria-valuemax", n.toString()), l.setAttribute("aria-label", "Buffer jitter");
|
|
26
|
+
let u = document.createElement("div");
|
|
27
|
+
u.className = "buffer-playhead";
|
|
28
|
+
let d = document.createElement("div");
|
|
29
|
+
d.className = "buffer-track buffer-track--video";
|
|
30
|
+
let f = document.createElement("span");
|
|
31
|
+
f.className = "buffer-track-label", f.textContent = "Video";
|
|
32
|
+
let p = document.createElement("canvas");
|
|
33
|
+
p.className = "buffer-canvas", d.append(f, p);
|
|
34
|
+
let m = document.createElement("div");
|
|
35
|
+
m.className = "buffer-track buffer-track--audio";
|
|
36
|
+
let h = document.createElement("span");
|
|
37
|
+
h.className = "buffer-track-label", h.textContent = "Audio";
|
|
38
|
+
let g = document.createElement("canvas");
|
|
39
|
+
g.className = "buffer-canvas", m.append(h, g);
|
|
40
|
+
let _ = document.createElement("div");
|
|
41
|
+
_.className = "buffer-target-area";
|
|
42
|
+
let v = document.createElement("div");
|
|
43
|
+
v.className = "buffer-target-line";
|
|
44
|
+
let y = document.createElement("span");
|
|
45
|
+
y.className = "buffer-target-label", v.appendChild(y), _.appendChild(v);
|
|
46
|
+
let b = document.createElement("span");
|
|
47
|
+
b.className = "buffer-help", b.textContent = "click to change latency", l.append(u, d, m, _, b), r.appendChild(l);
|
|
48
|
+
let x = !1, S = !1;
|
|
49
|
+
e.run((e) => {
|
|
50
|
+
let r = e.get(t.backend.jitter), i = r / n * 100;
|
|
51
|
+
v.style.left = `${i}%`, y.textContent = `${Math.round(r)}ms`, l.setAttribute("aria-valuenow", r.toString());
|
|
52
|
+
});
|
|
53
|
+
let C = (e) => {
|
|
54
|
+
let r = l.getBoundingClientRect(), o = r.width - s, c = Math.max(0, Math.min(e - r.left - s, o)) / o * n, u = Math.round(c / a) * a, d = Math.max(i, Math.min(n, u));
|
|
55
|
+
t.backend.latency.set(d);
|
|
56
|
+
}, w = () => {
|
|
57
|
+
S || (S = !0, b.style.display = "none");
|
|
58
|
+
};
|
|
59
|
+
e.event(l, "mousedown", (e) => {
|
|
60
|
+
x = !0, l.classList.add("buffer-visualization--dragging"), w(), C(e.clientX);
|
|
61
|
+
}), e.event(document, "mousemove", (e) => {
|
|
62
|
+
x && C(e.clientX);
|
|
63
|
+
}), e.event(document, "mouseup", () => {
|
|
64
|
+
x && (x = !1, l.classList.remove("buffer-visualization--dragging"));
|
|
65
|
+
}), e.event(l, "keydown", (e) => {
|
|
66
|
+
let r = 0;
|
|
67
|
+
if (e.key === "ArrowRight" || e.key === "ArrowUp") r = a;
|
|
68
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowDown") r = -10;
|
|
69
|
+
else return;
|
|
70
|
+
e.preventDefault(), w();
|
|
71
|
+
let o = t.backend.jitter.peek(), s = Math.max(i, Math.min(n, o + r));
|
|
72
|
+
t.backend.latency.set(s);
|
|
73
|
+
});
|
|
74
|
+
let T = () => {
|
|
75
|
+
let r = t.backend.sync.now(), i = t.backend.video.stalled.peek();
|
|
76
|
+
c(p, t.backend.video.buffered.peek(), r, n, i), c(g, t.backend.audio.buffered.peek(), r, n, i), e.animate(T);
|
|
77
|
+
};
|
|
78
|
+
return e.animate(T), r;
|
|
81
79
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/ui/components/buffering-indicator.ts
|
|
82
|
+
function u(e, t) {
|
|
83
|
+
let n = document.createElement("div");
|
|
84
|
+
n.className = "buffering";
|
|
85
|
+
let r = document.createElement("div");
|
|
86
|
+
return r.className = "buffering-spinner", n.appendChild(r), e.run((e) => {
|
|
87
|
+
let r = e.get(t.backend.video.stalled), i = e.get(t.broadcast.status) === "offline";
|
|
88
|
+
n.style.display = r && !i ? "" : "none";
|
|
89
|
+
}), n;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<circle cx="6" cy="18"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<path d="M21 8V5a2 2 0 0 0-2-2h-3" />
|
|
100
|
-
<path d="M3 16v3a2 2 0 0 0 2 2h3" />
|
|
101
|
-
<path d="M16 21h3a2 2 0 0 0 2-2v-3" />
|
|
102
|
-
</svg>`, X = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
103
|
-
<path d="M8 3v3a2 2 0 0 1-2 2H3" />
|
|
104
|
-
<path d="M21 8h-3a2 2 0 0 1-2-2V3" />
|
|
105
|
-
<path d="M3 16h3a2 2 0 0 1 2 2v3" />
|
|
106
|
-
<path d="M16 21v-3a2 2 0 0 1 2-2h3" />
|
|
107
|
-
</svg>`, G = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
108
|
-
<path d="M16 9a5 5 0 0 1 .95 2.293" />
|
|
109
|
-
<path d="M19.364 5.636a9 9 0 0 1 1.889 9.96" />
|
|
110
|
-
<path d="m2 2 20 20" />
|
|
111
|
-
<path d="m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11" />
|
|
112
|
-
<path d="M9.828 4.172A.686.686 0 0 1 11 4.657v.686" />
|
|
113
|
-
</svg>`, Q = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
114
|
-
<path d="M16.247 7.761a6 6 0 0 1 0 8.478" />
|
|
115
|
-
<path d="M19.075 4.933a10 10 0 0 1 0 14.134" />
|
|
116
|
-
<path d="M4.925 19.067a10 10 0 0 1 0-14.134" />
|
|
117
|
-
<path d="M7.753 16.239a6 6 0 0 1 0-8.478" />
|
|
118
|
-
<circle cx="12" cy="12" r="2" />
|
|
119
|
-
</svg>`, J = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
120
|
-
<rect x="14" y="3" width="5" height="18" rx="1" />
|
|
121
|
-
<rect x="5" y="3" width="5" height="18" rx="1" />
|
|
122
|
-
</svg>`, K = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
123
|
-
<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />
|
|
124
|
-
</svg>`, Y = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
125
|
-
<path d="M5 21v-6" />
|
|
126
|
-
<path d="M12 21V3" />
|
|
127
|
-
<path d="M19 21V9" />
|
|
128
|
-
</svg>`, Z = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
129
|
-
<path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" />
|
|
130
|
-
<rect x="2" y="6" width="14" height="12" rx="2" />
|
|
131
|
-
</svg>`, tt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
132
|
-
<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
|
|
133
|
-
<path d="M16 9a5 5 0 0 1 0 6" />
|
|
134
|
-
<path d="M19.364 18.364a9 9 0 0 0 0-12.728" />
|
|
135
|
-
</svg>`, et = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
136
|
-
<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
|
|
137
|
-
</svg>`, at = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
138
|
-
<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
|
|
139
|
-
<path d="M16 9a5 5 0 0 1 0 6" />
|
|
140
|
-
</svg>`;
|
|
141
|
-
function M(o) {
|
|
142
|
-
const t = document.createElement("span");
|
|
143
|
-
return t.className = "flex-center", t.setAttribute("role", "img"), t.setAttribute("aria-hidden", "true"), t.innerHTML = o, t;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/ui/icons/audio.svg?raw
|
|
93
|
+
var d = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n</svg>", f = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" />\n</svg>", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n <path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n <path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n</svg>", m = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3v3a2 2 0 0 1-2 2H3\" />\n <path d=\"M21 8h-3a2 2 0 0 1-2-2V3\" />\n <path d=\"M3 16h3a2 2 0 0 1 2 2v3\" />\n <path d=\"M16 21v-3a2 2 0 0 1 2-2h3\" />\n</svg>", h = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16 9a5 5 0 0 1 .95 2.293\" />\n <path d=\"M19.364 5.636a9 9 0 0 1 1.889 9.96\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11\" />\n <path d=\"M9.828 4.172A.686.686 0 0 1 11 4.657v.686\" />\n</svg>", g = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16.247 7.761a6 6 0 0 1 0 8.478\" />\n <path d=\"M19.075 4.933a10 10 0 0 1 0 14.134\" />\n <path d=\"M4.925 19.067a10 10 0 0 1 0-14.134\" />\n <path d=\"M7.753 16.239a6 6 0 0 1 0-8.478\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n</svg>", _ = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n</svg>", v = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n</svg>", y = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" />\n</svg>", b = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n</svg>", x = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n <path d=\"M19.364 18.364a9 9 0 0 0 0-12.728\" />\n</svg>", S = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n</svg>", C = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n</svg>";
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/ui/icons.ts
|
|
96
|
+
function w(e) {
|
|
97
|
+
let t = document.createElement("span");
|
|
98
|
+
return t.className = "flex-center", t.setAttribute("role", "img"), t.setAttribute("aria-hidden", "true"), t.innerHTML = e, t;
|
|
144
99
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/ui/components/fullscreen-button.ts
|
|
102
|
+
function T(e, t) {
|
|
103
|
+
let n = document.createElement("button");
|
|
104
|
+
return n.type = "button", n.className = "button flex-center", n.title = "Fullscreen", n.setAttribute("aria-label", "Fullscreen"), n.replaceChildren(w(p)), e.event(document, "fullscreenchange", () => {
|
|
105
|
+
let e = !!document.fullscreenElement;
|
|
106
|
+
n.replaceChildren(w(e ? m : p));
|
|
107
|
+
}), e.event(n, "click", () => {
|
|
108
|
+
document.fullscreenElement ? document.exitFullscreen() : t.requestFullscreen();
|
|
109
|
+
}), n;
|
|
155
110
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/ui/components/offline-indicator.ts
|
|
113
|
+
function E(e, t) {
|
|
114
|
+
let n = document.createElement("div");
|
|
115
|
+
n.className = "watch-ui__offline-indicator", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite");
|
|
116
|
+
let r = document.createElement("span");
|
|
117
|
+
return r.className = "watch-ui__offline-text", r.textContent = "OFFLINE", n.appendChild(r), e.run((e) => {
|
|
118
|
+
let r = e.get(t.broadcast.status) === "offline";
|
|
119
|
+
n.style.display = r ? "" : "none";
|
|
120
|
+
}), n;
|
|
164
121
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/ui/components/play-pause.ts
|
|
124
|
+
function D(e, t) {
|
|
125
|
+
let n = document.createElement("button");
|
|
126
|
+
return n.type = "button", n.className = "button button--playback flex-center", e.run((e) => {
|
|
127
|
+
let r = e.get(t.backend.paused);
|
|
128
|
+
n.title = r ? "Play" : "Pause", n.setAttribute("aria-label", r ? "Play" : "Pause"), n.replaceChildren(w(r ? v : _));
|
|
129
|
+
}), e.event(n, "click", () => {
|
|
130
|
+
t.paused = !t.paused;
|
|
131
|
+
}), n;
|
|
173
132
|
}
|
|
174
|
-
|
|
175
|
-
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/ui/components/quality-selector.ts
|
|
135
|
+
function O(e) {
|
|
136
|
+
return e >= 1e6 ? `${(e / 1e6).toFixed(1)} Mbps` : e >= 1e3 ? `${(e / 1e3).toFixed(0)} kbps` : `${e} bps`;
|
|
176
137
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
138
|
+
function k(e, t) {
|
|
139
|
+
let n = document.createElement("div");
|
|
140
|
+
n.className = "quality-selector";
|
|
141
|
+
let r = document.createElement("label");
|
|
142
|
+
r.htmlFor = "moq-watch-quality-select", r.className = "quality-label", r.textContent = "Quality: ";
|
|
143
|
+
let i = document.createElement("select");
|
|
144
|
+
return i.id = "moq-watch-quality-select", i.className = "quality-select", n.append(r, i), e.run((e) => {
|
|
145
|
+
let n = e.get(t.backend.video.source.catalog), r = e.get(t.backend.video.source.track), a = n?.renditions ?? {};
|
|
146
|
+
i.replaceChildren();
|
|
147
|
+
let o = document.createElement("option");
|
|
148
|
+
o.value = "", o.textContent = "Auto", i.appendChild(o);
|
|
149
|
+
for (let [e, t] of Object.entries(a)) {
|
|
150
|
+
let n = document.createElement("option");
|
|
151
|
+
n.value = e, n.textContent = `${e}${t.codedWidth && t.codedHeight ? ` (${t.codedWidth}x${t.codedHeight})` : ""}${t.bitrate ? ` ${O(t.bitrate)}` : ""}`, i.appendChild(n);
|
|
152
|
+
}
|
|
153
|
+
i.value = r ?? "";
|
|
154
|
+
}), e.event(i, "change", () => {
|
|
155
|
+
let e = i.value || void 0;
|
|
156
|
+
t.backend.video.source.target.update((t) => ({
|
|
157
|
+
...t,
|
|
158
|
+
name: e
|
|
159
|
+
}));
|
|
160
|
+
}), n;
|
|
199
161
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/ui/components/stats-button.ts
|
|
164
|
+
function A(e, t) {
|
|
165
|
+
let n = document.createElement("button");
|
|
166
|
+
return n.type = "button", n.className = "button flex-center", n.replaceChildren(w(y)), e.run((e) => {
|
|
167
|
+
n.title = e.get(t) ? "Hide stats" : "Show stats", n.setAttribute("aria-label", n.title);
|
|
168
|
+
}), e.event(n, "click", () => {
|
|
169
|
+
t.update((e) => !e);
|
|
170
|
+
}), n;
|
|
208
171
|
}
|
|
209
|
-
|
|
210
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/ui/components/volume-slider.ts
|
|
174
|
+
function j(e, t) {
|
|
175
|
+
return t || e === 0 ? h : e <= 33 ? S : e <= 66 ? C : x;
|
|
211
176
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
177
|
+
function M(e, t) {
|
|
178
|
+
let n = document.createElement("div");
|
|
179
|
+
n.className = "volume-slider flex-center";
|
|
180
|
+
let r = document.createElement("button");
|
|
181
|
+
r.type = "button", r.className = "button flex-center";
|
|
182
|
+
let i = document.createElement("input");
|
|
183
|
+
i.type = "range", i.min = "0", i.max = "100";
|
|
184
|
+
let a = document.createElement("span");
|
|
185
|
+
return a.className = "volume-label", n.append(r, i, a), e.run((e) => {
|
|
186
|
+
let n = e.get(t.backend.audio.volume), o = e.get(t.backend.audio.muted), s = Math.round(n * 100);
|
|
187
|
+
i.value = s.toString(), a.textContent = s.toString(), r.title = o ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(w(j(s, o)));
|
|
188
|
+
}), e.event(i, "input", () => {
|
|
189
|
+
t.backend.audio.volume.set(Number.parseFloat(i.value) / 100);
|
|
190
|
+
}), e.event(r, "click", () => {
|
|
191
|
+
t.backend.audio.muted.update((e) => !e);
|
|
192
|
+
}), n;
|
|
228
193
|
}
|
|
229
|
-
|
|
230
|
-
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/ui/components/watch-status-indicator.ts
|
|
196
|
+
function N(e, t, n) {
|
|
197
|
+
return e ? t === "disconnected" ? {
|
|
198
|
+
variant: "error",
|
|
199
|
+
text: "Disconnected"
|
|
200
|
+
} : t === "connecting" ? {
|
|
201
|
+
variant: "connecting",
|
|
202
|
+
text: "Connecting..."
|
|
203
|
+
} : n === "offline" ? {
|
|
204
|
+
variant: "error",
|
|
205
|
+
text: "Offline"
|
|
206
|
+
} : n === "loading" ? {
|
|
207
|
+
variant: "loading",
|
|
208
|
+
text: "Loading..."
|
|
209
|
+
} : n === "live" ? {
|
|
210
|
+
variant: "live",
|
|
211
|
+
text: "Live"
|
|
212
|
+
} : {
|
|
213
|
+
variant: "connected",
|
|
214
|
+
text: "Connected"
|
|
215
|
+
} : {
|
|
216
|
+
variant: "error",
|
|
217
|
+
text: "No URL"
|
|
218
|
+
};
|
|
231
219
|
}
|
|
232
|
-
function
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
220
|
+
function P(e, t) {
|
|
221
|
+
let n = document.createElement("div");
|
|
222
|
+
n.className = "status-indicator flex-center";
|
|
223
|
+
let r = document.createElement("span"), i = document.createElement("span");
|
|
224
|
+
return n.append(r, i), e.run((e) => {
|
|
225
|
+
let { variant: n, text: a } = N(e.get(t.connection.url), e.get(t.connection.status), e.get(t.broadcast.status));
|
|
226
|
+
r.className = `status-indicator-dot status-indicator-dot--${n}`, i.className = `status-indicator-text status-indicator-text--${n}`, i.textContent = a;
|
|
227
|
+
}), n;
|
|
240
228
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/ui/stats.ts
|
|
231
|
+
var F = 250;
|
|
232
|
+
function I(e, n, r) {
|
|
233
|
+
let i = t("div", { className: `stats-item stats-item--${e}` }), a = t("div", { className: "stats-icon-wrapper" });
|
|
234
|
+
a.appendChild(w(r));
|
|
235
|
+
let o = t("span", { className: "stats-item-title" }, n), s = t("span", { className: "stats-item-data" }, "N/A"), c = t("div", { className: "stats-item-detail" });
|
|
236
|
+
return c.append(o, s), i.append(a, c), {
|
|
237
|
+
el: i,
|
|
238
|
+
data: s
|
|
239
|
+
};
|
|
247
240
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
241
|
+
function L(e) {
|
|
242
|
+
return e >= 1e6 ? `${(e / 1e6).toFixed(1)}Mbps` : e >= 1e3 ? `${(e / 1e3).toFixed(0)}kbps` : `${e.toFixed(0)}bps`;
|
|
250
243
|
}
|
|
251
|
-
function
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
244
|
+
function R(e, t) {
|
|
245
|
+
if (e === void 0 || e <= 0) return null;
|
|
246
|
+
let n = t === "down" ? "↓" : "↑";
|
|
247
|
+
return e >= 1e9 ? `${n} ${(e / 1e9).toFixed(1)}Gbps` : `${n} ${L(e)}`;
|
|
255
248
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}, $), e;
|
|
249
|
+
function z(e, t) {
|
|
250
|
+
let { el: n, data: r } = I("network", "network", g);
|
|
251
|
+
return e.interval(() => {
|
|
252
|
+
let e = t.connection.established.peek();
|
|
253
|
+
if (!e) {
|
|
254
|
+
r.textContent = "N/A";
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
let n = e.rtt?.peek(), i = [
|
|
258
|
+
R(e.recvBandwidth?.peek(), "down"),
|
|
259
|
+
R(e.sendBandwidth?.peek(), "up"),
|
|
260
|
+
n !== void 0 && n > 0 ? `${n.toFixed(0)}ms` : null
|
|
261
|
+
].filter((e) => e !== null);
|
|
262
|
+
r.textContent = i.length > 0 ? i.join("\n") : "N/A";
|
|
263
|
+
}, F), n;
|
|
272
264
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
].join(`
|
|
295
|
-
`);
|
|
296
|
-
}, $), e;
|
|
265
|
+
function B(e, t) {
|
|
266
|
+
let { el: n, data: r } = I("video", "video", b), i = 0, a = 0, o = performance.now();
|
|
267
|
+
return e.interval(() => {
|
|
268
|
+
let e = t.backend.video.source.catalog.peek(), n = t.backend.video.stats.peek(), s = performance.now(), c = s - o, l;
|
|
269
|
+
if (n && i > 0 && c > 0) {
|
|
270
|
+
let e = n.frameCount - i;
|
|
271
|
+
e > 0 && (l = e / (c / 1e3));
|
|
272
|
+
}
|
|
273
|
+
let u;
|
|
274
|
+
if (n && a > 0 && c > 0) {
|
|
275
|
+
let e = n.bytesReceived - a;
|
|
276
|
+
e > 0 && (u = L(e * 8 * (1e3 / c)));
|
|
277
|
+
}
|
|
278
|
+
n && (i = n.frameCount, a = n.bytesReceived, o = s);
|
|
279
|
+
let { width: d, height: f } = e?.display ?? {};
|
|
280
|
+
r.textContent = [
|
|
281
|
+
d && f ? `${d}x${f}` : "N/A",
|
|
282
|
+
l === void 0 ? "N/A" : `@${l.toFixed(1)} fps`,
|
|
283
|
+
u ?? "N/A"
|
|
284
|
+
].join("\n");
|
|
285
|
+
}, F), n;
|
|
297
286
|
}
|
|
298
|
-
function
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
s.sampleRate && d.push(`${(s.sampleRate / 1e3).toFixed(1)}kHz`), s.numberOfChannels && d.push(`${s.numberOfChannels}ch`), d.push(p ?? "N/A"), s.codec && d.push(s.codec), r.textContent = d.length > 0 ? d.join(`
|
|
316
|
-
`) : "N/A";
|
|
317
|
-
}, $), e;
|
|
287
|
+
function V(e, t) {
|
|
288
|
+
let { el: n, data: r } = I("audio", "audio", d), i = 0, a = performance.now();
|
|
289
|
+
return e.interval(() => {
|
|
290
|
+
let e = t.backend.audio.source.track.peek(), n = t.backend.audio.source.config.peek(), o = t.backend.audio.stats.peek();
|
|
291
|
+
if (!e || !n) {
|
|
292
|
+
r.textContent = "N/A";
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
let s = performance.now(), c;
|
|
296
|
+
if (o && i > 0) {
|
|
297
|
+
let e = o.bytesReceived - i, t = s - a;
|
|
298
|
+
e > 0 && t > 0 && (c = L(e * 8 * (1e3 / t)));
|
|
299
|
+
}
|
|
300
|
+
o && (i = o.bytesReceived, a = s);
|
|
301
|
+
let l = [];
|
|
302
|
+
n.sampleRate && l.push(`${(n.sampleRate / 1e3).toFixed(1)}kHz`), n.numberOfChannels && l.push(`${n.numberOfChannels}ch`), l.push(c ?? "N/A"), n.codec && l.push(n.codec), r.textContent = l.length > 0 ? l.join("\n") : "N/A";
|
|
303
|
+
}, F), n;
|
|
318
304
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
305
|
+
function H(e, t) {
|
|
306
|
+
let { el: n, data: r } = I("buffer", "buffer", f);
|
|
307
|
+
return e.run((e) => {
|
|
308
|
+
let n = e.get(t.backend.jitter);
|
|
309
|
+
r.textContent = `${Math.round(n)}ms`;
|
|
310
|
+
}), n;
|
|
325
311
|
}
|
|
326
|
-
function
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
312
|
+
function U(n, r, i) {
|
|
313
|
+
let a = t("div", { className: "stats" }), o = t("div", { className: "stats-panel" });
|
|
314
|
+
return a.appendChild(o), n.run((t) => {
|
|
315
|
+
let n = t.get(i);
|
|
316
|
+
a.style.display = n ? "" : "none", n && (e(t, o, z(t, r)), e(t, o, B(t, r)), e(t, o, V(t, r)), e(t, o, H(t, r)));
|
|
317
|
+
}), a;
|
|
332
318
|
}
|
|
333
|
-
const bt = ':host{--color-white: #ffffff;--color-white-alpha-05: rgba(255, 255, 255, .05);--color-white-alpha-10: rgba(255, 255, 255, .1);--color-white-alpha-15: rgba(255, 255, 255, .15);--color-white-alpha-20: rgba(255, 255, 255, .2);--color-white-alpha-25: rgba(255, 255, 255, .25);--color-white-alpha-30: rgba(255, 255, 255, .3);--color-white-alpha-40: rgba(255, 255, 255, .4);--color-white-alpha-70: rgba(255, 255, 255, .7);--color-white-alpha-90: rgba(255, 255, 255, .9);--color-gray-100: #9ca3af;--color-gray-950: #1a1a1a;--color-blue-400: #00dfff;--color-blue-500: #52a1ff;--color-blue-900: #1b3243;--color-purple-400: #a855f7;--color-purple-900: #31144a;--color-green-400: #65ee2e;--color-green-900: #3d4928;--color-yellow-400: #facc15;--color-orange-400: #ff9900;--color-orange-450: #fb923c;--color-orange-500: #f97316;--color-orange-900: #4d301b;--color-amber-600: #d97706;--color-orange-500-alpha-60: rgba(249, 115, 22, .6);--color-orange-500-alpha-80: rgba(249, 115, 22, .8);--color-black-alpha-08: rgba(0, 0, 0, .08);--color-black-alpha-10: rgba(0, 0, 0, .1);--color-black-alpha-40: rgba(0, 0, 0, .4);--color-black-alpha-85: rgba(0, 0, 0, .85);--spacing-1: .0625rem;--spacing-2: .125rem;--spacing-4: .25rem;--spacing-8: .5rem;--spacing-12: .75rem;--spacing-16: 1rem;--spacing-24: 1.5rem;--spacing-32: 2rem;--spacing-48: 3rem;--border-radius-sm: .5rem;--border-radius-md: .75rem;--border-radius-lg: 1rem}.flex-center{display:flex;justify-content:center;align-items:center}.flex-align-center{align-items:center}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);border-radius:50%;width:2.25rem;height:2.25rem;transform-origin:center;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){transform:scale(1.02);background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10)}.button:active:not(:disabled){transform:scale(.98);box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-08)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;pointer-events:none;z-index:2;width:100%;height:inherit;container-type:inline-size}.stats .stats-panel{position:absolute;display:flex;align-items:flex-start;justify-content:center;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-12);max-width:240px;width:100%;background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);border-radius:8px;padding:var(--spacing-12);pointer-events:auto;top:8px}@container (width > 480px) and (width <= 768px){.stats .stats-panel{max-width:360px;padding:var(--spacing-24)}}@container (width > 768px){.stats .stats-panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats-panel .stats-item{display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:row;height:auto;column-gap:var(--spacing-8);flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1}@container (width > 480px){.stats .stats-panel .stats-item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats-panel .stats-item .stats-icon-wrapper{display:none;padding:var(--spacing-8);border-radius:8px;width:fit-content;height:fit-content;flex-shrink:0}@container (width > 480px){.stats .stats-panel .stats-item .stats-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-direction:row}}.stats .stats-panel .stats-item .stats-icon-wrapper svg{width:100%;height:100%}.stats .stats-panel .stats-item.stats-item--network .stats-icon-wrapper{background-color:var(--color-blue-900)}.stats .stats-panel .stats-item.stats-item--network,.stats .stats-panel .stats-item.stats-item--network .stats-item-data{color:var(--color-blue-400)}.stats .stats-panel .stats-item.stats-item--video .stats-icon-wrapper{background-color:var(--color-purple-900)}.stats .stats-panel .stats-item.stats-item--video,.stats .stats-panel .stats-item.stats-item--video .stats-item-data{color:var(--color-purple-400)}.stats .stats-panel .stats-item.stats-item--audio .stats-icon-wrapper{background-color:var(--color-green-900)}.stats .stats-panel .stats-item.stats-item--audio,.stats .stats-panel .stats-item.stats-item--audio .stats-item-data{color:var(--color-green-400)}.stats .stats-panel .stats-item.stats-item--buffer .stats-icon-wrapper{background-color:var(--color-orange-900)}.stats .stats-panel .stats-item.stats-item--buffer,.stats .stats-panel .stats-item.stats-item--buffer .stats-item-data{color:var(--color-orange-400)}.stats .stats-panel .stats-item .stats-item-detail{display:flex;align-items:flex-start;justify-content:space-evenly;flex-direction:column;gap:var(--spacing-4)}.stats .stats-panel .stats-item .stats-item-detail .stats-item-title{font-size:12px;font-weight:500;text-transform:capitalize;color:var(--color-gray-100);font-family:Segoe UI,Roboto,sans-serif;letter-spacing:1px;line-height:12px}.stats .stats-panel .stats-item .stats-item-detail .stats-item-data{font-size:16px;font-weight:700;font-family:Segoe UI,Roboto,sans-serif;white-space:pre-wrap;line-height:1.5}.video-container{display:block;position:relative;width:100%;height:auto;border-radius:var(--spacing-4);margin:0 auto;pointer-events:none}.controls{display:flex;flex-direction:column;gap:var(--spacing-24)}.button.button--playback{width:3rem;height:3rem;background:linear-gradient(to bottom right,var(--color-orange-400),var(--color-orange-500),var(--color-amber-600));box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,var(--color-white-alpha-30),transparent);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1);pointer-events:none}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:"";position:absolute;inset:0;background-color:var(--color-white-alpha-20);border-radius:50%;filter:blur(var(--spacing-24));pointer-events:none}.playback-controls{display:flex;place-content:center space-around;gap:var(--spacing-8);padding:var(--spacing-8) 0}.latency-controls{display:flex;flex-direction:column;gap:var(--spacing-16)}.volume-slider{gap:var(--spacing-4)}.volume-label{width:var(--spacing-16);text-align:right}.quality-selector{display:flex;align-items:center;gap:var(--spacing-8);background:transparent;border-radius:var(--spacing-8)}.quality-label{font-size:1.25rem;font-weight:500;color:var(--color-white);white-space:nowrap}.quality-select{flex:0 1 auto;font-size:1rem;padding:var(--spacing-8);border-radius:var(--spacing-4);background:var(--color-white-alpha-10);color:var(--color-white);border:var(--spacing-1) solid var(--color-white-alpha-20);cursor:pointer;transition:background .2s ease}.quality-select:hover{background:var(--color-white-alpha-15)}.quality-select:focus{outline:var(--spacing-2) solid var(--color-white-alpha-30);outline-offset:var(--spacing-2)}.quality-select option{background:var(--color-gray-950);color:var(--color-white)}.buffer{width:100%}.buffer-visualization{position:relative;width:100%;height:3.75rem;background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;padding-left:var(--spacing-48);box-sizing:border-box}.buffer-playhead{position:absolute;left:var(--spacing-48);top:0;bottom:0;width:var(--spacing-2);background:var(--color-white);z-index:3}.buffer-track{display:flex;align-items:center;position:absolute;left:var(--spacing-48);right:0;height:var(--spacing-24)}.buffer-track--video{top:var(--spacing-4)}.buffer-track--audio{top:var(--spacing-32)}.buffer-track-label{position:absolute;left:-2.875rem;width:2.5rem;font-size:.625rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box}.buffer-canvas{position:absolute;top:0;left:0;width:100%;height:100%}.buffer-target-area{position:absolute;top:0;bottom:0;left:var(--spacing-48);right:0;pointer-events:none}.buffer-target-line{position:absolute;top:0;bottom:0;width:.1875rem;background:var(--color-orange-400, var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto}.buffer-target-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font-size:.6875rem;font-weight:500;color:var(--color-orange-400, var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;transition:opacity .15s ease;pointer-events:none}.buffer-visualization:hover .buffer-target-label,.buffer-visualization--dragging .buffer-target-label{opacity:1}.buffer-help{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.75rem;color:var(--color-white-alpha-30, rgba(255, 255, 255, .3));pointer-events:none;white-space:nowrap}.buffering{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;top:0;left:0;z-index:1;background-color:var(--color-black-alpha-40);backdrop-filter:blur(var(--spacing-2));pointer-events:auto}.buffering-spinner{width:2.5rem;height:2.5rem;border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;animation:buffer-spin 1s linear infinite}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__offline-indicator{position:absolute;bottom:1rem;right:1rem;padding:.5rem 1rem;display:flex;align-items:center;justify-content:center;background-color:#000;z-index:4;pointer-events:auto;border-radius:.25rem}.watch-ui__offline-text{font-size:.875rem;font-weight:700;color:#fff;letter-spacing:.08em;text-shadow:none}@media(max-width:768px){.watch-ui__offline-indicator{bottom:.75rem;right:.75rem;padding:.375rem .75rem}.watch-ui__offline-text{font-size:.75rem}}@media(max-width:480px){.watch-ui__offline-indicator{bottom:.5rem;right:.5rem;padding:.25rem .5rem}.watch-ui__offline-text{font-size:.75rem}}.status-indicator{gap:var(--spacing-12);backdrop-filter:blur(var(--spacing-16))}.status-indicator-dot{position:relative;width:.75rem;height:.75rem;border-radius:50%;flex-shrink:0;z-index:1}.status-indicator-dot:after{content:"";position:absolute;inset:0;border-radius:50%;background:currentcolor;transform:scale(1);opacity:.5;animation:status-pulse 1.5s ease-out infinite;z-index:-1}.status-indicator-dot:after{display:none}.status-indicator-dot--live:after,.status-indicator-dot--connected:after,.status-indicator-dot--loading:after,.status-indicator-dot--connecting:after{display:block}.status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.status-indicator-text--error{color:var(--color-gray-100)}.status-indicator-dot--connecting{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--connecting{color:var(--color-yellow-400)}.status-indicator-dot--loading{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--loading{color:var(--color-yellow-400)}.status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.status-indicator-text--live{color:var(--color-green-400)}.status-indicator-dot--connected{background:var(--color-blue-500);color:var(--color-blue-500)}.status-indicator-text--connected{color:var(--color-blue-500)}.status-indicator-text{font-size:1rem;letter-spacing:.1rem}@keyframes status-pulse{0%{transform:scale(1);opacity:.5}70%{opacity:.25}to{transform:scale(2.5);opacity:0}}';
|
|
334
|
-
|
|
335
|
-
#e;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
i.append(
|
|
368
|
-
rt(t, e),
|
|
369
|
-
dt(t, e),
|
|
370
|
-
pt(t, e),
|
|
371
|
-
lt(t, r),
|
|
372
|
-
ot(t, e)
|
|
373
|
-
);
|
|
374
|
-
const s = v("div", { className: "latency-controls" });
|
|
375
|
-
s.append(V(t, e), st(t, e)), n.append(i, s), C(t, this.#t, a), C(t, this.#t, n);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
customElements.define("moq-watch-ui", wt);
|
|
379
|
-
export {
|
|
380
|
-
wt as default
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/ui/styles/index.css?inline
|
|
321
|
+
var W = ":host{--color-white:#fff;--color-white-alpha-05:#ffffff0d;--color-white-alpha-10:#ffffff1a;--color-white-alpha-15:#ffffff26;--color-white-alpha-20:#fff3;--color-white-alpha-25:#ffffff40;--color-white-alpha-30:#ffffff4d;--color-white-alpha-40:#fff6;--color-white-alpha-70:#ffffffb3;--color-white-alpha-90:#ffffffe6;--color-gray-100:#9ca3af;--color-gray-950:#1a1a1a;--color-blue-400:#00dfff;--color-blue-500:#52a1ff;--color-blue-900:#1b3243;--color-purple-400:#a855f7;--color-purple-900:#31144a;--color-green-400:#65ee2e;--color-green-900:#3d4928;--color-yellow-400:#facc15;--color-orange-400:#f90;--color-orange-450:#fb923c;--color-orange-500:#f97316;--color-orange-900:#4d301b;--color-amber-600:#d97706;--color-orange-500-alpha-60:#f9731699;--color-orange-500-alpha-80:#f97316cc;--color-black-alpha-08:#00000014;--color-black-alpha-10:#0000001a;--color-black-alpha-40:#0006;--color-black-alpha-85:#000000d9;--spacing-1:.0625rem;--spacing-2:.125rem;--spacing-4:.25rem;--spacing-8:.5rem;--spacing-12:.75rem;--spacing-16:1rem;--spacing-24:1.5rem;--spacing-32:2rem;--spacing-48:3rem;--border-radius-sm:.5rem;--border-radius-md:.75rem;--border-radius-lg:1rem}.flex-center{justify-content:center;align-items:center;display:flex}.flex-align-center{align-items:center}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);transform-origin:50%;border-radius:50%;width:2.25rem;height:2.25rem;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10);transform:scale(1.02)}.button:active:not(:disabled){box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-08);transform:scale(.98)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{pointer-events:none;z-index:2;width:100%;height:inherit;justify-content:center;align-items:center;display:flex;position:absolute;inset:0;container-type:inline-size}.stats .stats-panel{justify-content:center;align-items:flex-start;gap:var(--spacing-12);background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);width:100%;max-width:240px;padding:var(--spacing-12);pointer-events:auto;border-radius:8px;flex-flow:wrap;display:flex;position:absolute;top:8px}@container (width>480px) and (width<=768px){.stats .stats-panel{max-width:360px;padding:var(--spacing-24)}}@container (width>768px){.stats .stats-panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats-panel .stats-item{justify-content:flex-start;align-items:flex-start;column-gap:var(--spacing-8);flex-direction:row;flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1;height:auto;display:flex}@container (width>480px){.stats .stats-panel .stats-item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats-panel .stats-item .stats-icon-wrapper{padding:var(--spacing-8);border-radius:8px;flex-shrink:0;width:fit-content;height:fit-content;display:none}@container (width>480px){.stats .stats-panel .stats-item .stats-icon-wrapper{flex-direction:row;justify-content:center;align-items:center;width:24px;height:24px;display:flex}}.stats .stats-panel .stats-item .stats-icon-wrapper svg{width:100%;height:100%}.stats .stats-panel .stats-item.stats-item--network .stats-icon-wrapper{background-color:var(--color-blue-900)}.stats .stats-panel .stats-item.stats-item--network,.stats .stats-panel .stats-item.stats-item--network .stats-item-data{color:var(--color-blue-400)}.stats .stats-panel .stats-item.stats-item--video .stats-icon-wrapper{background-color:var(--color-purple-900)}.stats .stats-panel .stats-item.stats-item--video,.stats .stats-panel .stats-item.stats-item--video .stats-item-data{color:var(--color-purple-400)}.stats .stats-panel .stats-item.stats-item--audio .stats-icon-wrapper{background-color:var(--color-green-900)}.stats .stats-panel .stats-item.stats-item--audio,.stats .stats-panel .stats-item.stats-item--audio .stats-item-data{color:var(--color-green-400)}.stats .stats-panel .stats-item.stats-item--buffer .stats-icon-wrapper{background-color:var(--color-orange-900)}.stats .stats-panel .stats-item.stats-item--buffer,.stats .stats-panel .stats-item.stats-item--buffer .stats-item-data{color:var(--color-orange-400)}.stats .stats-panel .stats-item .stats-item-detail{justify-content:space-evenly;align-items:flex-start;gap:var(--spacing-4);flex-direction:column;display:flex}.stats .stats-panel .stats-item .stats-item-detail .stats-item-title{text-transform:capitalize;color:var(--color-gray-100);letter-spacing:1px;font-family:Segoe UI,Roboto,sans-serif;font-size:12px;font-weight:500;line-height:12px}.stats .stats-panel .stats-item .stats-item-detail .stats-item-data{white-space:pre-wrap;font-family:Segoe UI,Roboto,sans-serif;font-size:16px;font-weight:700;line-height:1.5}.video-container{border-radius:var(--spacing-4);pointer-events:none;width:100%;height:auto;margin:0 auto;display:block;position:relative}.controls{gap:var(--spacing-24);flex-direction:column;display:flex}.button.button--playback{background:linear-gradient(to bottom right, var(--color-orange-400), var(--color-orange-500), var(--color-amber-600));width:3rem;height:3rem;box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:\"\";background:linear-gradient(to bottom right, var(--color-white-alpha-30), transparent);opacity:0;pointer-events:none;transition:opacity .15s cubic-bezier(.4,0,.2,1);position:absolute;inset:0}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:\"\";background-color:var(--color-white-alpha-20);filter:blur(var(--spacing-24));pointer-events:none;border-radius:50%;position:absolute;inset:0}.playback-controls{place-content:center space-around;gap:var(--spacing-8);padding:var(--spacing-8) 0;display:flex}.latency-controls{gap:var(--spacing-16);flex-direction:column;display:flex}.volume-slider{gap:var(--spacing-4)}.volume-label{width:var(--spacing-16);text-align:right}.quality-selector{align-items:center;gap:var(--spacing-8);border-radius:var(--spacing-8);background:0 0;display:flex}.quality-label{color:var(--color-white);white-space:nowrap;font-size:1.25rem;font-weight:500}.quality-select{padding:var(--spacing-8);border-radius:var(--spacing-4);background:var(--color-white-alpha-10);color:var(--color-white);border:var(--spacing-1) solid var(--color-white-alpha-20);cursor:pointer;flex:0 auto;font-size:1rem;transition:background .2s}.quality-select:hover{background:var(--color-white-alpha-15)}.quality-select:focus{outline:var(--spacing-2) solid var(--color-white-alpha-30);outline-offset:var(--spacing-2)}.quality-select option{background:var(--color-gray-950);color:var(--color-white)}.buffer{width:100%}.buffer-visualization{background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;width:100%;height:3.75rem;padding-left:var(--spacing-48);box-sizing:border-box;position:relative}.buffer-playhead{left:var(--spacing-48);width:var(--spacing-2);background:var(--color-white);z-index:3;position:absolute;top:0;bottom:0}.buffer-track{left:var(--spacing-48);height:var(--spacing-24);align-items:center;display:flex;position:absolute;right:0}.buffer-track--video{top:var(--spacing-4)}.buffer-track--audio{top:var(--spacing-32)}.buffer-track-label{width:2.5rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box;font-size:.625rem;position:absolute;left:-2.875rem}.buffer-canvas{width:100%;height:100%;position:absolute;top:0;left:0}.buffer-target-area{top:0;bottom:0;left:var(--spacing-48);pointer-events:none;position:absolute;right:0}.buffer-target-line{background:var(--color-orange-400,var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto;width:.1875rem;position:absolute;top:0;bottom:0}.buffer-target-label{color:var(--color-orange-400,var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;pointer-events:none;font-size:.6875rem;font-weight:500;transition:opacity .15s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.buffer-visualization:hover .buffer-target-label,.buffer-visualization--dragging .buffer-target-label{opacity:1}.buffer-help{color:var(--color-white-alpha-30,#ffffff4d);pointer-events:none;white-space:nowrap;font-size:.75rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.buffering{z-index:1;background-color:var(--color-black-alpha-40);width:100%;height:100%;backdrop-filter:blur(var(--spacing-2));pointer-events:auto;justify-content:center;align-items:center;display:flex;position:absolute;top:0;left:0}.buffering-spinner{border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;width:2.5rem;height:2.5rem;animation:1s linear infinite buffer-spin}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__offline-indicator{z-index:4;pointer-events:auto;background-color:#000;border-radius:.25rem;justify-content:center;align-items:center;padding:.5rem 1rem;display:flex;position:absolute;bottom:1rem;right:1rem}.watch-ui__offline-text{color:#fff;letter-spacing:.08em;text-shadow:none;font-size:.875rem;font-weight:700}@media (width<=768px){.watch-ui__offline-indicator{padding:.375rem .75rem;bottom:.75rem;right:.75rem}.watch-ui__offline-text{font-size:.75rem}}@media (width<=480px){.watch-ui__offline-indicator{padding:.25rem .5rem;bottom:.5rem;right:.5rem}.watch-ui__offline-text{font-size:.75rem}}.status-indicator{gap:var(--spacing-12);backdrop-filter:blur(var(--spacing-16))}.status-indicator-dot{z-index:1;border-radius:50%;flex-shrink:0;width:.75rem;height:.75rem;position:relative}.status-indicator-dot:after{content:\"\";opacity:.5;z-index:-1;background:currentColor;border-radius:50%;animation:1.5s ease-out infinite status-pulse;display:none;position:absolute;inset:0;transform:scale(1)}.status-indicator-dot--live:after,.status-indicator-dot--connected:after,.status-indicator-dot--loading:after,.status-indicator-dot--connecting:after{display:block}.status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.status-indicator-text--error{color:var(--color-gray-100)}.status-indicator-dot--connecting{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--connecting{color:var(--color-yellow-400)}.status-indicator-dot--loading{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--loading{color:var(--color-yellow-400)}.status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.status-indicator-text--live{color:var(--color-green-400)}.status-indicator-dot--connected{background:var(--color-blue-500);color:var(--color-blue-500)}.status-indicator-text--connected{color:var(--color-blue-500)}.status-indicator-text{letter-spacing:.1rem;font-size:1rem}@keyframes status-pulse{0%{opacity:.5;transform:scale(1)}70%{opacity:.25}to{opacity:0;transform:scale(2.5)}}", G = class extends HTMLElement {
|
|
322
|
+
#e;
|
|
323
|
+
#t;
|
|
324
|
+
#n = new r(void 0);
|
|
325
|
+
#r;
|
|
326
|
+
constructor() {
|
|
327
|
+
super(), this.#t = this.attachShadow({ mode: "open" });
|
|
328
|
+
let e = document.createElement("style");
|
|
329
|
+
e.textContent = W, this.#t.appendChild(e), this.#r = new MutationObserver(() => this.#i());
|
|
330
|
+
}
|
|
331
|
+
connectedCallback() {
|
|
332
|
+
this.#i(), this.#r.observe(this, { childList: !0 });
|
|
333
|
+
let e = new n();
|
|
334
|
+
this.#e = e, e.run(this.#a.bind(this));
|
|
335
|
+
}
|
|
336
|
+
disconnectedCallback() {
|
|
337
|
+
this.#r.disconnect(), this.#e?.close(), this.#e = void 0;
|
|
338
|
+
}
|
|
339
|
+
#i() {
|
|
340
|
+
let e = this.querySelector("moq-watch");
|
|
341
|
+
this.#n.set(e ?? void 0);
|
|
342
|
+
}
|
|
343
|
+
#a(n) {
|
|
344
|
+
let i = n.get(this.#n);
|
|
345
|
+
if (!i) return;
|
|
346
|
+
let a = new r(!1), o = t("div", { className: "video-container" });
|
|
347
|
+
o.append(t("slot"), U(n, i, a), u(n, i), E(n, i));
|
|
348
|
+
let s = t("div", { className: "controls" }), c = t("div", { className: "playback-controls flex-align-center" });
|
|
349
|
+
c.append(D(n, i), M(n, i), P(n, i), A(n, a), T(n, i));
|
|
350
|
+
let d = t("div", { className: "latency-controls" });
|
|
351
|
+
d.append(l(n, i), k(n, i)), s.append(c, d), e(n, this.#t, o), e(n, this.#t, s);
|
|
352
|
+
}
|
|
381
353
|
};
|
|
382
|
-
|
|
354
|
+
customElements.define("moq-watch-ui", G);
|
|
355
|
+
//#endregion
|
|
356
|
+
export { G as default };
|
|
357
|
+
|
|
358
|
+
//# sourceMappingURL=element.js.map
|