@moq/watch 0.3.1 → 0.4.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 +1 -2
- package/audio/decoder.d.ts +25 -15
- package/audio/decoder.d.ts.map +1 -1
- package/audio/emitter.d.ts +13 -10
- package/audio/emitter.d.ts.map +1 -1
- package/audio/index.d.ts +0 -2
- package/audio/index.d.ts.map +1 -1
- package/audio/source.d.ts +21 -17
- package/audio/source.d.ts.map +1 -1
- package/audio/unlock.d.ts +20 -0
- package/audio/unlock.d.ts.map +1 -0
- package/audio/unlock.test.d.ts +2 -0
- package/audio/unlock.test.d.ts.map +1 -0
- package/broadcast.d.ts +27 -57
- package/broadcast.d.ts.map +1 -1
- package/element.d.ts +42 -12
- package/element.d.ts.map +1 -1
- package/element.js +146 -90
- package/element.js.map +1 -1
- package/index.d.ts +9 -6
- package/index.d.ts.map +1 -1
- package/index.js +24 -5
- package/index.js.map +1 -0
- package/package.json +5 -6
- package/source-CWtgjSC_.js +1359 -0
- package/source-CWtgjSC_.js.map +1 -0
- package/support/element.d.ts.map +1 -1
- package/support/element.js.map +1 -1
- package/support/index.d.ts +3 -3
- package/support/index.d.ts.map +1 -1
- package/support/index.js +18 -17
- package/support/index.js.map +1 -1
- package/sync-zdwVEj9u.js +129 -0
- package/sync-zdwVEj9u.js.map +1 -0
- package/sync.d.ts +19 -18
- package/sync.d.ts.map +1 -1
- package/ui/components/buffer-control.d.ts +1 -1
- package/ui/components/buffer-control.d.ts.map +1 -1
- package/ui/components/fullscreen-button.d.ts +1 -2
- package/ui/components/fullscreen-button.d.ts.map +1 -1
- package/ui/components/play-pause.d.ts +1 -1
- package/ui/components/play-pause.d.ts.map +1 -1
- package/ui/element.d.ts.map +1 -1
- package/ui/element.js +269 -265
- package/ui/element.js.map +1 -1
- package/ui/fullscreen.d.ts +1 -2
- package/ui/fullscreen.d.ts.map +1 -1
- package/video/decoder.d.ts +32 -16
- package/video/decoder.d.ts.map +1 -1
- package/video/index.d.ts +0 -2
- package/video/index.d.ts.map +1 -1
- package/video/renderer.d.ts +14 -17
- package/video/renderer.d.ts.map +1 -1
- package/video/source.d.ts +23 -20
- package/video/source.d.ts.map +1 -1
- package/audio/backend.d.ts +0 -26
- package/audio/backend.d.ts.map +0 -1
- package/audio/mse.d.ts +0 -22
- package/audio/mse.d.ts.map +0 -1
- package/backend.d.ts +0 -65
- package/backend.d.ts.map +0 -1
- package/broadcast-C2qofUBv.js +0 -1701
- package/broadcast-C2qofUBv.js.map +0 -1
- package/buffered.d.ts +0 -19
- package/buffered.d.ts.map +0 -1
- package/mse.d.ts +0 -19
- package/mse.d.ts.map +0 -1
- package/sync-D67IxmxJ.js +0 -128
- package/sync-D67IxmxJ.js.map +0 -1
- package/video/backend.d.ts +0 -25
- package/video/backend.d.ts.map +0 -1
- package/video/mse.d.ts +0 -23
- package/video/mse.d.ts.map +0 -1
package/ui/element.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { n as e } from "../sync-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { n as e } from "../sync-zdwVEj9u.js";
|
|
2
|
+
import * as t from "@moq/net";
|
|
3
|
+
import { Effect as n, Signal as r } from "@moq/signals";
|
|
4
|
+
import * as i from "@moq/signals/dom";
|
|
4
5
|
//#region src/ui/components/buffering-indicator.ts
|
|
5
|
-
function
|
|
6
|
+
function a(e, t) {
|
|
6
7
|
let n = document.createElement("div");
|
|
7
8
|
n.className = "buffering";
|
|
8
9
|
let r = document.createElement("div");
|
|
9
10
|
return r.className = "buffering-spinner", n.appendChild(r), e.run((e) => {
|
|
10
|
-
let r = e.get(t.
|
|
11
|
+
let r = e.get(t.video.out.stalled), i = e.get(t.broadcast.out.status) === "offline", a = e.get(t.video.source.out.error) === "unsupported";
|
|
11
12
|
n.style.display = r && !i && !a ? "" : "none";
|
|
12
13
|
}), n;
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/ui/icons/audio.svg?raw
|
|
16
|
-
var
|
|
17
|
+
var o = "<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>", s = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 6 9 17l-5-5\" />\n</svg>\n", c = "<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=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n</svg>\n", l = "<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>", u = "<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>", 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=\"m12 14 4-4\" />\n <path d=\"M3.34 19a10 10 0 1 1 17.32 0\" />\n</svg>\n", f = "<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>", 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=\"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>", m = "<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>", 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=\"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>", 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 <line x1=\"21\" x2=\"14\" y1=\"4\" y2=\"4\" />\n <line x1=\"10\" x2=\"3\" y1=\"4\" y2=\"4\" />\n <line x1=\"21\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"8\" x2=\"3\" y1=\"12\" y2=\"12\" />\n <line x1=\"21\" x2=\"16\" y1=\"20\" y2=\"20\" />\n <line x1=\"12\" x2=\"3\" y1=\"20\" y2=\"20\" />\n <line x1=\"14\" x2=\"14\" y1=\"2\" y2=\"6\" />\n <line x1=\"8\" x2=\"8\" y1=\"10\" y2=\"14\" />\n <line x1=\"16\" x2=\"16\" y1=\"18\" y2=\"22\" />\n</svg>\n", _ = "<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>", v = "<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>", y = "<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>", b = "<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>", 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</svg>";
|
|
17
18
|
//#endregion
|
|
18
19
|
//#region src/ui/icons.ts
|
|
19
|
-
function
|
|
20
|
+
function S(e) {
|
|
20
21
|
let t = document.createElement("span");
|
|
21
22
|
return t.className = "flex-center", t.setAttribute("role", "img"), t.setAttribute("aria-hidden", "true"), t.innerHTML = e, t;
|
|
22
23
|
}
|
|
23
24
|
//#endregion
|
|
24
25
|
//#region src/ui/components/center-play.ts
|
|
25
|
-
function
|
|
26
|
+
function C(e, t) {
|
|
26
27
|
let n = document.createElement("button");
|
|
27
|
-
return n.type = "button", n.className = "center-play flex-center", n.title = "Play", n.setAttribute("aria-label", "Play"), n.replaceChildren(
|
|
28
|
-
let r = e.get(t.
|
|
28
|
+
return n.type = "button", n.className = "center-play flex-center", n.title = "Play", n.setAttribute("aria-label", "Play"), n.replaceChildren(S(h)), e.run((e) => {
|
|
29
|
+
let r = e.get(t.controls.paused), i = e.get(t.video.source.out.error);
|
|
29
30
|
n.style.display = r && !i ? "" : "none";
|
|
30
31
|
}), e.event(n, "click", () => {
|
|
31
32
|
t.paused = !1;
|
|
@@ -33,81 +34,76 @@ function S(e, t) {
|
|
|
33
34
|
}
|
|
34
35
|
//#endregion
|
|
35
36
|
//#region src/ui/fullscreen.ts
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
let
|
|
39
|
-
for (let e of
|
|
37
|
+
var w = "player--pseudo-fullscreen";
|
|
38
|
+
function T(e, t) {
|
|
39
|
+
let n = document, r = /* @__PURE__ */ new Set(), i = () => {
|
|
40
|
+
for (let e of r) e();
|
|
40
41
|
};
|
|
41
|
-
e.event(document, "fullscreenchange",
|
|
42
|
-
let
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (r.webkitRequestFullscreen) {
|
|
49
|
-
r.webkitRequestFullscreen();
|
|
42
|
+
e.event(document, "fullscreenchange", i), e.event(document, "webkitfullscreenchange", i);
|
|
43
|
+
let a = () => !!(document.fullscreenElement || n.webkitFullscreenElement), o = () => t.classList.contains(w), s = () => a() || o(), c = () => {
|
|
44
|
+
let e = t;
|
|
45
|
+
if (e.requestFullscreen) {
|
|
46
|
+
e.requestFullscreen().catch(() => u());
|
|
50
47
|
return;
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
o !== i && (o = i, e.event(i, "webkitbeginfullscreen", a), e.event(i, "webkitendfullscreen", a)), i.webkitEnterFullscreen();
|
|
49
|
+
if (e.webkitRequestFullscreen) {
|
|
50
|
+
e.webkitRequestFullscreen();
|
|
55
51
|
return;
|
|
56
52
|
}
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
if (
|
|
60
|
-
|
|
53
|
+
u();
|
|
54
|
+
}, l = () => {
|
|
55
|
+
if (o()) {
|
|
56
|
+
d();
|
|
61
57
|
return;
|
|
62
58
|
}
|
|
63
59
|
if (document.exitFullscreen) {
|
|
64
60
|
document.exitFullscreen().catch(() => {});
|
|
65
61
|
return;
|
|
66
62
|
}
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
t.classList.add(
|
|
70
|
-
},
|
|
71
|
-
t.classList.remove(
|
|
63
|
+
n.webkitExitFullscreen?.();
|
|
64
|
+
}, u = () => {
|
|
65
|
+
t.classList.add(w), i();
|
|
66
|
+
}, d = () => {
|
|
67
|
+
t.classList.remove(w), i();
|
|
72
68
|
};
|
|
73
69
|
return {
|
|
74
|
-
active:
|
|
75
|
-
toggle: () =>
|
|
76
|
-
onChange: (e) => (
|
|
70
|
+
active: s,
|
|
71
|
+
toggle: () => s() ? l() : c(),
|
|
72
|
+
onChange: (e) => (r.add(e), () => r.delete(e))
|
|
77
73
|
};
|
|
78
74
|
}
|
|
79
75
|
//#endregion
|
|
80
76
|
//#region src/ui/components/button.ts
|
|
81
|
-
function
|
|
77
|
+
function E(e, t) {
|
|
82
78
|
let n = document.createElement("button");
|
|
83
|
-
return n.type = "button", n.className = "control flex-center", n.title = t, n.setAttribute("aria-label", t), n.replaceChildren(
|
|
79
|
+
return n.type = "button", n.className = "control flex-center", n.title = t, n.setAttribute("aria-label", t), n.replaceChildren(S(e)), n;
|
|
84
80
|
}
|
|
85
81
|
//#endregion
|
|
86
82
|
//#region src/ui/components/fullscreen-button.ts
|
|
87
|
-
function
|
|
88
|
-
let
|
|
89
|
-
let e =
|
|
90
|
-
|
|
83
|
+
function D(e, t) {
|
|
84
|
+
let n = E(l, "Fullscreen"), r = T(e, t), i = () => {
|
|
85
|
+
let e = r.active();
|
|
86
|
+
n.replaceChildren(S(e ? u : l)), n.title = e ? "Exit fullscreen" : "Fullscreen", n.setAttribute("aria-label", n.title);
|
|
91
87
|
};
|
|
92
|
-
return
|
|
88
|
+
return i(), e.cleanup(r.onChange(i)), e.event(n, "click", () => r.toggle()), n;
|
|
93
89
|
}
|
|
94
90
|
//#endregion
|
|
95
91
|
//#region src/ui/format.ts
|
|
96
|
-
function
|
|
92
|
+
function O(e) {
|
|
97
93
|
return e >= 1e6 ? `${(e / 1e6).toFixed(1)} Mbps` : e >= 1e3 ? `${(e / 1e3).toFixed(0)} kbps` : `${Math.round(e)} bps`;
|
|
98
94
|
}
|
|
99
|
-
function
|
|
95
|
+
function k(e) {
|
|
100
96
|
return e < 1e3 ? `${Math.round(e)} ms` : `${(e / 1e3).toFixed(2)} s`;
|
|
101
97
|
}
|
|
102
98
|
function ee(e) {
|
|
103
99
|
return `${(e / 1e3).toFixed(1)} kHz`;
|
|
104
100
|
}
|
|
105
|
-
function
|
|
101
|
+
function te(e) {
|
|
106
102
|
return `${e.toFixed(1)} fps`;
|
|
107
103
|
}
|
|
108
104
|
//#endregion
|
|
109
105
|
//#region src/ui/components/live-badge.ts
|
|
110
|
-
function
|
|
106
|
+
function A(e, t, n) {
|
|
111
107
|
return e ? t === "disconnected" ? {
|
|
112
108
|
variant: "error",
|
|
113
109
|
text: "Disconnected"
|
|
@@ -131,7 +127,7 @@ function te(e, t, n) {
|
|
|
131
127
|
text: "No URL"
|
|
132
128
|
};
|
|
133
129
|
}
|
|
134
|
-
function
|
|
130
|
+
function j(e, t, n) {
|
|
135
131
|
let r = document.createElement("button");
|
|
136
132
|
r.type = "button", r.className = "badge flex-align-center", r.title = "Latency settings";
|
|
137
133
|
let i = document.createElement("span");
|
|
@@ -140,29 +136,30 @@ function A(e, t, n) {
|
|
|
140
136
|
a.className = "badge-text";
|
|
141
137
|
let o = document.createElement("span");
|
|
142
138
|
return o.className = "badge-latency", r.append(i, a, o), e.run((e) => {
|
|
143
|
-
let n = e.get(t.connection.url), i = e.get(t.connection.status), o = e.get(t.broadcast.status), { variant: s, text: c } =
|
|
139
|
+
let n = e.get(t.connection.url), i = e.get(t.connection.status), o = e.get(t.broadcast.out.status), { variant: s, text: c } = A(n, i, o);
|
|
144
140
|
r.style.display = o === "offline" ? "none" : "", r.dataset.variant = s, a.textContent = c.toUpperCase();
|
|
145
141
|
}), e.run((e) => {
|
|
146
|
-
|
|
142
|
+
let n = e.get(t.sync.out.buffer);
|
|
143
|
+
o.textContent = `+${k(n)} latency`;
|
|
147
144
|
}), e.event(r, "click", () => {
|
|
148
145
|
n.tab.set("latency"), n.panel.set(!0);
|
|
149
146
|
}), r;
|
|
150
147
|
}
|
|
151
148
|
//#endregion
|
|
152
149
|
//#region src/ui/components/play-pause.ts
|
|
153
|
-
function
|
|
154
|
-
let n =
|
|
150
|
+
function M(e, t) {
|
|
151
|
+
let n = E(h, "Play");
|
|
155
152
|
return e.run((e) => {
|
|
156
|
-
let r = e.get(t.
|
|
157
|
-
n.title = r ? "Play" : "Pause", n.setAttribute("aria-label", n.title), n.replaceChildren(
|
|
153
|
+
let r = e.get(t.controls.paused);
|
|
154
|
+
n.title = r ? "Play" : "Pause", n.setAttribute("aria-label", n.title), n.replaceChildren(S(r ? h : m));
|
|
158
155
|
}), e.event(n, "click", () => {
|
|
159
156
|
t.paused = !t.paused;
|
|
160
157
|
}), n;
|
|
161
158
|
}
|
|
162
159
|
//#endregion
|
|
163
160
|
//#region src/ui/components/settings-button.ts
|
|
164
|
-
function
|
|
165
|
-
let n =
|
|
161
|
+
function N(e, t) {
|
|
162
|
+
let n = E(g, "Settings");
|
|
166
163
|
return e.run((e) => {
|
|
167
164
|
let r = e.get(t.panel);
|
|
168
165
|
n.classList.toggle("control--active", r), n.title = r ? "Close settings" : "Settings", n.setAttribute("aria-label", n.title), n.setAttribute("aria-expanded", String(r));
|
|
@@ -172,48 +169,48 @@ function M(e, t) {
|
|
|
172
169
|
}
|
|
173
170
|
//#endregion
|
|
174
171
|
//#region src/ui/components/volume-slider.ts
|
|
175
|
-
function N(e, t) {
|
|
176
|
-
return t || e === 0 ? d : e <= 33 ? y : e <= 66 ? b : v;
|
|
177
|
-
}
|
|
178
172
|
function P(e, t) {
|
|
173
|
+
return t || e === 0 ? f : e <= 33 ? b : e <= 66 ? x : y;
|
|
174
|
+
}
|
|
175
|
+
function F(e, t) {
|
|
179
176
|
let n = document.createElement("div");
|
|
180
177
|
n.className = "volume flex-align-center";
|
|
181
178
|
let r = document.createElement("button");
|
|
182
179
|
r.type = "button", r.className = "control flex-center";
|
|
183
180
|
let i = document.createElement("input");
|
|
184
181
|
return i.type = "range", i.className = "volume-track", i.min = "0", i.max = "100", i.setAttribute("aria-label", "Volume"), n.append(r, i), e.run((e) => {
|
|
185
|
-
let n = e.get(t.
|
|
186
|
-
i.value = s.toString(), i.style.setProperty("--fill", `${s}%`), r.title = a ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(
|
|
182
|
+
let n = e.get(t.controls.volume), a = e.get(t.controls.muted), o = Math.round(n * 100), s = a ? 0 : o;
|
|
183
|
+
i.value = s.toString(), i.style.setProperty("--fill", `${s}%`), r.title = a ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(S(P(o, a)));
|
|
187
184
|
}), e.event(i, "input", () => {
|
|
188
185
|
let e = Number.parseFloat(i.value) / 100;
|
|
189
|
-
t.
|
|
186
|
+
t.controls.volume.set(e), e > 0 && t.controls.muted.set(!1);
|
|
190
187
|
}), e.event(r, "click", () => {
|
|
191
|
-
t.
|
|
188
|
+
t.controls.muted.update((e) => !e);
|
|
192
189
|
}), n;
|
|
193
190
|
}
|
|
194
191
|
//#endregion
|
|
195
192
|
//#region src/ui/components/control-bar.ts
|
|
196
|
-
function
|
|
197
|
-
let a =
|
|
198
|
-
o.append(
|
|
199
|
-
let s =
|
|
200
|
-
return c.append(
|
|
193
|
+
function I(e, t, n, r) {
|
|
194
|
+
let a = i.create("div", { className: "controls" }), o = i.create("div", { className: "controls-group" });
|
|
195
|
+
o.append(M(e, t), F(e, t), j(e, t, n));
|
|
196
|
+
let s = i.create("div", { className: "controls-spacer" }), c = i.create("div", { className: "controls-group" });
|
|
197
|
+
return c.append(N(e, n), D(e, r)), a.append(o, s, c), a;
|
|
201
198
|
}
|
|
202
199
|
//#endregion
|
|
203
200
|
//#region src/ui/components/offline-indicator.ts
|
|
204
|
-
function
|
|
201
|
+
function ne(e, t) {
|
|
205
202
|
let n = document.createElement("div");
|
|
206
203
|
n.className = "watch-ui__offline-indicator", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite");
|
|
207
204
|
let r = document.createElement("span");
|
|
208
205
|
return r.className = "watch-ui__offline-text", r.textContent = "OFFLINE", n.appendChild(r), e.run((e) => {
|
|
209
|
-
let r = e.get(t.broadcast.status) === "offline";
|
|
206
|
+
let r = e.get(t.broadcast.out.status) === "offline";
|
|
210
207
|
n.style.display = r ? "" : "none";
|
|
211
208
|
}), n;
|
|
212
209
|
}
|
|
213
210
|
//#endregion
|
|
214
211
|
//#region src/ui/graph.ts
|
|
215
|
-
var
|
|
216
|
-
function
|
|
212
|
+
var re = 120;
|
|
213
|
+
function L(e, t) {
|
|
217
214
|
let n = document.createElement("canvas").getContext("2d");
|
|
218
215
|
if (!n) return e;
|
|
219
216
|
n.fillStyle = e;
|
|
@@ -225,8 +222,8 @@ function R(e, t) {
|
|
|
225
222
|
let i = r.match(/[\d.]+/g);
|
|
226
223
|
return i && i.length >= 3 ? `rgba(${i[0]}, ${i[1]}, ${i[2]}, ${t})` : e;
|
|
227
224
|
}
|
|
228
|
-
function
|
|
229
|
-
let r = n?.color ?? "#4ade80", i =
|
|
225
|
+
function R(e, t, n) {
|
|
226
|
+
let r = n?.color ?? "#4ade80", i = L(r, .33), a = L(r, 0), o = Number.isFinite(n?.samples) ? Math.max(1, Math.floor(n?.samples)) : re, s = document.createElement("div");
|
|
230
227
|
s.className = "graph";
|
|
231
228
|
let c = document.createElement("div");
|
|
232
229
|
c.className = "graph-header";
|
|
@@ -269,25 +266,25 @@ function z(e, t, n) {
|
|
|
269
266
|
}
|
|
270
267
|
//#endregion
|
|
271
268
|
//#region src/ui/stats.ts
|
|
272
|
-
var
|
|
269
|
+
var z = 250;
|
|
273
270
|
function B(e, t, n) {
|
|
274
|
-
let
|
|
275
|
-
o.appendChild(
|
|
276
|
-
let s =
|
|
271
|
+
let r = i.create("div", { className: `stat-card stat-card--${e}` }), a = i.create("div", { className: "stat-head" }), o = i.create("div", { className: "stat-icon" });
|
|
272
|
+
o.appendChild(S(n));
|
|
273
|
+
let s = i.create("span", {
|
|
277
274
|
className: "stat-status",
|
|
278
275
|
style: { display: "none" }
|
|
279
276
|
});
|
|
280
|
-
a.append(o,
|
|
281
|
-
let c =
|
|
282
|
-
return
|
|
283
|
-
el:
|
|
277
|
+
a.append(o, i.create("span", { className: "stat-title" }, t), s);
|
|
278
|
+
let c = i.create("div", { className: "stat-grid" });
|
|
279
|
+
return r.append(a, c), {
|
|
280
|
+
el: r,
|
|
284
281
|
grid: c,
|
|
285
282
|
status: s
|
|
286
283
|
};
|
|
287
284
|
}
|
|
288
285
|
function V(e, t) {
|
|
289
|
-
let n =
|
|
290
|
-
return n.append(
|
|
286
|
+
let n = i.create("div", { className: "stat-line" }), r = i.create("span", { className: "stat-value" }, "—");
|
|
287
|
+
return n.append(i.create("span", { className: "stat-key" }, t), r), e.appendChild(n), r;
|
|
291
288
|
}
|
|
292
289
|
function H(e, t, n) {
|
|
293
290
|
if (e.bytes <= 0) return;
|
|
@@ -304,29 +301,29 @@ function W(e, t, n) {
|
|
|
304
301
|
});
|
|
305
302
|
}
|
|
306
303
|
function G(e, t) {
|
|
307
|
-
let n =
|
|
304
|
+
let n = i.create("div", { className: "tab-body stats" }), r = B("video", "Video", v), a = V(r.grid, "Resolution"), s = V(r.grid, "Codec"), c = R(e, "Bitrate", {
|
|
308
305
|
color: "#a855f7",
|
|
309
|
-
format:
|
|
310
|
-
}), l =
|
|
306
|
+
format: O
|
|
307
|
+
}), l = R(e, "Frame rate", {
|
|
311
308
|
color: "#facc15",
|
|
312
|
-
format:
|
|
309
|
+
format: te
|
|
313
310
|
});
|
|
314
|
-
|
|
315
|
-
catalog: t.
|
|
316
|
-
flag: t.
|
|
311
|
+
r.el.append(c.el, l.el), W(e, r, {
|
|
312
|
+
catalog: t.video.source.out.catalog,
|
|
313
|
+
flag: t.controls.paused,
|
|
317
314
|
label: "paused"
|
|
318
315
|
});
|
|
319
|
-
let u = B("audio", "Audio",
|
|
316
|
+
let u = B("audio", "Audio", o), d = V(u.grid, "Codec"), f = V(u.grid, "Sample rate"), m = V(u.grid, "Channels"), h = V(u.grid, "Bitrate");
|
|
320
317
|
W(e, u, {
|
|
321
|
-
catalog: t.
|
|
322
|
-
flag: t.
|
|
318
|
+
catalog: t.audio.source.out.catalog,
|
|
319
|
+
flag: t.controls.muted,
|
|
323
320
|
label: "muted"
|
|
324
321
|
});
|
|
325
|
-
let g = B("network", "Network",
|
|
322
|
+
let g = B("network", "Network", p), _ = V(g.grid, "Estimated max"), y = V(g.grid, "Actual"), b = R(e, "Round trip", {
|
|
326
323
|
color: "#00dfff",
|
|
327
|
-
format: (e) =>
|
|
324
|
+
format: (e) => k(e)
|
|
328
325
|
});
|
|
329
|
-
g.el.append(b.el), n.append(
|
|
326
|
+
g.el.append(b.el), n.append(r.el, u.el, g.el);
|
|
330
327
|
let x = {
|
|
331
328
|
frames: 0,
|
|
332
329
|
bytes: 0,
|
|
@@ -336,115 +333,115 @@ function G(e, t) {
|
|
|
336
333
|
when: performance.now()
|
|
337
334
|
};
|
|
338
335
|
return e.interval(() => {
|
|
339
|
-
let e = performance.now(), n = t.
|
|
340
|
-
|
|
341
|
-
let
|
|
336
|
+
let e = performance.now(), n = t.video.source.out.config.peek(), r = t.video.source.out.catalog.peek(), i = t.video.out.stats.peek(), o = n?.codedWidth ?? r?.display?.width, u = n?.codedHeight ?? r?.display?.height;
|
|
337
|
+
a.textContent = o && u ? `${o}×${u}` : "—", s.textContent = n?.codec ?? "—";
|
|
338
|
+
let p;
|
|
342
339
|
if (i && x.frames > 0) {
|
|
343
340
|
let t = e - x.when, n = i.frameCount - x.frames;
|
|
344
|
-
n > 0 && t > 0 && (
|
|
341
|
+
n > 0 && t > 0 && (p = n / (t / 1e3));
|
|
345
342
|
}
|
|
346
343
|
let g = i ? H(x, i.bytesReceived, e) : void 0;
|
|
347
|
-
c.push(g), l.push(
|
|
344
|
+
c.push(g), l.push(p), i && (x = {
|
|
348
345
|
frames: i.frameCount,
|
|
349
346
|
bytes: i.bytesReceived,
|
|
350
347
|
when: e
|
|
351
348
|
});
|
|
352
|
-
let
|
|
353
|
-
d.textContent =
|
|
349
|
+
let v = t.audio.source.out.config.peek(), C = t.audio.out.stats.peek();
|
|
350
|
+
d.textContent = v?.codec ?? "—", f.textContent = v?.sampleRate ? ee(v.sampleRate) : "—", m.textContent = v?.numberOfChannels ? `${v.numberOfChannels}` : "—";
|
|
354
351
|
let w = C ? H(S, C.bytesReceived, e) : void 0;
|
|
355
|
-
h.textContent = w === void 0 ? "—" :
|
|
352
|
+
h.textContent = w === void 0 ? "—" : O(w), C && (S = {
|
|
356
353
|
bytes: C.bytesReceived,
|
|
357
354
|
when: e
|
|
358
355
|
});
|
|
359
|
-
let T = t.connection.
|
|
360
|
-
|
|
361
|
-
let
|
|
362
|
-
y.textContent =
|
|
363
|
-
let k = T?.rtt
|
|
356
|
+
let T = t.connection.probe.peek(), E = T?.estimatedRecvRate;
|
|
357
|
+
_.textContent = E ? O(E) : "—";
|
|
358
|
+
let D = g !== void 0 || w !== void 0 ? (g ?? 0) + (w ?? 0) : void 0;
|
|
359
|
+
y.textContent = D === void 0 ? "—" : O(D);
|
|
360
|
+
let k = T?.rtt;
|
|
364
361
|
b.push(k !== void 0 && k > 0 ? k : void 0);
|
|
365
|
-
},
|
|
362
|
+
}, z), n;
|
|
366
363
|
}
|
|
367
364
|
//#endregion
|
|
368
365
|
//#region src/ui/components/buffer-control.ts
|
|
369
|
-
var K = 0, q = 10, J = 4e3, Y = 48;
|
|
370
|
-
function X(e,
|
|
371
|
-
let
|
|
372
|
-
if (!
|
|
373
|
-
let
|
|
374
|
-
if ((e.width !==
|
|
375
|
-
let
|
|
376
|
-
for (let e = 0; e <
|
|
377
|
-
let
|
|
378
|
-
if (
|
|
379
|
-
let
|
|
380
|
-
if (
|
|
381
|
-
let e = ((
|
|
382
|
-
|
|
366
|
+
var K = t.Time.Milli(0), q = t.Time.Milli(10), J = t.Time.Milli(4e3), Y = 48;
|
|
367
|
+
function X(e, n, r, i, a) {
|
|
368
|
+
let o = e.getContext("2d");
|
|
369
|
+
if (!o) return;
|
|
370
|
+
let s = window.devicePixelRatio || 1, c = e.getBoundingClientRect(), l = c.width, u = c.height, d = Math.round(l * s), f = Math.round(u * s);
|
|
371
|
+
if ((e.width !== d || e.height !== f) && (e.width = d, e.height = f), o.setTransform(s, 0, 0, s, 0, 0), o.clearRect(0, 0, l, u), r === void 0) return;
|
|
372
|
+
let p = u - 4;
|
|
373
|
+
for (let e = 0; e < n.length; e++) {
|
|
374
|
+
let s = n[e], c = t.Time.Milli(s.start - r), d = t.Time.Milli(s.end - r), f = Math.max(0, c), m = Math.min(d, i);
|
|
375
|
+
if (m <= f) continue;
|
|
376
|
+
let h = f / i * l, g = Math.max(2, (m - f) / i * l);
|
|
377
|
+
if (o.globalAlpha = .85, o.fillStyle = a ? "#f87171" : e > 0 ? "#facc15" : "#4ade80", typeof o.roundRect == "function" ? (o.beginPath(), o.roundRect(h, 2, g, p, 2), o.fill()) : o.fillRect(h, 2, g, p), d > i) {
|
|
378
|
+
let e = ((d - i) / 1e3).toFixed(1);
|
|
379
|
+
o.globalAlpha = .7, o.fillStyle = "black", o.font = "500 9px system-ui, sans-serif", o.textAlign = "right", o.textBaseline = "middle", o.fillText(`+${e}s`, h + g - 4, u / 2);
|
|
383
380
|
}
|
|
384
381
|
}
|
|
385
382
|
}
|
|
386
|
-
function
|
|
387
|
-
let r = document.createElement("div");
|
|
388
|
-
r.className = "buffer";
|
|
383
|
+
function ie(e, n, r = J) {
|
|
389
384
|
let i = document.createElement("div");
|
|
390
|
-
i.className = "buffer
|
|
385
|
+
i.className = "buffer";
|
|
391
386
|
let a = document.createElement("div");
|
|
392
|
-
a.className = "buffer-
|
|
387
|
+
a.className = "buffer-visualization", a.setAttribute("role", "slider"), a.tabIndex = 0, a.setAttribute("aria-valuemin", K.toString()), a.setAttribute("aria-valuemax", r.toString()), a.setAttribute("aria-label", "Buffer jitter");
|
|
393
388
|
let o = document.createElement("div");
|
|
394
|
-
o.className = "buffer-
|
|
395
|
-
let s = document.createElement("
|
|
396
|
-
s.className = "buffer-track-
|
|
397
|
-
let c = document.createElement("
|
|
398
|
-
c.className = "buffer-
|
|
399
|
-
let l = document.createElement("
|
|
400
|
-
l.className = "buffer-
|
|
401
|
-
let u = document.createElement("
|
|
402
|
-
u.className = "buffer-track-
|
|
403
|
-
let d = document.createElement("
|
|
404
|
-
d.className = "buffer-
|
|
405
|
-
let f = document.createElement("
|
|
406
|
-
f.className = "buffer-
|
|
389
|
+
o.className = "buffer-playhead";
|
|
390
|
+
let s = document.createElement("div");
|
|
391
|
+
s.className = "buffer-track buffer-track--video";
|
|
392
|
+
let c = document.createElement("span");
|
|
393
|
+
c.className = "buffer-track-label", c.textContent = "Video";
|
|
394
|
+
let l = document.createElement("canvas");
|
|
395
|
+
l.className = "buffer-canvas", s.append(c, l);
|
|
396
|
+
let u = document.createElement("div");
|
|
397
|
+
u.className = "buffer-track buffer-track--audio";
|
|
398
|
+
let d = document.createElement("span");
|
|
399
|
+
d.className = "buffer-track-label", d.textContent = "Audio";
|
|
400
|
+
let f = document.createElement("canvas");
|
|
401
|
+
f.className = "buffer-canvas", u.append(d, f);
|
|
407
402
|
let p = document.createElement("div");
|
|
408
|
-
p.className = "buffer-target-
|
|
409
|
-
let m = document.createElement("
|
|
410
|
-
m.className = "buffer-target-
|
|
403
|
+
p.className = "buffer-target-area";
|
|
404
|
+
let m = document.createElement("div");
|
|
405
|
+
m.className = "buffer-target-line";
|
|
411
406
|
let h = document.createElement("span");
|
|
412
|
-
h.className = "buffer-
|
|
413
|
-
let g =
|
|
407
|
+
h.className = "buffer-target-label", m.appendChild(h), p.appendChild(m);
|
|
408
|
+
let g = document.createElement("span");
|
|
409
|
+
g.className = "buffer-help", g.textContent = "click to change latency", a.append(o, s, u, p, g), i.appendChild(a);
|
|
410
|
+
let _ = !1, v = !1;
|
|
414
411
|
e.run((e) => {
|
|
415
|
-
let
|
|
416
|
-
|
|
412
|
+
let t = e.get(n.sync.out.jitter), i = t / r * 100;
|
|
413
|
+
m.style.left = `${i}%`, h.textContent = `${Math.round(t)}ms`, a.setAttribute("aria-valuenow", t.toString());
|
|
417
414
|
});
|
|
418
|
-
let
|
|
419
|
-
let
|
|
420
|
-
|
|
421
|
-
},
|
|
422
|
-
|
|
415
|
+
let y = (e) => {
|
|
416
|
+
let i = a.getBoundingClientRect(), o = i.width - Y, s = Math.max(0, Math.min(e - i.left - Y, o)) / o * r, c = t.Time.Milli(Math.round(s / q) * q);
|
|
417
|
+
n.latencyMin = t.Time.Milli(Math.max(K, Math.min(r, c)));
|
|
418
|
+
}, b = () => {
|
|
419
|
+
v || (v = !0, g.style.display = "none");
|
|
423
420
|
};
|
|
424
|
-
e.event(
|
|
425
|
-
|
|
421
|
+
e.event(a, "mousedown", (e) => {
|
|
422
|
+
_ = !0, a.classList.add("buffer-visualization--dragging"), b(), y(e.clientX);
|
|
426
423
|
}), e.event(document, "mousemove", (e) => {
|
|
427
|
-
|
|
424
|
+
_ && y(e.clientX);
|
|
428
425
|
}), e.event(document, "mouseup", () => {
|
|
429
|
-
|
|
430
|
-
}), e.event(
|
|
431
|
-
let
|
|
432
|
-
if (e.key === "ArrowRight" || e.key === "ArrowUp")
|
|
433
|
-
else if (e.key === "ArrowLeft" || e.key === "ArrowDown")
|
|
426
|
+
_ && (_ = !1, a.classList.remove("buffer-visualization--dragging"));
|
|
427
|
+
}), e.event(a, "keydown", (e) => {
|
|
428
|
+
let i = t.Time.Milli(0);
|
|
429
|
+
if (e.key === "ArrowRight" || e.key === "ArrowUp") i = q;
|
|
430
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowDown") i = t.Time.Milli(-q);
|
|
434
431
|
else return;
|
|
435
|
-
e.preventDefault(),
|
|
436
|
-
let
|
|
437
|
-
|
|
432
|
+
e.preventDefault(), b();
|
|
433
|
+
let a = n.sync.out.jitter.peek();
|
|
434
|
+
n.latencyMin = t.Time.Milli(Math.max(K, Math.min(r, a + i)));
|
|
438
435
|
});
|
|
439
|
-
let
|
|
440
|
-
let
|
|
441
|
-
X(
|
|
436
|
+
let x = () => {
|
|
437
|
+
let t = n.sync.now(), i = n.video.out.stalled.peek();
|
|
438
|
+
X(l, n.video.out.buffered.peek(), t, r, i), X(f, n.audio.out.buffered.peek(), t, r, i), e.animate(x);
|
|
442
439
|
};
|
|
443
|
-
return e.animate(
|
|
440
|
+
return e.animate(x), i;
|
|
444
441
|
}
|
|
445
442
|
//#endregion
|
|
446
443
|
//#region src/ui/components/latency.ts
|
|
447
|
-
var
|
|
444
|
+
var ae = [
|
|
448
445
|
{
|
|
449
446
|
label: "Real-time",
|
|
450
447
|
value: "real-time"
|
|
@@ -470,72 +467,72 @@ var ie = [
|
|
|
470
467
|
value: 2e3
|
|
471
468
|
}
|
|
472
469
|
];
|
|
473
|
-
function
|
|
474
|
-
let
|
|
475
|
-
let
|
|
470
|
+
function oe(n, r) {
|
|
471
|
+
let a = i.create("div", { className: "tab-body latency" }), o = i.create("div", { className: "latency-presets" }), s = ae.map((e) => {
|
|
472
|
+
let a = i.create("button", {
|
|
476
473
|
className: "chip",
|
|
477
474
|
type: "button"
|
|
478
475
|
}, e.label);
|
|
479
|
-
return
|
|
480
|
-
|
|
481
|
-
}),
|
|
476
|
+
return n.event(a, "click", () => {
|
|
477
|
+
r.latencyMin = e.value === "real-time" ? "real-time" : t.Time.Milli(e.value);
|
|
478
|
+
}), o.appendChild(a), {
|
|
482
479
|
preset: e,
|
|
483
|
-
chip:
|
|
480
|
+
chip: a
|
|
484
481
|
};
|
|
485
482
|
});
|
|
486
|
-
|
|
487
|
-
let
|
|
488
|
-
for (let { preset: e, chip: t } of
|
|
489
|
-
let
|
|
490
|
-
t.classList.toggle("chip--active",
|
|
483
|
+
n.run((t) => {
|
|
484
|
+
let n = e(t.get(r.controls.latency)).min;
|
|
485
|
+
for (let { preset: e, chip: t } of s) {
|
|
486
|
+
let r = e.value === "real-time" ? n === "real-time" : n === e.value;
|
|
487
|
+
t.classList.toggle("chip--active", r);
|
|
491
488
|
}
|
|
492
489
|
});
|
|
493
|
-
let
|
|
494
|
-
|
|
495
|
-
let
|
|
496
|
-
|
|
497
|
-
let
|
|
498
|
-
|
|
490
|
+
let c = ie(n, r), l = i.create("div", { className: "latency-readout" }), u = i.create("div", { className: "latency-stat" }), d = i.create("span", { className: "latency-stat-value" }, "—");
|
|
491
|
+
u.append(i.create("span", { className: "latency-stat-label" }, "Jitter buffer"), d);
|
|
492
|
+
let f = i.create("div", { className: "latency-stat" }), p = i.create("span", { className: "latency-stat-value" }, "—");
|
|
493
|
+
f.append(i.create("span", { className: "latency-stat-label" }, "Total buffer"), p), l.append(u, f), n.run((t) => {
|
|
494
|
+
let n = e(t.get(r.controls.latency)).min, i = t.get(r.sync.out.jitter), a = t.get(r.sync.out.buffer);
|
|
495
|
+
d.textContent = `${k(i)}${n === "real-time" ? " (auto)" : ""}`, p.textContent = k(a);
|
|
499
496
|
});
|
|
500
|
-
let
|
|
501
|
-
return
|
|
497
|
+
let m = i.create("div", { className: "tab-hint" }, "A larger buffer smooths over network jitter at the cost of latency. Real-time tracks the connection RTT automatically. Drag the timeline to fine-tune.");
|
|
498
|
+
return a.append(o, c, l, m), a;
|
|
502
499
|
}
|
|
503
500
|
//#endregion
|
|
504
501
|
//#region src/ui/components/quality.ts
|
|
505
|
-
function
|
|
502
|
+
function se(e) {
|
|
506
503
|
if (e.codedWidth && e.codedHeight) return `${e.codedWidth}×${e.codedHeight}`;
|
|
507
504
|
}
|
|
508
|
-
function
|
|
505
|
+
function ce(e) {
|
|
509
506
|
let t = [];
|
|
510
|
-
return e.framerate && t.push(`${Math.round(e.framerate)}fps`), e.bitrate && t.push(
|
|
507
|
+
return e.framerate && t.push(`${Math.round(e.framerate)}fps`), e.bitrate && t.push(O(e.bitrate)), e.codec && t.push(e.codec), t.join(" · ");
|
|
511
508
|
}
|
|
512
|
-
function Z(e, t, n,
|
|
513
|
-
let c =
|
|
509
|
+
function Z(e, t, n, r, a, o) {
|
|
510
|
+
let c = i.create("button", {
|
|
514
511
|
className: "q-row",
|
|
515
512
|
type: "button"
|
|
516
513
|
});
|
|
517
|
-
|
|
518
|
-
let l =
|
|
519
|
-
|
|
520
|
-
let u =
|
|
514
|
+
r && c.classList.add("q-row--selected");
|
|
515
|
+
let l = i.create("span", { className: "q-row-check" });
|
|
516
|
+
r && l.appendChild(S(s));
|
|
517
|
+
let u = i.create("div", { className: "q-row-body" }), d = i.create("span", { className: "q-row-title" }, t);
|
|
521
518
|
if (a) {
|
|
522
|
-
let e =
|
|
519
|
+
let e = i.create("span", { className: "q-row-playing" }, "playing");
|
|
523
520
|
d.appendChild(e);
|
|
524
521
|
}
|
|
525
|
-
let f =
|
|
526
|
-
return u.append(d, f), c.append(l, u), e.event(c, "click",
|
|
522
|
+
let f = i.create("span", { className: "q-row-sub" }, n);
|
|
523
|
+
return u.append(d, f), c.append(l, u), e.event(c, "click", o), c;
|
|
527
524
|
}
|
|
528
|
-
function
|
|
529
|
-
let n =
|
|
525
|
+
function le(e, t) {
|
|
526
|
+
let n = i.create("div", { className: "tab-body q-list" });
|
|
530
527
|
return e.run((e) => {
|
|
531
|
-
let
|
|
528
|
+
let r = t.video.source, a = e.get(r.out.catalog), o = e.get(t.controls.target), s = e.get(r.out.track), c = a?.renditions ?? {}, l = Object.entries(c);
|
|
532
529
|
if (n.replaceChildren(), l.length === 0) {
|
|
533
|
-
n.appendChild(
|
|
530
|
+
n.appendChild(i.create("div", { className: "tab-empty" }, "No video renditions"));
|
|
534
531
|
return;
|
|
535
532
|
}
|
|
536
533
|
let u = o?.name, d = s && !u ? `auto · currently ${s}` : "adapts to bandwidth";
|
|
537
534
|
n.appendChild(Z(e, "Auto", d, !u, !1, () => {
|
|
538
|
-
|
|
535
|
+
t.controls.target.update((e) => ({
|
|
539
536
|
...e,
|
|
540
537
|
name: void 0
|
|
541
538
|
}));
|
|
@@ -543,12 +540,12 @@ function Q(e, t) {
|
|
|
543
540
|
let n = (e[1].codedWidth ?? 0) * (e[1].codedHeight ?? 0);
|
|
544
541
|
return (t[1].codedWidth ?? 0) * (t[1].codedHeight ?? 0) - n;
|
|
545
542
|
});
|
|
546
|
-
for (let [
|
|
547
|
-
let a =
|
|
548
|
-
n.appendChild(Z(e, a,
|
|
549
|
-
|
|
543
|
+
for (let [r, i] of l) {
|
|
544
|
+
let a = se(i) ?? r;
|
|
545
|
+
n.appendChild(Z(e, a, ce(i), u === r, s === r, () => {
|
|
546
|
+
t.controls.target.update((e) => ({
|
|
550
547
|
...e,
|
|
551
|
-
name:
|
|
548
|
+
name: r
|
|
552
549
|
}));
|
|
553
550
|
}));
|
|
554
551
|
}
|
|
@@ -556,46 +553,46 @@ function Q(e, t) {
|
|
|
556
553
|
}
|
|
557
554
|
//#endregion
|
|
558
555
|
//#region src/ui/components/settings-panel.ts
|
|
559
|
-
var
|
|
556
|
+
var ue = [
|
|
560
557
|
{
|
|
561
558
|
id: "quality",
|
|
562
559
|
label: "Quality",
|
|
563
|
-
svg:
|
|
560
|
+
svg: v
|
|
564
561
|
},
|
|
565
562
|
{
|
|
566
563
|
id: "latency",
|
|
567
564
|
label: "Latency",
|
|
568
|
-
svg:
|
|
565
|
+
svg: d
|
|
569
566
|
},
|
|
570
567
|
{
|
|
571
568
|
id: "stats",
|
|
572
569
|
label: "Stats",
|
|
573
|
-
svg:
|
|
570
|
+
svg: _
|
|
574
571
|
}
|
|
575
572
|
];
|
|
576
|
-
function
|
|
577
|
-
let
|
|
578
|
-
|
|
579
|
-
let a =
|
|
580
|
-
o.append(
|
|
581
|
-
let
|
|
573
|
+
function Q(e, t, n) {
|
|
574
|
+
let r = i.create("div", { className: "panel" });
|
|
575
|
+
r.setAttribute("role", "dialog"), r.setAttribute("aria-label", "Player settings");
|
|
576
|
+
let a = i.create("div", { className: "panel-head" }), o = i.create("div", { className: "panel-head-title flex-align-center" });
|
|
577
|
+
o.append(S(g), i.create("span", {}, "Settings"));
|
|
578
|
+
let s = i.create("button", {
|
|
582
579
|
className: "control flex-center",
|
|
583
580
|
type: "button"
|
|
584
581
|
});
|
|
585
|
-
|
|
586
|
-
let l = "panel-body", u =
|
|
582
|
+
s.title = "Close", s.setAttribute("aria-label", "Close settings"), s.appendChild(S(c)), e.event(s, "click", () => n.panel.set(!1)), a.append(o, s);
|
|
583
|
+
let l = "panel-body", u = i.create("div", { className: "panel-tabs" });
|
|
587
584
|
u.setAttribute("role", "tablist");
|
|
588
|
-
let d =
|
|
589
|
-
let
|
|
585
|
+
let d = ue.map((t) => {
|
|
586
|
+
let r = i.create("button", {
|
|
590
587
|
className: "panel-tab",
|
|
591
588
|
type: "button",
|
|
592
589
|
id: `tab-${t.id}`
|
|
593
590
|
});
|
|
594
|
-
return
|
|
591
|
+
return r.setAttribute("role", "tab"), r.setAttribute("aria-controls", l), r.append(S(t.svg), i.create("span", {}, t.label)), e.event(r, "click", () => n.tab.set(t.id)), u.appendChild(r), {
|
|
595
592
|
tab: t,
|
|
596
|
-
btn:
|
|
593
|
+
btn: r
|
|
597
594
|
};
|
|
598
|
-
}), f =
|
|
595
|
+
}), f = i.create("div", {
|
|
599
596
|
className: "panel-body",
|
|
600
597
|
id: l
|
|
601
598
|
});
|
|
@@ -608,41 +605,48 @@ function le(e, t, n) {
|
|
|
608
605
|
}
|
|
609
606
|
}), e.run((e) => {
|
|
610
607
|
if (!e.get(n.panel)) return;
|
|
611
|
-
let
|
|
612
|
-
|
|
613
|
-
}),
|
|
608
|
+
let r = e.get(n.tab), a = r === "quality" ? le(e, t) : r === "latency" ? oe(e, t) : G(e, t);
|
|
609
|
+
i.render(e, f, a);
|
|
610
|
+
}), r.append(a, u, f), e.run((e) => {
|
|
614
611
|
let t = e.get(n.panel);
|
|
615
|
-
|
|
616
|
-
}),
|
|
612
|
+
r.classList.toggle("panel--open", t), r.setAttribute("aria-hidden", String(!t));
|
|
613
|
+
}), r;
|
|
617
614
|
}
|
|
618
615
|
//#endregion
|
|
619
616
|
//#region src/ui/components/unsupported-indicator.ts
|
|
620
|
-
function
|
|
617
|
+
function de(e, t) {
|
|
621
618
|
let n = document.createElement("div");
|
|
622
619
|
n.className = "watch-ui__unsupported-indicator", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite");
|
|
623
620
|
let r = document.createElement("span");
|
|
624
621
|
return r.className = "watch-ui__unsupported-text", n.appendChild(r), e.run((e) => {
|
|
625
|
-
let i = e.get(t.
|
|
622
|
+
let i = e.get(t.video.source.out.error) === "unsupported", a = e.get(t.broadcast.out.status) === "offline", o = i && !a;
|
|
626
623
|
if (n.style.display = o ? "" : "none", !o) return;
|
|
627
|
-
let s = e.get(t.
|
|
624
|
+
let s = e.get(t.video.source.out.catalog)?.renditions ?? {}, c = [...new Set(Object.values(s).map((e) => e.codec))].join(", ");
|
|
628
625
|
r.textContent = c ? `This video codec is not supported by your browser: ${c}` : "This video codec is not supported by your browser";
|
|
629
626
|
}), n;
|
|
630
627
|
}
|
|
631
628
|
//#endregion
|
|
632
629
|
//#region src/ui/styles/index.css?inline
|
|
633
|
-
var de = "*,:before,:after{box-sizing:border-box}: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-60:#fff9;--color-white-alpha-70:#ffffffb3;--color-white-alpha-90:#ffffffe6;--color-gray-100:#9ca3af;--color-gray-400:#6b7280;--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-500:#22c55e;--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-red-400:#f87171;--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-60:#0009;--color-black-alpha-85:#000000d9;--color-panel:#121214eb;--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:.375rem;--border-radius-md:.5rem;--border-radius-lg:.75rem;--accent:var(--color-orange-400);--ease:cubic-bezier(.4, 0, .2, 1);font-family:system-ui,Segoe UI,Roboto,sans-serif}.flex-center{justify-content:center;align-items:center;display:flex}.flex-align-center{align-items:center;display:flex}.control{width:2.25rem;height:2.25rem;color:var(--color-white);cursor:pointer;transition:background-color .12s var(--ease), transform .12s var(--ease), color .12s var(--ease);background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.control svg{width:1.25rem;height:1.25rem}.control:hover:not(:disabled){background-color:var(--color-white-alpha-15)}.control:active:not(:disabled){transform:scale(.92)}.control--active{color:var(--accent)}.control:disabled{opacity:.4;cursor:default}.chip{padding:var(--spacing-4) var(--spacing-12);color:var(--color-white-alpha-70);background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid transparent;cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);border-radius:999px;font-size:.75rem;font-weight:500}.chip:hover{background-color:var(--color-white-alpha-20);color:var(--color-white)}.chip--active{color:var(--color-gray-950);background-color:var(--accent);border-color:var(--accent)}:host{display:block;position:relative}.player{border-radius:var(--spacing-8);background:#000;justify-content:center;align-items:center;width:100%;line-height:0;display:flex;position:relative;overflow:hidden}.player ::slotted(moq-watch){width:100%;line-height:0;display:block}.player:not(.player--chrome){cursor:none}.player:fullscreen,.player--pseudo-fullscreen{border-radius:0;justify-content:center;align-items:center;display:flex}.player:-webkit-full-screen{border-radius:0;justify-content:center;align-items:center;display:flex}.player--pseudo-fullscreen{z-index:2147483647;width:100vw;height:100vh;position:fixed;inset:0}@supports (height:100dvh){.player--pseudo-fullscreen{height:100dvh}}.player:fullscreen ::slotted(moq-watch),.player--pseudo-fullscreen ::slotted(moq-watch){width:100%;height:100%;max-height:100%}.player:-webkit-full-screen ::slotted(moq-watch){width:100%;height:100%;max-height:100%}.scrim{pointer-events:none;opacity:0;transition:opacity .2s var(--ease);position:absolute;left:0;right:0}.scrim--top{background:linear-gradient(to bottom, var(--color-black-alpha-40), transparent);height:25%;top:0}.scrim--bottom{background:linear-gradient(to top, var(--color-black-alpha-60), transparent 60%);height:100%;bottom:0}.player--chrome .scrim{opacity:1}.center{pointer-events:none;justify-content:center;align-items:center;line-height:1;display:flex;position:absolute;inset:0}.center-play{pointer-events:auto;width:4.5rem;height:4.5rem;color:var(--color-white);background:linear-gradient(to bottom right, var(--color-orange-400), var(--color-orange-500), var(--color-amber-600));cursor:pointer;box-shadow:0 var(--spacing-8) var(--spacing-24) var(--color-black-alpha-40);transition:transform .15s var(--ease), box-shadow .15s var(--ease);border:none;border-radius:50%}.center-play svg{width:2rem;height:2rem}.center-play:hover{box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-orange-500-alpha-60);transform:scale(1.06)}.center-play:active{transform:scale(.97)}.chrome{opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;justify-content:flex-end;line-height:1.4;display:flex;position:absolute;bottom:0;left:0;right:0;transform:translateY(.5rem)}.player--chrome .chrome{opacity:1;pointer-events:auto;transform:translateY(0)}.controls{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-12) var(--spacing-12);display:flex;position:relative}.controls-group{align-items:center;gap:var(--spacing-4);display:flex}.controls-spacer{flex:1}.volume{gap:var(--spacing-4)}.volume-track{appearance:none;background:linear-gradient(to right, var(--color-white) 0%, var(--color-white) var(--fill,50%), var(--color-white-alpha-30) var(--fill,50%));cursor:pointer;opacity:0;width:0;max-width:0;height:.25rem;transition:width .16s var(--ease), max-width .16s var(--ease), opacity .16s var(--ease);border-radius:999px;outline:none;margin:0}.volume:hover .volume-track,.volume:focus-within .volume-track{opacity:1;width:4.5rem;max-width:4.5rem}.volume-track::-webkit-slider-thumb{appearance:none;background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.volume-track::-moz-range-thumb{background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.badge{gap:var(--spacing-8);height:2.25rem;padding:0 var(--spacing-12);margin-left:var(--spacing-4);color:var(--color-white);border-radius:var(--border-radius-sm);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;font-size:.8125rem}.badge:hover{background-color:var(--color-white-alpha-10)}.badge-dot{background:var(--color-gray-400);border-radius:50%;flex-shrink:0;width:.5rem;height:.5rem}.badge-text{letter-spacing:.04em;font-weight:600}.badge-latency{max-width:0;margin-left:calc(-1 * var(--spacing-8));opacity:0;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--color-white-alpha-60);transition:max-width .16s var(--ease), margin-left .16s var(--ease), opacity .16s var(--ease);overflow:hidden}.badge:hover .badge-latency,.badge:focus-visible .badge-latency{opacity:1;max-width:9rem;margin-left:0}.badge[data-variant=live] .badge-dot{background:var(--color-red-400);animation:badge-pulse 2s var(--ease) infinite;box-shadow:0 0 #f87171b3}.badge[data-variant=live] .badge-text{color:var(--color-red-400)}.badge[data-variant=loading] .badge-dot,.badge[data-variant=connecting] .badge-dot{background:var(--color-yellow-400)}.badge[data-variant=error] .badge-dot{background:var(--color-gray-400)}.badge[data-variant=error] .badge-text{color:var(--color-gray-100)}@keyframes badge-pulse{0%{box-shadow:0 0 #f8717199}70%{box-shadow:0 0 0 .4rem #f8717100}to{box-shadow:0 0 #f8717100}}.panel{top:var(--spacing-8);right:var(--spacing-8);bottom:var(--spacing-8);width:20rem;max-width:calc(100% - var(--spacing-16));background:var(--color-panel);backdrop-filter:blur(12px);border:var(--spacing-1) solid var(--color-white-alpha-15);border-radius:var(--border-radius-lg);box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-black-alpha-60);color:var(--color-white);z-index:4;opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;line-height:1.4;display:flex;position:absolute;overflow:hidden;transform:translate(.75rem)}.panel--open{opacity:1;pointer-events:auto;transform:translate(0)}.panel-head{padding:var(--spacing-8) var(--spacing-8) var(--spacing-8) var(--spacing-16);border-bottom:var(--spacing-1) solid var(--color-white-alpha-10);justify-content:space-between;align-items:center;display:flex}.panel-head-title{gap:var(--spacing-8);font-size:.875rem;font-weight:600}.panel-head-title svg{width:1.125rem;height:1.125rem}.panel-head .control{width:2rem;height:2rem}.panel-tabs{padding:var(--spacing-8);gap:var(--spacing-4);display:flex}.panel-tab{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-4);color:var(--color-white-alpha-60);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease);background:0 0;border:none;flex-direction:column;flex:1;font-size:.6875rem;font-weight:500;display:flex}.panel-tab svg{width:1.125rem;height:1.125rem}.panel-tab:hover{background-color:var(--color-white-alpha-05);color:var(--color-white)}.panel-tab--active{background-color:var(--color-white-alpha-10);color:var(--color-white)}.panel-body{scrollbar-width:thin;scrollbar-color:var(--color-white-alpha-20) transparent;flex:1;min-height:0;overflow-y:auto}.panel-body::-webkit-scrollbar{width:.375rem}.panel-body::-webkit-scrollbar-thumb{background:var(--color-white-alpha-20);border-radius:999px}.tab-body{gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-16) var(--spacing-16);flex-direction:column;display:flex}.tab-empty{padding:var(--spacing-24) 0;text-align:center;color:var(--color-white-alpha-40);font-size:.8125rem}.tab-hint{color:var(--color-white-alpha-40);font-size:.6875rem;line-height:1.5}.q-list{gap:var(--spacing-2)}.q-row{align-items:center;gap:var(--spacing-8);width:100%;padding:var(--spacing-8);text-align:left;color:var(--color-white);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;display:flex}.q-row:hover{background-color:var(--color-white-alpha-05)}.q-row--selected{background-color:var(--color-white-alpha-10)}.q-row-check{width:1rem;color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:flex}.q-row-check svg{width:1rem;height:1rem}.q-row-body{flex-direction:column;gap:.1rem;min-width:0;display:flex}.q-row-title{align-items:center;gap:var(--spacing-8);font-size:.8125rem;font-weight:600;display:flex}.q-row-playing{letter-spacing:.06em;text-transform:uppercase;color:var(--color-green-500);background:var(--color-green-900);padding:.05rem var(--spacing-4);border-radius:var(--border-radius-sm);font-size:.5625rem;font-weight:600}.q-row-sub{color:var(--color-white-alpha-60);text-overflow:ellipsis;white-space:nowrap;font-size:.6875rem;overflow:hidden}.latency-presets{gap:var(--spacing-4);flex-wrap:wrap;display:flex}.latency-readout{gap:var(--spacing-8);display:flex}.latency-stat{gap:var(--spacing-2);padding:var(--spacing-8) var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;flex:1;display:flex}.latency-stat-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.latency-stat-value{font-variant-numeric:tabular-nums;color:var(--accent);font-size:.9375rem;font-weight:600}.stat-card{gap:var(--spacing-8);padding:var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;display:flex}.stat-head{align-items:center;gap:var(--spacing-8);display:flex}.stat-icon{border-radius:var(--border-radius-sm);justify-content:center;align-items:center;width:1.5rem;height:1.5rem;display:flex}.stat-icon svg{width:.875rem;height:.875rem}.stat-title{text-transform:uppercase;letter-spacing:.05em;font-size:.75rem;font-weight:600}.stat-status{letter-spacing:.06em;text-transform:uppercase;color:var(--color-gray-100);background:var(--color-white-alpha-10);padding:.05rem var(--spacing-8);border-radius:var(--border-radius-sm);margin-left:auto;font-size:.5625rem;font-weight:600}.stat-card--video .stat-icon{background:var(--color-purple-900);color:var(--color-purple-400)}.stat-card--video .stat-title{color:var(--color-purple-400)}.stat-card--audio .stat-icon{background:var(--color-green-900);color:var(--color-green-400)}.stat-card--audio .stat-title{color:var(--color-green-400)}.stat-card--network .stat-icon{background:var(--color-blue-900);color:var(--color-blue-400)}.stat-card--network .stat-title{color:var(--color-blue-400)}.stat-grid{gap:var(--spacing-2) var(--spacing-12);grid-template-columns:auto 1fr;display:grid}.stat-line{display:contents}.stat-key{color:var(--color-white-alpha-60);font-size:.75rem}.stat-value{text-align:right;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;font-weight:600;overflow:hidden}.graph{gap:var(--spacing-2);margin-top:var(--spacing-4);flex-direction:column;display:flex}.graph-header{justify-content:space-between;align-items:baseline;display:flex}.graph-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.graph-value{font-variant-numeric:tabular-nums;font-size:.6875rem;font-weight:600}.graph-canvas{width:100%;height:2.5rem;display:block}.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}}.watch-ui__unsupported-indicator{text-align:center;background-color:var(--color-black-alpha-85);z-index:4;pointer-events:auto;border-radius:.25rem;justify-content:center;align-items:center;max-width:min(80%,32rem);padding:.75rem 1.25rem;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.watch-ui__unsupported-text{color:var(--color-white);font-size:.875rem;font-weight:600;line-height:1.4}@media (width<=480px){.watch-ui__unsupported-indicator{max-width:90%;padding:.625rem .875rem}.watch-ui__unsupported-text{font-size:.75rem}}", fe = 2800, $ = class extends HTMLElement {
|
|
630
|
+
var fe = "*,:before,:after{box-sizing:border-box}: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-60:#fff9;--color-white-alpha-70:#ffffffb3;--color-white-alpha-90:#ffffffe6;--color-gray-100:#9ca3af;--color-gray-400:#6b7280;--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-500:#22c55e;--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-red-400:#f87171;--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-60:#0009;--color-black-alpha-85:#000000d9;--color-panel:#121214eb;--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:.375rem;--border-radius-md:.5rem;--border-radius-lg:.75rem;--accent:var(--color-orange-400);--ease:cubic-bezier(.4, 0, .2, 1);font-family:system-ui,Segoe UI,Roboto,sans-serif}.flex-center{justify-content:center;align-items:center;display:flex}.flex-align-center{align-items:center;display:flex}.control{width:2.25rem;height:2.25rem;color:var(--color-white);cursor:pointer;transition:background-color .12s var(--ease), transform .12s var(--ease), color .12s var(--ease);background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.control svg{width:1.25rem;height:1.25rem}.control:hover:not(:disabled){background-color:var(--color-white-alpha-15)}.control:active:not(:disabled){transform:scale(.92)}.control--active{color:var(--accent)}.control:disabled{opacity:.4;cursor:default}.chip{padding:var(--spacing-4) var(--spacing-12);color:var(--color-white-alpha-70);background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid transparent;cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);border-radius:999px;font-size:.75rem;font-weight:500}.chip:hover{background-color:var(--color-white-alpha-20);color:var(--color-white)}.chip--active{color:var(--color-gray-950);background-color:var(--accent);border-color:var(--accent)}:host{display:block;position:relative}.player{border-radius:var(--spacing-8);background:#000;justify-content:center;align-items:center;width:100%;line-height:0;display:flex;position:relative;overflow:hidden}.player ::slotted(moq-watch){width:100%;line-height:0;display:block}.player:not(.player--chrome){cursor:none}.player:fullscreen,.player--pseudo-fullscreen{border-radius:0;justify-content:center;align-items:center;display:flex}.player:-webkit-full-screen{border-radius:0;justify-content:center;align-items:center;display:flex}.player--pseudo-fullscreen{z-index:2147483647;width:100vw;height:100vh;position:fixed;inset:0}@supports (height:100dvh){.player--pseudo-fullscreen{height:100dvh}}.player:fullscreen ::slotted(moq-watch),.player--pseudo-fullscreen ::slotted(moq-watch){width:100%;height:100%;max-height:100%}.player:-webkit-full-screen ::slotted(moq-watch){width:100%;height:100%;max-height:100%}.scrim{pointer-events:none;opacity:0;transition:opacity .2s var(--ease);position:absolute;left:0;right:0}.scrim--top{background:linear-gradient(to bottom, var(--color-black-alpha-40), transparent);height:25%;top:0}.scrim--bottom{background:linear-gradient(to top, var(--color-black-alpha-60), transparent 60%);height:100%;bottom:0}.player--chrome .scrim{opacity:1}.center{pointer-events:none;justify-content:center;align-items:center;line-height:1;display:flex;position:absolute;inset:0}.center-play{pointer-events:auto;width:4.5rem;height:4.5rem;color:var(--color-white);background:linear-gradient(to bottom right, var(--color-orange-400), var(--color-orange-500), var(--color-amber-600));cursor:pointer;box-shadow:0 var(--spacing-8) var(--spacing-24) var(--color-black-alpha-40);transition:transform .15s var(--ease), box-shadow .15s var(--ease);border:none;border-radius:50%}.center-play svg{width:2rem;height:2rem}.center-play:hover{box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-orange-500-alpha-60);transform:scale(1.06)}.center-play:active{transform:scale(.97)}.chrome{opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;justify-content:flex-end;line-height:1.4;display:flex;position:absolute;bottom:0;left:0;right:0;transform:translateY(.5rem)}.player--chrome .chrome{opacity:1;pointer-events:auto;transform:translateY(0)}.controls{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-12) var(--spacing-12);display:flex;position:relative}.controls-group{align-items:center;gap:var(--spacing-4);display:flex}.controls-spacer{flex:1}.volume{gap:var(--spacing-4)}.volume-track{appearance:none;background:linear-gradient(to right, var(--color-white) 0%, var(--color-white) var(--fill,50%), var(--color-white-alpha-30) var(--fill,50%));cursor:pointer;opacity:0;width:0;max-width:0;height:.25rem;transition:width .16s var(--ease), max-width .16s var(--ease), opacity .16s var(--ease);border-radius:999px;outline:none;margin:0}.volume:hover .volume-track,.volume:focus-within .volume-track{opacity:1;width:4.5rem;max-width:4.5rem}.volume-track::-webkit-slider-thumb{appearance:none;background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.volume-track::-moz-range-thumb{background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.badge{gap:var(--spacing-8);height:2.25rem;padding:0 var(--spacing-12);margin-left:var(--spacing-4);color:var(--color-white);border-radius:var(--border-radius-sm);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;font-size:.8125rem}.badge:hover{background-color:var(--color-white-alpha-10)}.badge-dot{background:var(--color-gray-400);border-radius:50%;flex-shrink:0;width:.5rem;height:.5rem}.badge-text{letter-spacing:.04em;font-weight:600}.badge-latency{max-width:0;margin-left:calc(-1 * var(--spacing-8));opacity:0;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--color-white-alpha-60);transition:max-width .16s var(--ease), margin-left .16s var(--ease), opacity .16s var(--ease);overflow:hidden}.badge:hover .badge-latency,.badge:focus-visible .badge-latency{opacity:1;max-width:9rem;margin-left:0}.badge[data-variant=live] .badge-dot{background:var(--color-red-400);animation:badge-pulse 2s var(--ease) infinite;box-shadow:0 0 #f87171b3}.badge[data-variant=live] .badge-text{color:var(--color-red-400)}.badge[data-variant=loading] .badge-dot,.badge[data-variant=connecting] .badge-dot{background:var(--color-yellow-400)}.badge[data-variant=error] .badge-dot{background:var(--color-gray-400)}.badge[data-variant=error] .badge-text{color:var(--color-gray-100)}@keyframes badge-pulse{0%{box-shadow:0 0 #f8717199}70%{box-shadow:0 0 0 .4rem #f8717100}to{box-shadow:0 0 #f8717100}}.panel{top:var(--spacing-8);right:var(--spacing-8);bottom:var(--spacing-8);width:20rem;max-width:calc(100% - var(--spacing-16));background:var(--color-panel);backdrop-filter:blur(12px);border:var(--spacing-1) solid var(--color-white-alpha-15);border-radius:var(--border-radius-lg);box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-black-alpha-60);color:var(--color-white);z-index:4;opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;line-height:1.4;display:flex;position:absolute;overflow:hidden;transform:translate(.75rem)}.panel--open{opacity:1;pointer-events:auto;transform:translate(0)}.panel-head{padding:var(--spacing-8) var(--spacing-8) var(--spacing-8) var(--spacing-16);border-bottom:var(--spacing-1) solid var(--color-white-alpha-10);justify-content:space-between;align-items:center;display:flex}.panel-head-title{gap:var(--spacing-8);font-size:.875rem;font-weight:600}.panel-head-title svg{width:1.125rem;height:1.125rem}.panel-head .control{width:2rem;height:2rem}.panel-tabs{padding:var(--spacing-8);gap:var(--spacing-4);display:flex}.panel-tab{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-4);color:var(--color-white-alpha-60);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease);background:0 0;border:none;flex-direction:column;flex:1;font-size:.6875rem;font-weight:500;display:flex}.panel-tab svg{width:1.125rem;height:1.125rem}.panel-tab:hover{background-color:var(--color-white-alpha-05);color:var(--color-white)}.panel-tab--active{background-color:var(--color-white-alpha-10);color:var(--color-white)}.panel-body{scrollbar-width:thin;scrollbar-color:var(--color-white-alpha-20) transparent;flex:1;min-height:0;overflow-y:auto}.panel-body::-webkit-scrollbar{width:.375rem}.panel-body::-webkit-scrollbar-thumb{background:var(--color-white-alpha-20);border-radius:999px}.tab-body{gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-16) var(--spacing-16);flex-direction:column;display:flex}.tab-empty{padding:var(--spacing-24) 0;text-align:center;color:var(--color-white-alpha-40);font-size:.8125rem}.tab-hint{color:var(--color-white-alpha-40);font-size:.6875rem;line-height:1.5}.q-list{gap:var(--spacing-2)}.q-row{align-items:center;gap:var(--spacing-8);width:100%;padding:var(--spacing-8);text-align:left;color:var(--color-white);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;display:flex}.q-row:hover{background-color:var(--color-white-alpha-05)}.q-row--selected{background-color:var(--color-white-alpha-10)}.q-row-check{width:1rem;color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:flex}.q-row-check svg{width:1rem;height:1rem}.q-row-body{flex-direction:column;gap:.1rem;min-width:0;display:flex}.q-row-title{align-items:center;gap:var(--spacing-8);font-size:.8125rem;font-weight:600;display:flex}.q-row-playing{letter-spacing:.06em;text-transform:uppercase;color:var(--color-green-500);background:var(--color-green-900);padding:.05rem var(--spacing-4);border-radius:var(--border-radius-sm);font-size:.5625rem;font-weight:600}.q-row-sub{color:var(--color-white-alpha-60);text-overflow:ellipsis;white-space:nowrap;font-size:.6875rem;overflow:hidden}.latency-presets{gap:var(--spacing-4);flex-wrap:wrap;display:flex}.latency-readout{gap:var(--spacing-8);display:flex}.latency-stat{gap:var(--spacing-2);padding:var(--spacing-8) var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;flex:1;display:flex}.latency-stat-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.latency-stat-value{font-variant-numeric:tabular-nums;color:var(--accent);font-size:.9375rem;font-weight:600}.stat-card{gap:var(--spacing-8);padding:var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;display:flex}.stat-head{align-items:center;gap:var(--spacing-8);display:flex}.stat-icon{border-radius:var(--border-radius-sm);justify-content:center;align-items:center;width:1.5rem;height:1.5rem;display:flex}.stat-icon svg{width:.875rem;height:.875rem}.stat-title{text-transform:uppercase;letter-spacing:.05em;font-size:.75rem;font-weight:600}.stat-status{letter-spacing:.06em;text-transform:uppercase;color:var(--color-gray-100);background:var(--color-white-alpha-10);padding:.05rem var(--spacing-8);border-radius:var(--border-radius-sm);margin-left:auto;font-size:.5625rem;font-weight:600}.stat-card--video .stat-icon{background:var(--color-purple-900);color:var(--color-purple-400)}.stat-card--video .stat-title{color:var(--color-purple-400)}.stat-card--audio .stat-icon{background:var(--color-green-900);color:var(--color-green-400)}.stat-card--audio .stat-title{color:var(--color-green-400)}.stat-card--network .stat-icon{background:var(--color-blue-900);color:var(--color-blue-400)}.stat-card--network .stat-title{color:var(--color-blue-400)}.stat-grid{gap:var(--spacing-2) var(--spacing-12);grid-template-columns:auto 1fr;display:grid}.stat-line{display:contents}.stat-key{color:var(--color-white-alpha-60);font-size:.75rem}.stat-value{text-align:right;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;font-weight:600;overflow:hidden}.graph{gap:var(--spacing-2);margin-top:var(--spacing-4);flex-direction:column;display:flex}.graph-header{justify-content:space-between;align-items:baseline;display:flex}.graph-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.graph-value{font-variant-numeric:tabular-nums;font-size:.6875rem;font-weight:600}.graph-canvas{width:100%;height:2.5rem;display:block}.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}}.watch-ui__unsupported-indicator{text-align:center;background-color:var(--color-black-alpha-85);z-index:4;pointer-events:auto;border-radius:.25rem;justify-content:center;align-items:center;max-width:min(80%,32rem);padding:.75rem 1.25rem;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.watch-ui__unsupported-text{color:var(--color-white);font-size:.875rem;font-weight:600;line-height:1.4}@media (width<=480px){.watch-ui__unsupported-indicator{max-width:90%;padding:.625rem .875rem}.watch-ui__unsupported-text{font-size:.75rem}}", pe = 2800;
|
|
631
|
+
function me(e) {
|
|
632
|
+
for (let t of [":fullscreen", ":-webkit-full-screen"]) try {
|
|
633
|
+
if (e.matches(t)) return !0;
|
|
634
|
+
} catch {}
|
|
635
|
+
return !1;
|
|
636
|
+
}
|
|
637
|
+
var $ = class extends HTMLElement {
|
|
634
638
|
#e;
|
|
635
639
|
#t;
|
|
636
|
-
#n = new
|
|
640
|
+
#n = new r(void 0);
|
|
637
641
|
#r;
|
|
638
642
|
constructor() {
|
|
639
643
|
super(), this.#t = this.attachShadow({ mode: "open" });
|
|
640
644
|
let e = document.createElement("style");
|
|
641
|
-
e.textContent =
|
|
645
|
+
e.textContent = fe, this.#t.appendChild(e), this.#r = new MutationObserver(() => this.#i());
|
|
642
646
|
}
|
|
643
647
|
connectedCallback() {
|
|
644
648
|
this.#i(), this.#r.observe(this, { childList: !0 });
|
|
645
|
-
let e = new
|
|
649
|
+
let e = new n();
|
|
646
650
|
this.#e = e, e.run(this.#a.bind(this));
|
|
647
651
|
}
|
|
648
652
|
disconnectedCallback() {
|
|
@@ -655,22 +659,22 @@ var de = "*,:before,:after{box-sizing:border-box}:host{--color-white:#fff;--colo
|
|
|
655
659
|
#a(e) {
|
|
656
660
|
let t = e.get(this.#n);
|
|
657
661
|
if (!t) return;
|
|
658
|
-
let
|
|
659
|
-
chrome: new
|
|
660
|
-
panel: new
|
|
661
|
-
tab: new
|
|
662
|
-
}, o =
|
|
663
|
-
o.appendChild(
|
|
664
|
-
let s =
|
|
665
|
-
s.append(
|
|
666
|
-
let c =
|
|
667
|
-
l.append(
|
|
668
|
-
let u =
|
|
669
|
-
o.append(c, s, l, u),
|
|
662
|
+
let n = {
|
|
663
|
+
chrome: new r(!0),
|
|
664
|
+
panel: new r(!1),
|
|
665
|
+
tab: new r("quality")
|
|
666
|
+
}, o = i.create("div", { className: "player" });
|
|
667
|
+
o.appendChild(i.create("slot"));
|
|
668
|
+
let s = i.create("div", { className: "center" });
|
|
669
|
+
s.append(C(e, t), a(e, t), ne(e, t), de(e, t));
|
|
670
|
+
let c = i.create("div", { className: "scrim scrim--top" }), l = i.create("div", { className: "chrome" });
|
|
671
|
+
l.append(i.create("div", { className: "scrim scrim--bottom" }), I(e, t, n, o));
|
|
672
|
+
let u = Q(e, t, n);
|
|
673
|
+
o.append(c, s, l, u), i.render(e, this.#t, o), this.#s(e, t, o), this.#c(e, t, n, o, l, u);
|
|
670
674
|
}
|
|
671
675
|
#o(e) {
|
|
672
676
|
let t = document;
|
|
673
|
-
return this.#t.fullscreenElement === e || document.fullscreenElement === e || t.webkitFullscreenElement === e || e.classList.contains("player--pseudo-fullscreen");
|
|
677
|
+
return this.#t.fullscreenElement === e || document.fullscreenElement === e || t.webkitFullscreenElement === e || me(e) || e.classList.contains("player--pseudo-fullscreen");
|
|
674
678
|
}
|
|
675
679
|
#s(e, t, n) {
|
|
676
680
|
let r = () => {
|
|
@@ -689,21 +693,21 @@ var de = "*,:before,:after{box-sizing:border-box}:host{--color-white:#fff;--colo
|
|
|
689
693
|
attributeFilter: ["class"]
|
|
690
694
|
}), e.cleanup(() => i.disconnect()), e.cleanup(() => a.disconnect()), e.event(document, "fullscreenchange", r), e.event(document, "webkitfullscreenchange", r), e.event(this.#t, "fullscreenchange", r), r();
|
|
691
695
|
}
|
|
692
|
-
#c(e, t,
|
|
696
|
+
#c(e, t, n, i, a, o) {
|
|
693
697
|
if (window.matchMedia("(pointer: coarse)").matches || window.matchMedia("(hover: none)").matches) {
|
|
694
|
-
this.#l(e,
|
|
698
|
+
this.#l(e, n, i, a, o);
|
|
695
699
|
return;
|
|
696
700
|
}
|
|
697
|
-
let s = new
|
|
701
|
+
let s = new r(0), c = () => s.update((e) => e + 1);
|
|
698
702
|
e.event(this, "pointermove", c), e.event(this, "pointerdown", c), e.event(this, "focusin", c);
|
|
699
|
-
let l = () => t.
|
|
703
|
+
let l = () => t.controls.paused.peek() || n.panel.peek();
|
|
700
704
|
e.run((e) => {
|
|
701
|
-
let
|
|
702
|
-
e.get(s),
|
|
705
|
+
let r = e.get(t.controls.paused) || e.get(n.panel);
|
|
706
|
+
e.get(s), n.chrome.set(!0), !r && e.timer(() => n.chrome.set(!1), pe);
|
|
703
707
|
}), e.event(this, "pointerleave", () => {
|
|
704
|
-
l() ||
|
|
708
|
+
l() || n.chrome.set(!1);
|
|
705
709
|
}), e.run((e) => {
|
|
706
|
-
i.classList.toggle("player--chrome", e.get(
|
|
710
|
+
i.classList.toggle("player--chrome", e.get(n.chrome));
|
|
707
711
|
});
|
|
708
712
|
}
|
|
709
713
|
#l(e, t, n, r, i) {
|