boss-web-player-sdk 1.1.11 → 1.1.13
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 +18 -18
- package/dist/boss-web-player-sdk.css +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +23 -0
- package/dist/core.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +87 -1
- package/dist/index.js +1151 -960
- package/dist/index.js.map +1 -1
- package/dist/{src-a2B5ZIDF.js → src-CcXy_WIu.js} +36 -15
- package/dist/{src-a2B5ZIDF.js.map → src-CcXy_WIu.js.map} +1 -1
- package/dist/{src-CsMBVhOP.cjs → src-ynqyJ4on.cjs} +5 -5
- package/dist/{src-CsMBVhOP.cjs.map → src-ynqyJ4on.cjs.map} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, t, u as n } from "./src-
|
|
1
|
+
import { c as e, t, u as n } from "./src-CcXy_WIu.js";
|
|
2
2
|
import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
3
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
4
|
import { createRoot as ee } from "react-dom/client";
|
|
@@ -99,10 +99,10 @@ function te({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
|
|
|
99
99
|
}
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
102
|
-
var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), re = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
103
|
-
let t =
|
|
102
|
+
var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), re = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ie = (e) => {
|
|
103
|
+
let t = h(e);
|
|
104
104
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
105
|
-
},
|
|
105
|
+
}, ae = {
|
|
106
106
|
xmlns: "http://www.w3.org/2000/svg",
|
|
107
107
|
width: 24,
|
|
108
108
|
height: 24,
|
|
@@ -112,37 +112,37 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
112
112
|
strokeWidth: 2,
|
|
113
113
|
strokeLinecap: "round",
|
|
114
114
|
strokeLinejoin: "round"
|
|
115
|
-
},
|
|
115
|
+
}, oe = (e) => {
|
|
116
116
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
117
117
|
return !1;
|
|
118
|
-
},
|
|
119
|
-
let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: p = "currentColor", className: m = "" } =
|
|
118
|
+
}, se = r({}), ce = () => s(se), le = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
|
|
119
|
+
let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: p = "currentColor", className: m = "" } = ce() ?? {}, ee = r ?? f ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
|
|
120
120
|
return i("svg", {
|
|
121
121
|
ref: l,
|
|
122
|
-
...
|
|
123
|
-
width: t ?? u ??
|
|
124
|
-
height: t ?? u ??
|
|
122
|
+
...ae,
|
|
123
|
+
width: t ?? u ?? ae.width,
|
|
124
|
+
height: t ?? u ?? ae.height,
|
|
125
125
|
stroke: e ?? p,
|
|
126
126
|
strokeWidth: ee,
|
|
127
127
|
className: ne("lucide", m, a),
|
|
128
|
-
...!o && !
|
|
128
|
+
...!o && !oe(c) && { "aria-hidden": "true" },
|
|
129
129
|
...c
|
|
130
130
|
}, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]]);
|
|
131
|
-
}),
|
|
132
|
-
let n = a(({ className: n, ...r }, a) => i(
|
|
131
|
+
}), g = (e, t) => {
|
|
132
|
+
let n = a(({ className: n, ...r }, a) => i(le, {
|
|
133
133
|
ref: a,
|
|
134
134
|
iconNode: t,
|
|
135
|
-
className: ne(`lucide-${re(
|
|
135
|
+
className: ne(`lucide-${re(ie(e))}`, `lucide-${e}`, n),
|
|
136
136
|
...r
|
|
137
137
|
}));
|
|
138
|
-
return n.displayName =
|
|
139
|
-
},
|
|
138
|
+
return n.displayName = ie(e), n;
|
|
139
|
+
}, ue = g("airplay", [["path", {
|
|
140
140
|
d: "M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",
|
|
141
141
|
key: "ns4c3b"
|
|
142
142
|
}], ["path", {
|
|
143
143
|
d: "m12 15 5 6H7Z",
|
|
144
144
|
key: "14qnn2"
|
|
145
|
-
}]]),
|
|
145
|
+
}]]), de = g("captions", [["rect", {
|
|
146
146
|
width: "18",
|
|
147
147
|
height: "14",
|
|
148
148
|
x: "3",
|
|
@@ -153,7 +153,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
153
153
|
}], ["path", {
|
|
154
154
|
d: "M7 15h4M15 15h2M7 11h2M13 11h4",
|
|
155
155
|
key: "1ueiar"
|
|
156
|
-
}]]),
|
|
156
|
+
}]]), fe = g("cast", [
|
|
157
157
|
["path", {
|
|
158
158
|
d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",
|
|
159
159
|
key: "3zrzxg"
|
|
@@ -173,19 +173,32 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
173
173
|
y2: "20",
|
|
174
174
|
key: "xu2jvo"
|
|
175
175
|
}]
|
|
176
|
-
]),
|
|
176
|
+
]), _ = g("check", [["path", {
|
|
177
177
|
d: "M20 6 9 17l-5-5",
|
|
178
178
|
key: "1gmf2c"
|
|
179
|
-
}]]),
|
|
179
|
+
}]]), pe = g("chevron-left", [["path", {
|
|
180
180
|
d: "m15 18-6-6 6-6",
|
|
181
181
|
key: "1wnfg3"
|
|
182
|
-
}]]),
|
|
182
|
+
}]]), me = g("external-link", [
|
|
183
|
+
["path", {
|
|
184
|
+
d: "M15 3h6v6",
|
|
185
|
+
key: "1q9fwt"
|
|
186
|
+
}],
|
|
187
|
+
["path", {
|
|
188
|
+
d: "M10 14 21 3",
|
|
189
|
+
key: "gplh6r"
|
|
190
|
+
}],
|
|
191
|
+
["path", {
|
|
192
|
+
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
|
|
193
|
+
key: "a6xqqp"
|
|
194
|
+
}]
|
|
195
|
+
]), he = g("gauge", [["path", {
|
|
183
196
|
d: "m12 14 4-4",
|
|
184
197
|
key: "9kzdfg"
|
|
185
198
|
}], ["path", {
|
|
186
199
|
d: "M3.34 19a10 10 0 1 1 17.32 0",
|
|
187
200
|
key: "19p75a"
|
|
188
|
-
}]]), ge =
|
|
201
|
+
}]]), ge = g("languages", [
|
|
189
202
|
["path", {
|
|
190
203
|
d: "m5 8 6 6",
|
|
191
204
|
key: "1wu5hv"
|
|
@@ -210,7 +223,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
210
223
|
d: "M14 18h6",
|
|
211
224
|
key: "1m8k6r"
|
|
212
225
|
}]
|
|
213
|
-
]), _e =
|
|
226
|
+
]), _e = g("list-video", [
|
|
214
227
|
["path", {
|
|
215
228
|
d: "M21 5H3",
|
|
216
229
|
key: "1fi0y6"
|
|
@@ -227,7 +240,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
227
240
|
d: "M15 12.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z",
|
|
228
241
|
key: "ms4nik"
|
|
229
242
|
}]
|
|
230
|
-
]), ve =
|
|
243
|
+
]), ve = g("maximize", [
|
|
231
244
|
["path", {
|
|
232
245
|
d: "M8 3H5a2 2 0 0 0-2 2v3",
|
|
233
246
|
key: "1dcmit"
|
|
@@ -244,7 +257,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
244
257
|
d: "M16 21h3a2 2 0 0 0 2-2v-3",
|
|
245
258
|
key: "18trek"
|
|
246
259
|
}]
|
|
247
|
-
]), ye =
|
|
260
|
+
]), ye = g("minimize", [
|
|
248
261
|
["path", {
|
|
249
262
|
d: "M8 3v3a2 2 0 0 1-2 2H3",
|
|
250
263
|
key: "hohbtr"
|
|
@@ -261,7 +274,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
261
274
|
d: "M16 21v-3a2 2 0 0 1 2-2h3",
|
|
262
275
|
key: "ph8mxp"
|
|
263
276
|
}]
|
|
264
|
-
]),
|
|
277
|
+
]), v = g("pause", [["rect", {
|
|
265
278
|
x: "14",
|
|
266
279
|
y: "3",
|
|
267
280
|
width: "5",
|
|
@@ -275,7 +288,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
275
288
|
height: "18",
|
|
276
289
|
rx: "1",
|
|
277
290
|
key: "1wsw3u"
|
|
278
|
-
}]]),
|
|
291
|
+
}]]), be = g("picture-in-picture", [
|
|
279
292
|
["path", {
|
|
280
293
|
d: "M2 10h6V4",
|
|
281
294
|
key: "zwrco"
|
|
@@ -300,28 +313,28 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
300
313
|
rx: "1",
|
|
301
314
|
key: "1wjs3o"
|
|
302
315
|
}]
|
|
303
|
-
]),
|
|
316
|
+
]), xe = g("play", [["path", {
|
|
304
317
|
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",
|
|
305
318
|
key: "10ikf1"
|
|
306
|
-
}]]),
|
|
319
|
+
}]]), Se = g("rotate-ccw", [["path", {
|
|
307
320
|
d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
|
|
308
321
|
key: "1357e3"
|
|
309
322
|
}], ["path", {
|
|
310
323
|
d: "M3 3v5h5",
|
|
311
324
|
key: "1xhq8a"
|
|
312
|
-
}]]),
|
|
325
|
+
}]]), Ce = g("rotate-cw", [["path", {
|
|
313
326
|
d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
|
|
314
327
|
key: "1p45f6"
|
|
315
328
|
}], ["path", {
|
|
316
329
|
d: "M21 3v5h-5",
|
|
317
330
|
key: "1q7to0"
|
|
318
|
-
}]]),
|
|
331
|
+
}]]), we = g("volume-1", [["path", {
|
|
319
332
|
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",
|
|
320
333
|
key: "uqj9uw"
|
|
321
334
|
}], ["path", {
|
|
322
335
|
d: "M16 9a5 5 0 0 1 0 6",
|
|
323
336
|
key: "1q6k2b"
|
|
324
|
-
}]]),
|
|
337
|
+
}]]), Te = g("volume-2", [
|
|
325
338
|
["path", {
|
|
326
339
|
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",
|
|
327
340
|
key: "uqj9uw"
|
|
@@ -334,7 +347,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
334
347
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
335
348
|
key: "ijwkga"
|
|
336
349
|
}]
|
|
337
|
-
]),
|
|
350
|
+
]), Ee = g("volume-x", [
|
|
338
351
|
["path", {
|
|
339
352
|
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",
|
|
340
353
|
key: "uqj9uw"
|
|
@@ -353,15 +366,15 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
353
366
|
y2: "15",
|
|
354
367
|
key: "5ykzw1"
|
|
355
368
|
}]
|
|
356
|
-
]),
|
|
369
|
+
]), De = g("volume", [["path", {
|
|
357
370
|
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",
|
|
358
371
|
key: "uqj9uw"
|
|
359
|
-
}]]),
|
|
372
|
+
}]]), Oe = 1e4, ke = !1, Ae = (e) => {
|
|
360
373
|
let t = e.match(/#EXT-X-TITLE:(.+)/);
|
|
361
374
|
if (t?.[1]?.trim()) return t[1].trim();
|
|
362
375
|
let n = e.match(/#EXT-X-SESSION-DATA:[^\n]*DATA-ID="[^"]*title[^"]*"[^\n]*VALUE="([^"]+)"/i);
|
|
363
376
|
return n?.[1]?.trim() ? n[1].trim() : null;
|
|
364
|
-
},
|
|
377
|
+
}, je = (e) => {
|
|
365
378
|
if (!e || e.length < 10 || e[0] !== 73 || e[1] !== 68 || e[2] !== 51) return null;
|
|
366
379
|
let t = e[3], n = (e[6] & 127) << 21 | (e[7] & 127) << 14 | (e[8] & 127) << 7 | e[9] & 127, r = Math.min(10 + n, e.length), i = 10;
|
|
367
380
|
for (; i + 10 <= r;) {
|
|
@@ -374,7 +387,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
374
387
|
i += 10 + a;
|
|
375
388
|
}
|
|
376
389
|
return null;
|
|
377
|
-
},
|
|
390
|
+
}, y = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
|
|
378
391
|
width: e,
|
|
379
392
|
height: e,
|
|
380
393
|
viewBox: "0 0 24 24",
|
|
@@ -394,7 +407,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
394
407
|
/* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
|
|
395
408
|
/* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
|
|
396
409
|
]
|
|
397
|
-
}),
|
|
410
|
+
}), Me = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
|
|
398
411
|
width: e,
|
|
399
412
|
height: e,
|
|
400
413
|
viewBox: "0 0 24 24",
|
|
@@ -414,10 +427,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
414
427
|
/* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
|
|
415
428
|
/* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
|
|
416
429
|
]
|
|
417
|
-
}),
|
|
430
|
+
}), Ne = (e) => {
|
|
418
431
|
let t = e.replace("#", "");
|
|
419
432
|
return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : t.length === 3 ? `${parseInt(t[0] + t[0], 16)}, ${parseInt(t[1] + t[1], 16)}, ${parseInt(t[2] + t[2], 16)}` : "99, 102, 241";
|
|
420
|
-
},
|
|
433
|
+
}, Pe = {
|
|
421
434
|
en: "English",
|
|
422
435
|
eng: "English",
|
|
423
436
|
fr: "French",
|
|
@@ -440,121 +453,121 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
440
453
|
hi: "Hindi",
|
|
441
454
|
ta: "Tamil",
|
|
442
455
|
tam: "Tamil"
|
|
443
|
-
},
|
|
456
|
+
}, Fe = (e) => {
|
|
444
457
|
if (!e) return null;
|
|
445
458
|
let t = e.trim().toLowerCase(), n = t.match(/^(en|eng|fr|fre|fra|es|spa|de|ger|deu|it|ita|pt|por|ja|zh|ko|ru|ar|hi|ta|tam)/);
|
|
446
|
-
if (n &&
|
|
447
|
-
for (let [e, n] of Object.entries(
|
|
459
|
+
if (n && Pe[n[0]]) return Pe[n[0]];
|
|
460
|
+
for (let [e, n] of Object.entries(Pe)) if (t.includes(e)) return n;
|
|
448
461
|
return /english|anglais|ingles/i.test(t) ? "English" : /french|français/i.test(t) ? "French" : /spanish|español/i.test(t) ? "Spanish" : /german|deutsch/i.test(t) ? "German" : /italian|italiano/i.test(t) ? "Italian" : /portuguese|português/i.test(t) ? "Portuguese" : /japanese|nihongo/i.test(t) ? "Japanese" : /chinese|中文/i.test(t) ? "Chinese" : /korean|한국어/i.test(t) ? "Korean" : /tamil|தமிழ்/i.test(t) ? "Tamil" : /russian|русский/i.test(t) ? "Russian" : /arabic|العربية/i.test(t) ? "Arabic" : /hindi|हिन्दी/i.test(t) ? "Hindi" : null;
|
|
449
|
-
},
|
|
462
|
+
}, b = (e) => {
|
|
450
463
|
if (e.lang) {
|
|
451
|
-
let t =
|
|
464
|
+
let t = Fe(e.lang);
|
|
452
465
|
if (t) return t;
|
|
453
466
|
}
|
|
454
467
|
if (e.label) {
|
|
455
468
|
let t = e.label.trim(), n = t.split(/[#\d\.\s\-_/|:]+/).filter(Boolean);
|
|
456
469
|
for (let e = n.length - 1; e >= 0; --e) {
|
|
457
|
-
let t =
|
|
470
|
+
let t = Fe(n[e]);
|
|
458
471
|
if (t) return t;
|
|
459
472
|
}
|
|
460
473
|
let r = t.replace(/^[#\d\.\s]+/, "").trim();
|
|
461
|
-
return
|
|
474
|
+
return Fe(r) || r;
|
|
462
475
|
}
|
|
463
476
|
return "Unknown";
|
|
464
477
|
}, Ie = (e) => {
|
|
465
478
|
let t = /* @__PURE__ */ new Set();
|
|
466
479
|
return e.filter((e) => {
|
|
467
|
-
let n = `${
|
|
480
|
+
let n = `${b(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
|
|
468
481
|
return t.has(n) ? !1 : (t.add(n), !0);
|
|
469
482
|
});
|
|
470
483
|
}, Le = (e) => {
|
|
471
484
|
let t = (e ?? "").split(":").map(Number);
|
|
472
485
|
return (t[0] || 0) * 3600 + (t[1] || 0) * 60 + (t[2] || 0);
|
|
473
|
-
}, Re = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: ee, subtitles: ne = [], watermark: re, themeColor:
|
|
474
|
-
let
|
|
475
|
-
!e ||
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
},
|
|
486
|
+
}, Re = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: ee, subtitles: ne = [], watermark: re, themeColor: h = "#6366f1", drmConfig: ie, firebaseConfig: ae, onAnalyticsEvent: oe, onAdBreakChange: se, onKeyMomentsLoaded: ce, enableControls: le = !0, enableChromecast: g, enableKeyMoments: Pe, enableSubtitles: Fe, enableQuality: Re, enablePlaybackSpeed: ze, enablePiP: Be, enableFullscreen: Ve = !0, autoFullscreen: He = !1, watchProgressInterval: Ue = 30, subtitleStyle: We = {}, resolvedEntitlement: Ge, licenseKey: Ke, title: x, chaptersDisplayMode: qe = "strip", volumeControlType: Je = "slider", urlTransformer: Ye, pauseAdOnTabSwitch: Xe = !0, enableSkipAd: Ze = !1, skipAdAfterSeconds: Qe = 5, overlayAdUrl: $e, adTrackingUrl: et, sources: S, activeSourceIndex: C = 0, onSourceChange: tt, initialTime: w, onTimeUpdate: nt }) => {
|
|
487
|
+
let rt = Ye ?? ((e) => e), T = u(null), it = u(null), at = u(!1), E = u(null), ot = u(0), st = u(null), D = u(null), ct = u(null), lt = u(null), ut = u(!1), O = u(!1), k = u(null), A = u(null), j = u(null), dt = u(null), ft = u(() => {}), M = u(null), pt = u(null), mt = (e) => {
|
|
488
|
+
!e || pt.current !== null || (pt.current = e.muted, e.muted = !0);
|
|
489
|
+
}, ht = (e) => {
|
|
490
|
+
pt.current !== null && (e && (e.muted = pt.current), pt.current = null);
|
|
491
|
+
}, gt = u(null), _t = u(null), vt = u(null), yt = u(null), N = u(null), bt = u(null), xt = u(S), St = u(tt), Ct = u(!1), P = u(null), F = u(null), I = u(null), wt = u(0), [Tt, Et] = d(!1), Dt = u(!1), Ot = u(null), [kt, At] = d(null);
|
|
479
492
|
c(() => {
|
|
480
|
-
if (typeof window > "u" ||
|
|
493
|
+
if (typeof window > "u" || ke) return;
|
|
481
494
|
let e = window.requestAnimationFrame(() => {
|
|
482
|
-
let e =
|
|
495
|
+
let e = T.current;
|
|
483
496
|
if (!e) return;
|
|
484
497
|
let t = window.getComputedStyle(e);
|
|
485
|
-
t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (
|
|
498
|
+
t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (ke = !0, console.warn("[boss-web-player-sdk] Player styles appear to be missing — the player will look broken/unstyled.\nImport the stylesheet once at your app entry point:\n import 'boss-web-player-sdk/css';"));
|
|
486
499
|
});
|
|
487
500
|
return () => window.cancelAnimationFrame(e);
|
|
488
501
|
}, []), c(() => {
|
|
489
|
-
let e =
|
|
502
|
+
let e = T.current;
|
|
490
503
|
if (!e) return;
|
|
491
504
|
let t = new ResizeObserver((e) => {
|
|
492
|
-
for (let t of e)
|
|
505
|
+
for (let t of e) Et(t.contentRect.width <= 768);
|
|
493
506
|
});
|
|
494
|
-
return t.observe(e),
|
|
507
|
+
return t.observe(e), Et(e.getBoundingClientRect().width <= 768), () => t.disconnect();
|
|
495
508
|
}, []);
|
|
496
|
-
let [
|
|
497
|
-
enableSubtitles:
|
|
498
|
-
enableChromecast:
|
|
499
|
-
enableKeyMoments:
|
|
500
|
-
enableQuality:
|
|
501
|
-
enablePlaybackSpeed:
|
|
502
|
-
enablePiP:
|
|
503
|
-
allowAirplay:
|
|
504
|
-
allowMultipleAudio:
|
|
505
|
-
m3u8_playback:
|
|
506
|
-
drm_protection:
|
|
507
|
-
}, [It, Lt] = d(!1), [Rt, zt] = d(0), [Bt, Vt] = d(!1), [
|
|
508
|
-
|
|
509
|
-
let
|
|
509
|
+
let [L, jt] = d(null), Mt = Ge ?? null, Nt = Mt != null, Pt = Mt?.features ?? {}, Ft = Nt ? !!(Pt.drm_protection && !Ke) : !1, R = {
|
|
510
|
+
enableSubtitles: Nt ? !!Pt.subtitle_support : typeof Fe == "boolean" ? Fe : !0,
|
|
511
|
+
enableChromecast: Nt ? !!Pt.chromecast : typeof g == "boolean" ? g : !0,
|
|
512
|
+
enableKeyMoments: Nt ? !!Pt.key_moments : typeof Pe == "boolean" ? Pe : !0,
|
|
513
|
+
enableQuality: Nt ? !!Pt.multiple_resolution : typeof Re == "boolean" ? Re : !0,
|
|
514
|
+
enablePlaybackSpeed: Nt ? !!Pt.playback_speed : typeof ze == "boolean" ? ze : !0,
|
|
515
|
+
enablePiP: Nt ? !!Pt.picture_in_picture : typeof Be == "boolean" ? Be : !0,
|
|
516
|
+
allowAirplay: Nt ? !!Pt.airplay : !1,
|
|
517
|
+
allowMultipleAudio: Nt ? !!Pt.multiple_audio : !0,
|
|
518
|
+
m3u8_playback: Nt ? !!Pt.m3u8_playback : !0,
|
|
519
|
+
drm_protection: Nt ? !!Pt.drm_protection : !1
|
|
520
|
+
}, [It, Lt] = d(!1), [Rt, zt] = d(0), [Bt, Vt] = d(!1), [z, Ht] = d(0), [Ut, Wt] = d(0), [Gt, Kt] = d(1), [qt, Jt] = d(!1), [Yt, Xt] = d(!1), [Zt, Qt] = d(!1), [$t, en] = d(!1), [tn, nn] = d(!1), rn = Tt || (Zt || $t) && tn, [an, on] = d(!1), [sn, cn] = d(!1), [B, ln] = d([]), V = u([]), un = u(/* @__PURE__ */ new Set()), dn = S && S.length > 0 ? S.map((e) => e.url).join("|") : r, [fn, pn] = d(/* @__PURE__ */ new Set()), [mn, hn] = d(dn), gn = u(null), _n = u(!1), vn = u(null);
|
|
521
|
+
mn !== dn && (hn(dn), pn(/* @__PURE__ */ new Set()), un.current = /* @__PURE__ */ new Set(), gn.current = null, _n.current = !1);
|
|
522
|
+
let yn = u(null), bn = u(!1), [xn, Sn] = d([]), [Cn, wn] = d(null), Tn = u([]), En = u(null), Dn = u(/* @__PURE__ */ new Set()), [On, kn] = d([]), An = u([]), jn = l(() => B.reduce((e, t) => e + (t.endTime - t.startTime), 0), [B]), Mn = Ut > 0 ? Math.max(0, Ut - jn) : 0, H = B.length > 0 && Mn > 0 ? Mn : Ut, U = o((e) => {
|
|
510
523
|
let t = e;
|
|
511
|
-
for (let n of
|
|
524
|
+
for (let n of B) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
|
|
512
525
|
return Math.max(0, t);
|
|
513
|
-
}, [
|
|
526
|
+
}, [B]), W = o((e) => {
|
|
514
527
|
let t = e;
|
|
515
|
-
for (let e of
|
|
528
|
+
for (let e of B) t >= e.startTime && (t += e.endTime - e.startTime);
|
|
516
529
|
return t;
|
|
517
|
-
}, [
|
|
530
|
+
}, [B]), [Nn, Pn] = d([]), [Fn, In] = d({
|
|
518
531
|
id: -1,
|
|
519
532
|
height: 0,
|
|
520
533
|
width: 0,
|
|
521
534
|
bitrate: 0,
|
|
522
535
|
label: "Auto"
|
|
523
|
-
}), [
|
|
536
|
+
}), [Ln, Rn] = d(""), [G, zn] = d("off"), [Bn, Vn] = d(Ie(ne)), [Hn, Un] = d([]), [Wn, Gn] = d(0);
|
|
524
537
|
c(() => {
|
|
525
|
-
if (
|
|
526
|
-
let e =
|
|
527
|
-
|
|
528
|
-
} else
|
|
529
|
-
}, [ne.map((e) => e.id).join(","),
|
|
530
|
-
let [
|
|
538
|
+
if (L) {
|
|
539
|
+
let e = L.subtitles.getTracks();
|
|
540
|
+
Vn(Ie([...ne, ...e.filter((e) => !ne.some((t) => t.id === e.id))]));
|
|
541
|
+
} else Vn(Ie(ne));
|
|
542
|
+
}, [ne.map((e) => e.id).join(","), L]);
|
|
543
|
+
let [Kn, qn] = d({
|
|
531
544
|
chapter: null,
|
|
532
545
|
index: -1
|
|
533
|
-
}), [
|
|
546
|
+
}), [K, Jn] = d(ee || s || []), [q, J] = d("none"), [Yn, Xn] = d(1), [Zn, Qn] = d(!1), [$n, er] = d({}), [tr, nr] = d(""), [rr, ir] = d(null), ar = u(!1), or = JSON.stringify(K.map((e) => ({
|
|
534
547
|
title: e.title,
|
|
535
548
|
startTime: e.startTime
|
|
536
549
|
})));
|
|
537
550
|
c(() => {
|
|
538
|
-
|
|
551
|
+
Jn(ee || s || []);
|
|
539
552
|
}, [(ee || s || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), c(() => {
|
|
540
|
-
if (!r || !
|
|
541
|
-
|
|
553
|
+
if (!r || !K || K.length === 0) return;
|
|
554
|
+
er({});
|
|
542
555
|
let e = document.createElement("video");
|
|
543
556
|
e.muted = !0, e.preload = "metadata", e.crossOrigin = "anonymous", e.style.cssText = "position:fixed;top:0;left:0;width:10px;height:10px;opacity:0.01;pointer-events:none;z-index:-9999;", document.body.appendChild(e);
|
|
544
557
|
let t = null, i = r.includes(".m3u8"), a = document.createElement("canvas");
|
|
545
558
|
a.width = 160, a.height = 90;
|
|
546
559
|
let o = a.getContext("2d"), s = 0, c = !1, l = () => {
|
|
547
|
-
if (s >=
|
|
560
|
+
if (s >= K.length) {
|
|
548
561
|
f();
|
|
549
562
|
return;
|
|
550
563
|
}
|
|
551
|
-
let t =
|
|
564
|
+
let t = K[s].startTime;
|
|
552
565
|
e.currentTime = t === 0 ? .01 : t;
|
|
553
566
|
}, u = () => {
|
|
554
567
|
if (o && e.readyState >= 2) {
|
|
555
568
|
o.drawImage(e, 0, 0, a.width, a.height);
|
|
556
569
|
let t = a.toDataURL("image/jpeg", .8);
|
|
557
|
-
|
|
570
|
+
er((e) => ({
|
|
558
571
|
...e,
|
|
559
572
|
[s]: t
|
|
560
573
|
})), s++, l();
|
|
@@ -566,37 +579,37 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
566
579
|
enableWorker: !1,
|
|
567
580
|
maxBufferLength: 5,
|
|
568
581
|
xhrSetup: (e, t) => {
|
|
569
|
-
let n =
|
|
582
|
+
let n = ie?.authToken;
|
|
570
583
|
try {
|
|
571
|
-
let r =
|
|
584
|
+
let r = rt(t), i = new URL(r, window.location.origin);
|
|
572
585
|
n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
|
|
573
586
|
} catch (e) {
|
|
574
587
|
console.error("[WebVideoPlayer tempHls] xhrSetup error:", e);
|
|
575
588
|
}
|
|
576
589
|
}
|
|
577
|
-
}), t.loadSource(
|
|
590
|
+
}), t.loadSource(rt(r)), t.attachMedia(e)) : e.src = r, e.readyState >= 2 && d();
|
|
578
591
|
let f = () => {
|
|
579
592
|
e.removeEventListener("seeked", u), e.removeEventListener("canplay", d), t && t.destroy(), document.body.contains(e) && document.body.removeChild(e);
|
|
580
593
|
};
|
|
581
594
|
return f;
|
|
582
|
-
}, [r,
|
|
583
|
-
let [
|
|
595
|
+
}, [r, or]);
|
|
596
|
+
let [Y, sr] = d(null), [cr, lr] = d(null), ur = u(!1), [dr, fr] = d(!1), [pr, mr] = d(!1), [hr, gr] = d(null), [_r, vr] = d(null), [yr, br] = d(0), [xr, Sr] = d(0), [Cr, wr] = d(null), [Tr, Er] = d(null), [X, Dr] = d(null);
|
|
584
597
|
c(() => {
|
|
585
|
-
if (
|
|
598
|
+
if (dt.current && !dt.current.querySelector("google-cast-launcher")) {
|
|
586
599
|
let e = document.createElement("google-cast-launcher");
|
|
587
|
-
e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block",
|
|
600
|
+
e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", dt.current.appendChild(e);
|
|
588
601
|
}
|
|
589
602
|
}, []), c(() => {
|
|
590
|
-
if (!
|
|
591
|
-
|
|
603
|
+
if (!L) {
|
|
604
|
+
fr(!1), mr(!1), gr(null);
|
|
592
605
|
return;
|
|
593
606
|
}
|
|
594
|
-
let e = (e) =>
|
|
595
|
-
let e =
|
|
596
|
-
|
|
607
|
+
let e = (e) => fr(e), t = () => {
|
|
608
|
+
let e = L.getVideoElement(), t = !!e?.webkitCurrentPlaybackTargetIsWireless;
|
|
609
|
+
mr(t), gr(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
|
|
597
610
|
};
|
|
598
|
-
e(
|
|
599
|
-
let n =
|
|
611
|
+
e(L.casting.isAirPlayAvailable()), t();
|
|
612
|
+
let n = L.getVideoElement(), r = (t) => {
|
|
600
613
|
e(t.availability === "available");
|
|
601
614
|
}, i = () => {
|
|
602
615
|
t();
|
|
@@ -604,69 +617,69 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
604
617
|
return "webkitShowPlaybackTargetPicker" in n && (n.addEventListener("webkitplaybacktargetavailabilitychanged", r), n.addEventListener("webkitcurrentplaybacktargetiswirelesschanged", i)), () => {
|
|
605
618
|
"webkitShowPlaybackTargetPicker" in n && (n.removeEventListener("webkitplaybacktargetavailabilitychanged", r), n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", i));
|
|
606
619
|
};
|
|
607
|
-
}, [
|
|
608
|
-
let [
|
|
609
|
-
|
|
610
|
-
let e =
|
|
611
|
-
|
|
612
|
-
|
|
620
|
+
}, [L]);
|
|
621
|
+
let [Or, kr] = d(""), [Ar, jr] = d(!0), [Z, Mr] = d(!1), Nr = u(null), Pr = u(!1), Fr = u(!1), Ir = u("none"), Lr = u(ne), Rr = () => {
|
|
622
|
+
jr(!0), Nr.current && window.clearTimeout(Nr.current);
|
|
623
|
+
let e = Dt.current ? 3500 : 1e4;
|
|
624
|
+
Nr.current = window.setTimeout(() => {
|
|
625
|
+
Pr.current && Ir.current === "none" && jr(!1);
|
|
613
626
|
}, e);
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
let t =
|
|
617
|
-
|
|
627
|
+
}, zr = o((e) => {
|
|
628
|
+
N.current &&= (clearTimeout(N.current), null);
|
|
629
|
+
let t = xt.current, n = t?.[e]?.label ?? "This format", r = t?.[0]?.label ?? "default";
|
|
630
|
+
bt.current = null, ir(`${n} isn't supported on this device. Switched to ${r}.`), window.setTimeout(() => ir(null), 4e3), St.current?.(0);
|
|
618
631
|
}, []);
|
|
619
632
|
c(() => {
|
|
620
|
-
if (!
|
|
633
|
+
if (!T.current) return;
|
|
621
634
|
let o = document.createElement("video");
|
|
622
|
-
o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o),
|
|
635
|
+
o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o), D.current = o;
|
|
623
636
|
let s = r.includes(".m3u8");
|
|
624
637
|
if (s && n.isSupported()) {
|
|
625
638
|
let e = new n({
|
|
626
639
|
enableWorker: !1,
|
|
627
640
|
maxBufferLength: 5,
|
|
628
641
|
xhrSetup: (e, t) => {
|
|
629
|
-
let n =
|
|
642
|
+
let n = ie?.authToken;
|
|
630
643
|
try {
|
|
631
|
-
let r =
|
|
644
|
+
let r = rt(t), i = new URL(r, window.location.origin);
|
|
632
645
|
n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
|
|
633
646
|
} catch (e) {
|
|
634
647
|
console.error("[WebVideoPlayer hiddenHls] xhrSetup error:", e);
|
|
635
648
|
}
|
|
636
649
|
}
|
|
637
650
|
});
|
|
638
|
-
e.loadSource(
|
|
639
|
-
if (
|
|
640
|
-
let n =
|
|
641
|
-
n &&
|
|
651
|
+
e.loadSource(rt(r)), e.attachMedia(o), ct.current = e, e.on(n.Events.MANIFEST_LOADED, (e, t) => {
|
|
652
|
+
if (x) return;
|
|
653
|
+
let n = Ae(t?.networkDetails?.responseText ?? "");
|
|
654
|
+
n && kr(n);
|
|
642
655
|
}), e.on(n.Events.FRAG_PARSING_METADATA, (e, t) => {
|
|
643
|
-
if (!(
|
|
644
|
-
let t =
|
|
656
|
+
if (!(x || Or)) for (let e of t?.samples ?? []) {
|
|
657
|
+
let t = je(e.data);
|
|
645
658
|
if (t) {
|
|
646
|
-
|
|
659
|
+
kr(t);
|
|
647
660
|
break;
|
|
648
661
|
}
|
|
649
662
|
}
|
|
650
663
|
});
|
|
651
664
|
} else s && o.canPlayType("application/vnd.apple.mpegurl"), o.src = r;
|
|
652
665
|
o.addEventListener("seeked", () => {
|
|
653
|
-
let e =
|
|
666
|
+
let e = st.current;
|
|
654
667
|
if (!e) return;
|
|
655
668
|
let t = e.getContext("2d");
|
|
656
|
-
t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height),
|
|
669
|
+
t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height), wr(e.toDataURL("image/jpeg", .82)));
|
|
657
670
|
});
|
|
658
671
|
let c;
|
|
659
|
-
if (
|
|
660
|
-
let t = new e(
|
|
661
|
-
|
|
672
|
+
if (ae) {
|
|
673
|
+
let t = new e(ae);
|
|
674
|
+
it.current = t, c = t.createCallback();
|
|
662
675
|
}
|
|
663
676
|
if (Ft) return;
|
|
664
677
|
let l = new t({
|
|
665
|
-
container:
|
|
678
|
+
container: T.current,
|
|
666
679
|
src: r,
|
|
667
680
|
autoplay: i,
|
|
668
681
|
muted: a,
|
|
669
|
-
keyMoments:
|
|
682
|
+
keyMoments: K,
|
|
670
683
|
subtitles: ne,
|
|
671
684
|
drm: {
|
|
672
685
|
watermarkText: re,
|
|
@@ -675,193 +688,201 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
675
688
|
"127.0.0.1",
|
|
676
689
|
window.location.hostname
|
|
677
690
|
],
|
|
678
|
-
...
|
|
691
|
+
...ie
|
|
679
692
|
},
|
|
680
693
|
analyticsCallback: (e) => {
|
|
681
|
-
if (e.sessionId && (
|
|
694
|
+
if (e.sessionId && (gn.current === null ? gn.current = e.sessionId : e.sessionId !== gn.current && (e = {
|
|
682
695
|
...e,
|
|
683
|
-
sessionId:
|
|
696
|
+
sessionId: gn.current
|
|
684
697
|
})), e.eventType === "session_start") {
|
|
685
|
-
if (
|
|
686
|
-
|
|
698
|
+
if (_n.current) return;
|
|
699
|
+
_n.current = !0;
|
|
687
700
|
}
|
|
688
|
-
c?.(e),
|
|
701
|
+
c?.(e), oe && oe(e);
|
|
689
702
|
},
|
|
690
|
-
analyticsSessionSeed:
|
|
703
|
+
analyticsSessionSeed: vn.current?.key === dn ? vn.current.snapshot : void 0,
|
|
691
704
|
watchProgressInterval: Ue * 1e3,
|
|
692
|
-
themeColor:
|
|
705
|
+
themeColor: h,
|
|
693
706
|
urlTransformer: Ye
|
|
694
707
|
});
|
|
695
708
|
l.on("keymomentsloaded", (e) => {
|
|
696
|
-
|
|
709
|
+
Jn(e), ce && ce(e);
|
|
697
710
|
}), l.on("chaptersloaded", (e) => {
|
|
698
|
-
|
|
711
|
+
Jn(e), ce && ce(e);
|
|
699
712
|
}), l.on("play", () => {
|
|
700
|
-
Vt(!0),
|
|
701
|
-
}), l.on("pause", () =>
|
|
702
|
-
Vt(!1),
|
|
713
|
+
Vt(!0), cn(!1), p(l.getCurrentTime(), 1);
|
|
714
|
+
}), l.on("pause", () => {
|
|
715
|
+
Vt(!1), p(l.getCurrentTime(), 0);
|
|
716
|
+
}), l.on("ended", () => {
|
|
717
|
+
Vt(!1), cn(!0);
|
|
703
718
|
});
|
|
704
719
|
let u = () => {
|
|
705
|
-
|
|
720
|
+
M.current && (M.current.style.opacity = "1"), mt(l.getVideoElement());
|
|
706
721
|
}, d = () => {
|
|
707
722
|
requestAnimationFrame(() => {
|
|
708
723
|
requestAnimationFrame(() => {
|
|
709
|
-
|
|
724
|
+
M.current && (M.current.style.opacity = "0"), ht(l.getVideoElement());
|
|
710
725
|
});
|
|
711
726
|
});
|
|
712
727
|
}, f = (e) => {
|
|
713
|
-
|
|
714
|
-
let t =
|
|
715
|
-
|
|
716
|
-
|
|
728
|
+
O.current = !0;
|
|
729
|
+
let t = _t.current ?? e + .5;
|
|
730
|
+
_t.current = null, k.current = t, A.current = l.getCurrentTime(), u(), l.seek(t), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
731
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, d();
|
|
717
732
|
}, 3e3);
|
|
718
733
|
};
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
734
|
+
gt.current = f;
|
|
735
|
+
let p = (e, t) => {
|
|
736
|
+
if (!("mediaSession" in navigator) || !navigator.mediaSession.setPositionState) return;
|
|
737
|
+
let n = l.getDuration(), r = V.current.find((t) => e >= t.startTime && e < t.endTime);
|
|
738
|
+
if (r) {
|
|
739
|
+
let n = r.endTime - r.startTime, i = Math.max(0, e - r.startTime);
|
|
740
|
+
if (n > 0) try {
|
|
741
|
+
navigator.mediaSession.setPositionState({
|
|
742
|
+
duration: n,
|
|
743
|
+
playbackRate: t,
|
|
744
|
+
position: Math.min(i, n)
|
|
745
|
+
});
|
|
746
|
+
} catch {}
|
|
747
|
+
} else {
|
|
748
|
+
let r = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), i = n > 0 ? Math.max(0, n - r) : 0, a = e;
|
|
749
|
+
for (let t of V.current) e >= t.endTime ? a -= t.endTime - t.startTime : e >= t.startTime && (a -= e - t.startTime);
|
|
750
|
+
a = Math.max(0, a);
|
|
751
|
+
let o = V.current.length > 0 && i > 0 ? i : n;
|
|
752
|
+
if (o > 0) try {
|
|
753
|
+
navigator.mediaSession.setPositionState({
|
|
754
|
+
duration: o,
|
|
755
|
+
playbackRate: t,
|
|
756
|
+
position: Math.min(a, o)
|
|
757
|
+
});
|
|
758
|
+
} catch {}
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
if (l.on("timeupdate", (e) => {
|
|
762
|
+
if (!O.current && F.current === null) {
|
|
763
|
+
let t = V.current.find((t) => un.current.has(t.startTime) && e >= t.startTime - .5 && e < t.endTime);
|
|
722
764
|
if (t) {
|
|
723
765
|
f(t.endTime);
|
|
724
766
|
return;
|
|
725
767
|
}
|
|
726
|
-
|
|
768
|
+
_t.current !== null && V.current.find((t) => e >= t.endTime - .5 && e < t.endTime) && u();
|
|
769
|
+
}
|
|
770
|
+
if (O.current && k.current !== null) {
|
|
771
|
+
let t = k.current;
|
|
772
|
+
if (A.current !== null && t < A.current ? e <= t + 2 && e >= t - 2 : e >= t - 2) O.current = !1, k.current = null, A.current = null, j.current &&= (window.clearTimeout(j.current), null), !V.current.some((t) => e >= t.startTime && e < t.endTime) && _t.current === null && d();
|
|
773
|
+
else return;
|
|
727
774
|
}
|
|
728
|
-
|
|
729
|
-
else return;
|
|
730
|
-
Ht(e), Tt.current = e;
|
|
775
|
+
Ht(e), wt.current = e;
|
|
731
776
|
let t = l.getDuration();
|
|
732
|
-
if (Wt(t),
|
|
733
|
-
|
|
734
|
-
let t =
|
|
777
|
+
if (Wt(t), F.current !== null && e >= F.current - 2) {
|
|
778
|
+
F.current = null, I.current &&= (window.clearTimeout(I.current), null);
|
|
779
|
+
let t = V.current.find((t) => un.current.has(t.startTime) && e >= t.startTime && e < t.endTime);
|
|
735
780
|
t && f(t.endTime), requestAnimationFrame(() => {
|
|
736
781
|
requestAnimationFrame(() => {
|
|
737
|
-
|
|
782
|
+
P.current && (P.current.style.opacity = "0");
|
|
738
783
|
});
|
|
739
784
|
});
|
|
740
785
|
}
|
|
741
|
-
if (!
|
|
742
|
-
|
|
743
|
-
}, 4e3)),
|
|
744
|
-
let t =
|
|
745
|
-
(e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (
|
|
786
|
+
if (!Ct.current && yt.current === null && w && w > 0 && t > 0 && w < t && (Ct.current = !0, F.current = w, l.seek(w), I.current && window.clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
787
|
+
F.current = null, I.current = null, P.current && (P.current.style.opacity = "0");
|
|
788
|
+
}, 4e3)), nt?.(e), Tn.current.length > 0) if (En.current) {
|
|
789
|
+
let t = En.current;
|
|
790
|
+
(e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (wn(null), En.current = null);
|
|
746
791
|
} else {
|
|
747
|
-
let t =
|
|
748
|
-
t && (
|
|
792
|
+
let t = Tn.current.find((t) => e >= t.startTimeSeconds && e < t.startTimeSeconds + t.durationSeconds && !Dn.current.has(t.availId));
|
|
793
|
+
t && (wn(t), En.current = t, t.impressionBeacons.forEach((e) => {
|
|
749
794
|
fetch(e, { mode: "no-cors" }).catch(() => {});
|
|
750
795
|
}));
|
|
751
796
|
}
|
|
752
797
|
let n = l.keyMoments.getCurrentMoment(e);
|
|
753
|
-
|
|
798
|
+
qn({
|
|
754
799
|
chapter: n.keyMoment,
|
|
755
800
|
index: n.index
|
|
756
|
-
}),
|
|
757
|
-
let t = l.getDuration(), n = B.current.find((t) => e >= t.startTime && e < t.endTime);
|
|
758
|
-
if (n) {
|
|
759
|
-
let t = n.endTime - n.startTime, r = Math.max(0, e - n.startTime);
|
|
760
|
-
if (t > 0) try {
|
|
761
|
-
navigator.mediaSession.setPositionState({
|
|
762
|
-
duration: t,
|
|
763
|
-
playbackRate: 1,
|
|
764
|
-
position: Math.min(r, t)
|
|
765
|
-
});
|
|
766
|
-
} catch {}
|
|
767
|
-
} else {
|
|
768
|
-
let n = B.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), r = t > 0 ? Math.max(0, t - n) : 0, i = e;
|
|
769
|
-
for (let t of B.current) e >= t.endTime ? i -= t.endTime - t.startTime : e >= t.startTime && (i -= e - t.startTime);
|
|
770
|
-
i = Math.max(0, i);
|
|
771
|
-
let a = B.current.length > 0 && r > 0 ? r : t;
|
|
772
|
-
if (a > 0) try {
|
|
773
|
-
navigator.mediaSession.setPositionState({
|
|
774
|
-
duration: a,
|
|
775
|
-
playbackRate: 1,
|
|
776
|
-
position: Math.min(i, a)
|
|
777
|
-
});
|
|
778
|
-
} catch {}
|
|
779
|
-
}
|
|
780
|
-
}
|
|
801
|
+
}), p(e, +!l.getVideoElement().paused);
|
|
781
802
|
}), l.on("qualitylevels", (e) => {
|
|
782
|
-
|
|
803
|
+
Pn(e);
|
|
783
804
|
}), l.on("qualitychange", (e) => {
|
|
784
|
-
|
|
805
|
+
In(e);
|
|
785
806
|
}), l.on("buffering", (e) => {
|
|
786
|
-
if (Xt(e), !e && (
|
|
787
|
-
let e =
|
|
788
|
-
|
|
789
|
-
|
|
807
|
+
if (Xt(e), !e && (N.current &&= (clearTimeout(N.current), null), bt.current = null, yt.current !== null)) {
|
|
808
|
+
let e = yt.current;
|
|
809
|
+
yt.current = null, Ct.current = !0, F.current = e, I.current && window.clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
810
|
+
F.current = null, I.current = null, P.current && (P.current.style.opacity = "0");
|
|
790
811
|
}, 4e3), l.seek(e);
|
|
791
812
|
}
|
|
792
813
|
}), l.on("adbreakchange", (e) => {
|
|
793
|
-
if (l.analytics.setAdBreak(e, l.getVideoElement()),
|
|
794
|
-
let e = l.getCurrentTime(), t =
|
|
795
|
-
if (t &&
|
|
796
|
-
u(),
|
|
814
|
+
if (l.analytics.setAdBreak(e, l.getVideoElement()), se && se(e), e) {
|
|
815
|
+
let e = l.getCurrentTime(), t = V.current.find((t) => e >= t.startTime && e < t.endTime);
|
|
816
|
+
if (t && un.current.has(t.startTime)) {
|
|
817
|
+
u(), O.current || f(t.endTime);
|
|
797
818
|
return;
|
|
798
819
|
}
|
|
799
|
-
t && (
|
|
800
|
-
} else if (
|
|
801
|
-
let e =
|
|
802
|
-
|
|
803
|
-
|
|
820
|
+
t && (yn.current = t.startTime), Mr(!0), J("none"), d();
|
|
821
|
+
} else if (yn.current !== null && (un.current.add(yn.current), pn(new Set(un.current)), yn.current = null), Mr(!1), _t.current !== null) {
|
|
822
|
+
let e = _t.current;
|
|
823
|
+
_t.current = null, O.current = !0, k.current = e, A.current = l.getCurrentTime(), u(), l.seek(e), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
824
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, d();
|
|
804
825
|
}, 3e3);
|
|
805
826
|
}
|
|
806
827
|
}), l.on("adbreaksloaded", (e) => {
|
|
807
|
-
|
|
828
|
+
V.current = e, ln(e);
|
|
808
829
|
}), l.on("volumechange", (e) => {
|
|
809
|
-
Kt(e.volume),
|
|
830
|
+
Kt(e.volume), pt.current === null && Jt(e.muted);
|
|
810
831
|
}), l.on("pipchange", (e) => {
|
|
811
|
-
|
|
832
|
+
on(e);
|
|
812
833
|
}), l.on("error", () => {
|
|
813
|
-
Lt(!0), Xt(!1),
|
|
834
|
+
Lt(!0), Xt(!1), F.current = null, I.current &&= (window.clearTimeout(I.current), null), P.current && (P.current.style.opacity = "0");
|
|
814
835
|
}), l.on("unsupportedcodec", () => {
|
|
815
|
-
let e =
|
|
816
|
-
e && e.targetIdx !== 0 && (
|
|
836
|
+
let e = bt.current;
|
|
837
|
+
e && e.targetIdx !== 0 && (xt.current?.length ?? 0) > 1 && zr(e.targetIdx);
|
|
817
838
|
}), l.subtitles.onSubtitleChange((e) => {
|
|
818
|
-
|
|
839
|
+
Rn(e);
|
|
819
840
|
}), l.on("subtitlesloaded", (e) => {
|
|
820
|
-
if (!
|
|
821
|
-
|
|
841
|
+
if (!R.enableSubtitles) return;
|
|
842
|
+
Vn(Ie([...e]));
|
|
822
843
|
let t = e.find((e) => e.isDefault);
|
|
823
|
-
t && (l.subtitles.setActiveTrack(t.id),
|
|
844
|
+
t && (l.subtitles.setActiveTrack(t.id), zn(t.id));
|
|
824
845
|
}), l.on("audiotracksloaded", (e) => {
|
|
825
|
-
|
|
846
|
+
Un(e), Gn(e[0]?.id ?? 0);
|
|
826
847
|
}), l.on("audiotrackchange", (e) => {
|
|
827
|
-
|
|
848
|
+
Gn(e);
|
|
828
849
|
}), l.casting.onCastStateChange((e, t) => {
|
|
829
850
|
if (e) {
|
|
830
|
-
|
|
851
|
+
ur.current = l.isMuted(), l.pause();
|
|
831
852
|
let e = l.getVideoElement();
|
|
832
|
-
e.muted = !0,
|
|
853
|
+
e.muted = !0, sr(t);
|
|
833
854
|
} else {
|
|
834
855
|
let e = l.casting.getRemoteState();
|
|
835
|
-
e && e.currentTime > 0 && (
|
|
836
|
-
|
|
856
|
+
e && e.currentTime > 0 && (O.current = !0, k.current = e.currentTime, A.current = l.getCurrentTime(), l.seek(e.currentTime), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
857
|
+
O.current = !1, k.current = null, A.current = null, j.current = null;
|
|
837
858
|
}, 3e3));
|
|
838
859
|
let t = l.getVideoElement();
|
|
839
|
-
t.muted =
|
|
860
|
+
t.muted = ur.current, sr(null), lr(null);
|
|
840
861
|
}
|
|
841
862
|
}), l.casting.onRemoteStateChange((e) => {
|
|
842
|
-
|
|
863
|
+
lr(e);
|
|
843
864
|
}), Kt(l.getVolume()), Jt(l.isMuted()), "mediaSession" in navigator) try {
|
|
844
865
|
navigator.mediaSession.setActionHandler("seekto", (e) => {
|
|
845
|
-
if (e.seekTime == null ||
|
|
866
|
+
if (e.seekTime == null || Fr.current) return;
|
|
846
867
|
let t = e.seekTime;
|
|
847
|
-
for (let e of
|
|
848
|
-
|
|
868
|
+
for (let e of V.current) t >= e.startTime && (t += e.endTime - e.startTime);
|
|
869
|
+
vt.current?.(t);
|
|
849
870
|
});
|
|
850
871
|
let e = (e, t) => {
|
|
851
|
-
if (
|
|
872
|
+
if (Fr.current) return;
|
|
852
873
|
let n = t && t > 0 ? t : 10, r = l.getCurrentTime(), i = r;
|
|
853
|
-
for (let e of
|
|
874
|
+
for (let e of V.current) r >= e.endTime ? i -= e.endTime - e.startTime : r >= e.startTime && (i -= r - e.startTime);
|
|
854
875
|
if (e) {
|
|
855
|
-
let e =
|
|
856
|
-
for (let e of
|
|
857
|
-
|
|
876
|
+
let e = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), t = Math.max(0, l.getDuration() - e), r = Math.min(t, i + n);
|
|
877
|
+
for (let e of V.current) r >= e.startTime && (r += e.endTime - e.startTime);
|
|
878
|
+
vt.current?.(r, {
|
|
858
879
|
eventType: "fast_forward",
|
|
859
880
|
skipSeconds: n
|
|
860
881
|
});
|
|
861
882
|
} else {
|
|
862
883
|
let e = Math.max(0, i - n);
|
|
863
|
-
for (let t of
|
|
864
|
-
|
|
884
|
+
for (let t of V.current) e >= t.startTime && (e += t.endTime - t.startTime);
|
|
885
|
+
vt.current?.(e, {
|
|
865
886
|
eventType: "fast_backward",
|
|
866
887
|
skipSeconds: n
|
|
867
888
|
});
|
|
@@ -869,34 +890,34 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
869
890
|
};
|
|
870
891
|
navigator.mediaSession.setActionHandler("seekforward", (t) => e(!0, t.seekOffset ?? void 0)), navigator.mediaSession.setActionHandler("seekbackward", (t) => e(!1, t.seekOffset ?? void 0));
|
|
871
892
|
} catch {}
|
|
872
|
-
let
|
|
873
|
-
if (!(document.pictureInPictureElement ===
|
|
874
|
-
let e =
|
|
893
|
+
let m = l.getVideoElement(), ee = () => {
|
|
894
|
+
if (!(document.pictureInPictureElement === m || m.webkitPresentationMode === "picture-in-picture") || O.current || F.current !== null || yt.current !== null) return;
|
|
895
|
+
let e = m.currentTime, t = wt.current;
|
|
875
896
|
if (!(Math.abs(e - t) < .5)) {
|
|
876
|
-
if (
|
|
877
|
-
|
|
897
|
+
if (Fr.current) {
|
|
898
|
+
m.currentTime = t;
|
|
878
899
|
return;
|
|
879
900
|
}
|
|
880
|
-
|
|
901
|
+
m.currentTime = t, vt.current?.(e);
|
|
881
902
|
}
|
|
882
903
|
};
|
|
883
|
-
|
|
884
|
-
let
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
},
|
|
888
|
-
|
|
889
|
-
}, 12e3)), He &&
|
|
890
|
-
|
|
904
|
+
m.addEventListener("seeking", ee), jt(l);
|
|
905
|
+
let te = bt.current;
|
|
906
|
+
te && te.targetIdx !== 0 && (N.current && clearTimeout(N.current), N.current = setTimeout(() => {
|
|
907
|
+
N.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) && zr(te.targetIdx);
|
|
908
|
+
}, Oe)), yt.current !== null && (I.current && window.clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
909
|
+
I.current = null, F.current = null, P.current && (P.current.style.opacity = "0"), Xt(!1);
|
|
910
|
+
}, 12e3)), He && T.current && (at.current = !0, T.current.requestFullscreen().catch(() => {
|
|
911
|
+
at.current = !1;
|
|
891
912
|
}));
|
|
892
|
-
let
|
|
913
|
+
let le = () => {
|
|
893
914
|
let e = document, t = !!(document.fullscreenElement || e.webkitFullscreenElement);
|
|
894
|
-
Qt(t), t ||
|
|
915
|
+
Qt(t), t || en(!1);
|
|
895
916
|
let n = l.getVideoElement();
|
|
896
917
|
l.analytics.track(t ? "fullscreen_enter" : "fullscreen_exit", n);
|
|
897
918
|
};
|
|
898
|
-
document.addEventListener("fullscreenchange",
|
|
899
|
-
let
|
|
919
|
+
document.addEventListener("fullscreenchange", le), document.addEventListener("webkitfullscreenchange", le);
|
|
920
|
+
let g = (e) => {
|
|
900
921
|
let t = document.activeElement;
|
|
901
922
|
if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.getAttribute("contenteditable") === "true" || t.getAttribute("role") === "slider"))) {
|
|
902
923
|
switch (e.key.toLowerCase()) {
|
|
@@ -909,19 +930,19 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
909
930
|
let e = l.getVideoElement();
|
|
910
931
|
e && !e.paused && e.pause();
|
|
911
932
|
} catch {}
|
|
912
|
-
if (
|
|
913
|
-
|
|
933
|
+
if (D.current && !D.current.paused) try {
|
|
934
|
+
D.current.pause();
|
|
914
935
|
} catch {}
|
|
915
936
|
}
|
|
916
937
|
break;
|
|
917
938
|
case "arrowleft":
|
|
918
939
|
case "j":
|
|
919
|
-
if (e.preventDefault(), !
|
|
940
|
+
if (e.preventDefault(), !Fr.current) {
|
|
920
941
|
let e = l.getCurrentTime(), t = e;
|
|
921
|
-
for (let n of
|
|
942
|
+
for (let n of V.current) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
|
|
922
943
|
let n = Math.max(0, t - 10);
|
|
923
|
-
for (let e of
|
|
924
|
-
|
|
944
|
+
for (let e of V.current) n >= e.startTime && (n += e.endTime - e.startTime);
|
|
945
|
+
vt.current?.(n, {
|
|
925
946
|
eventType: "fast_backward",
|
|
926
947
|
skipSeconds: 10
|
|
927
948
|
});
|
|
@@ -929,12 +950,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
929
950
|
break;
|
|
930
951
|
case "arrowright":
|
|
931
952
|
case "l":
|
|
932
|
-
if (e.preventDefault(), !
|
|
933
|
-
let e = l.getCurrentTime(), t =
|
|
934
|
-
for (let t of
|
|
953
|
+
if (e.preventDefault(), !Fr.current) {
|
|
954
|
+
let e = l.getCurrentTime(), t = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), n = Math.max(0, l.getDuration() - t), r = e;
|
|
955
|
+
for (let t of V.current) e >= t.endTime ? r -= t.endTime - t.startTime : e >= t.startTime && (r -= e - t.startTime);
|
|
935
956
|
let i = Math.min(n, r + 10);
|
|
936
|
-
for (let e of
|
|
937
|
-
|
|
957
|
+
for (let e of V.current) i >= e.startTime && (i += e.endTime - e.startTime);
|
|
958
|
+
vt.current?.(i, {
|
|
938
959
|
eventType: "fast_forward",
|
|
939
960
|
skipSeconds: 10
|
|
940
961
|
});
|
|
@@ -950,28 +971,28 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
950
971
|
e.preventDefault(), l.setMute(!l.isMuted());
|
|
951
972
|
break;
|
|
952
973
|
case "f":
|
|
953
|
-
e.preventDefault(),
|
|
974
|
+
e.preventDefault(), ft.current();
|
|
954
975
|
break;
|
|
955
976
|
case "p":
|
|
956
|
-
e.preventDefault(),
|
|
977
|
+
e.preventDefault(), Fr.current || l.togglePictureInPicture();
|
|
957
978
|
break;
|
|
958
979
|
case "c":
|
|
959
|
-
if (e.preventDefault(),
|
|
980
|
+
if (e.preventDefault(), R.enableSubtitles && !Fr.current) if (l.subtitles.getActiveTrackId() !== "off") l.subtitles.setActiveTrack("off"), zn("off");
|
|
960
981
|
else {
|
|
961
|
-
let e =
|
|
962
|
-
e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id),
|
|
982
|
+
let e = Lr.current;
|
|
983
|
+
e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id), zn(e[0].id));
|
|
963
984
|
}
|
|
964
985
|
break;
|
|
965
986
|
default: return;
|
|
966
987
|
}
|
|
967
|
-
|
|
988
|
+
Rr();
|
|
968
989
|
}
|
|
969
990
|
};
|
|
970
|
-
return document.addEventListener("keydown",
|
|
971
|
-
if (
|
|
972
|
-
key:
|
|
991
|
+
return document.addEventListener("keydown", g), Rr(), () => {
|
|
992
|
+
if (vn.current = {
|
|
993
|
+
key: dn,
|
|
973
994
|
snapshot: l.analytics.getSessionSnapshot()
|
|
974
|
-
}, l.destroy(),
|
|
995
|
+
}, l.destroy(), it.current?.destroy(), it.current = null, document.body.style.overflow = "", document.body.style.touchAction = "", document.removeEventListener("fullscreenchange", le), document.removeEventListener("webkitfullscreenchange", le), document.removeEventListener("keydown", g), Nr.current && window.clearTimeout(Nr.current), j.current &&= (window.clearTimeout(j.current), null), N.current &&= (clearTimeout(N.current), null), M.current && (M.current.style.opacity = "0"), m.removeEventListener("seeking", ee), "mediaSession" in navigator) {
|
|
975
996
|
try {
|
|
976
997
|
navigator.mediaSession.setActionHandler("seekto", null);
|
|
977
998
|
} catch {}
|
|
@@ -982,76 +1003,76 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
982
1003
|
navigator.mediaSession.setActionHandler("seekbackward", null);
|
|
983
1004
|
} catch {}
|
|
984
1005
|
}
|
|
985
|
-
|
|
1006
|
+
ct.current &&= (ct.current.destroy(), null), D.current &&= (document.body.removeChild(D.current), null), Ct.current = !1, F.current = null, I.current &&= (window.clearTimeout(I.current), null);
|
|
986
1007
|
};
|
|
987
1008
|
}, [
|
|
988
1009
|
r,
|
|
989
1010
|
re,
|
|
990
1011
|
Rt
|
|
991
1012
|
]), c(() => {
|
|
992
|
-
if (
|
|
993
|
-
|
|
994
|
-
let e =
|
|
1013
|
+
if (L) {
|
|
1014
|
+
L.keyMoments.setKeyMoments(K);
|
|
1015
|
+
let e = T.current?.querySelector("video");
|
|
995
1016
|
if (e) {
|
|
996
|
-
let t =
|
|
997
|
-
|
|
1017
|
+
let t = L.keyMoments.getCurrentMoment(e.currentTime);
|
|
1018
|
+
qn({
|
|
998
1019
|
chapter: t.keyMoment,
|
|
999
1020
|
index: t.index
|
|
1000
1021
|
});
|
|
1001
1022
|
}
|
|
1002
1023
|
}
|
|
1003
|
-
}, [
|
|
1024
|
+
}, [or, L]), c(() => {
|
|
1004
1025
|
let e = (e) => {
|
|
1005
|
-
|
|
1026
|
+
q !== "none" && (e.target.closest(".sdk-menu-container") || J("none"));
|
|
1006
1027
|
};
|
|
1007
1028
|
return document.addEventListener("click", e), () => {
|
|
1008
1029
|
document.removeEventListener("click", e);
|
|
1009
1030
|
};
|
|
1010
|
-
}, [
|
|
1011
|
-
|
|
1031
|
+
}, [q]), c(() => {
|
|
1032
|
+
Pr.current = Bt;
|
|
1012
1033
|
}, [Bt]), c(() => {
|
|
1013
|
-
|
|
1014
|
-
}, [
|
|
1015
|
-
|
|
1016
|
-
}, [
|
|
1017
|
-
if (!
|
|
1018
|
-
let e = 0, t =
|
|
1019
|
-
let i =
|
|
1034
|
+
Fr.current = Z;
|
|
1035
|
+
}, [Z]), c(() => {
|
|
1036
|
+
Ir.current = q;
|
|
1037
|
+
}, [q]), c(() => {
|
|
1038
|
+
if (!Z || !L) return;
|
|
1039
|
+
let e = 0, t = L.getCurrentTime(), n = performance.now(), r = () => {
|
|
1040
|
+
let i = L.getVideoElement?.(), a = L.getCurrentTime(), o = performance.now(), s;
|
|
1020
1041
|
if (a !== t) t = a, n = o, s = a;
|
|
1021
1042
|
else if (i && !i.paused && !i.ended) {
|
|
1022
1043
|
let e = i.playbackRate || 1;
|
|
1023
1044
|
s = t + (o - n) / 1e3 * e;
|
|
1024
1045
|
} else s = t;
|
|
1025
|
-
let c =
|
|
1046
|
+
let c = V.current.find((e) => a >= e.startTime && a < e.endTime);
|
|
1026
1047
|
if (c) {
|
|
1027
1048
|
let e = Math.min(s, a + .4, c.endTime), t = Math.min(100, Math.max(0, (e - c.startTime) / (c.endTime - c.startTime) * 100));
|
|
1028
|
-
(
|
|
1049
|
+
(T.current?.querySelectorAll(".sdk-ad-progress-fill"))?.forEach((e) => {
|
|
1029
1050
|
e.style.width = `${t}%`;
|
|
1030
1051
|
});
|
|
1031
1052
|
}
|
|
1032
1053
|
e = requestAnimationFrame(r);
|
|
1033
1054
|
};
|
|
1034
1055
|
return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
|
|
1035
|
-
}, [
|
|
1036
|
-
|
|
1037
|
-
}, [
|
|
1038
|
-
|
|
1039
|
-
}, [
|
|
1040
|
-
|
|
1041
|
-
}, [
|
|
1042
|
-
|
|
1043
|
-
}, [
|
|
1044
|
-
|
|
1045
|
-
}, [
|
|
1046
|
-
|
|
1047
|
-
}, [
|
|
1048
|
-
|
|
1056
|
+
}, [Z, L]), c(() => {
|
|
1057
|
+
Lr.current = Bn;
|
|
1058
|
+
}, [Bn]), c(() => {
|
|
1059
|
+
Dt.current = Tt;
|
|
1060
|
+
}, [Tt]), c(() => {
|
|
1061
|
+
V.current = B;
|
|
1062
|
+
}, [B]), c(() => {
|
|
1063
|
+
Tn.current = xn;
|
|
1064
|
+
}, [xn]), c(() => {
|
|
1065
|
+
En.current = Cn;
|
|
1066
|
+
}, [Cn]), c(() => {
|
|
1067
|
+
An.current = On;
|
|
1068
|
+
}, [On]), c(() => {
|
|
1069
|
+
xt.current = S;
|
|
1049
1070
|
}, [S]), c(() => {
|
|
1050
|
-
|
|
1071
|
+
St.current = tt;
|
|
1051
1072
|
}, [tt]), c(() => {
|
|
1052
|
-
|
|
1073
|
+
yn.current = null, bn.current = !1, _t.current = null, wn(null), En.current = null, Dn.current = /* @__PURE__ */ new Set(), Lt(!1);
|
|
1053
1074
|
}, [r]), c(() => {
|
|
1054
|
-
|
|
1075
|
+
Sn([]), $e && fetch($e).then((e) => e.json()).then((e) => {
|
|
1055
1076
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1056
1077
|
for (let r of e.nonLinearAvails ?? []) {
|
|
1057
1078
|
if (t.has(r.availId)) continue;
|
|
@@ -1078,280 +1099,294 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1078
1099
|
dismissible: o.dismissible === !0
|
|
1079
1100
|
});
|
|
1080
1101
|
}
|
|
1081
|
-
|
|
1102
|
+
Sn(n);
|
|
1082
1103
|
}).catch(() => {});
|
|
1083
1104
|
}, [$e, r]), c(() => {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
let t = e.ads?.[0]?.skipOffset ?? null, n =
|
|
1105
|
+
kn([]), et && fetch(et).then((e) => e.json()).then((e) => {
|
|
1106
|
+
kn((e.avails ?? []).map((e) => {
|
|
1107
|
+
let t = e.ads?.[0], n = t?.skipOffset ?? null, r = !!n, i = {};
|
|
1108
|
+
try {
|
|
1109
|
+
i = JSON.parse(t?.adParameters ?? "{}");
|
|
1110
|
+
} catch {}
|
|
1111
|
+
let a = i.ctaText && i.redirectUrl ? {
|
|
1112
|
+
text: i.ctaText,
|
|
1113
|
+
url: i.redirectUrl,
|
|
1114
|
+
title: i.title || void 0,
|
|
1115
|
+
description: i.description || void 0
|
|
1116
|
+
} : null;
|
|
1087
1117
|
return {
|
|
1088
1118
|
startTimeSeconds: e.startTimeInSeconds ?? 0,
|
|
1089
1119
|
durationSeconds: e.durationInSeconds ?? 0,
|
|
1090
|
-
skippable:
|
|
1091
|
-
skipOffsetSeconds:
|
|
1120
|
+
skippable: r,
|
|
1121
|
+
skipOffsetSeconds: r ? Le(n) : 0,
|
|
1122
|
+
cta: a
|
|
1092
1123
|
};
|
|
1093
1124
|
}));
|
|
1094
1125
|
}).catch(() => {});
|
|
1095
|
-
}, [
|
|
1096
|
-
if (!
|
|
1097
|
-
let e =
|
|
1126
|
+
}, [et, r]), c(() => {
|
|
1127
|
+
if (!L || On.length === 0) return;
|
|
1128
|
+
let e = On.map((e) => ({
|
|
1098
1129
|
startTime: e.startTimeSeconds,
|
|
1099
1130
|
endTime: e.startTimeSeconds + e.durationSeconds
|
|
1100
1131
|
}));
|
|
1101
|
-
|
|
1102
|
-
}, [
|
|
1103
|
-
if (!
|
|
1132
|
+
L.setAdBreaks(e);
|
|
1133
|
+
}, [L, On]), c(() => {
|
|
1134
|
+
if (!L) return;
|
|
1104
1135
|
let e = () => {
|
|
1105
|
-
document.hidden ? Xe && Pr.current && (
|
|
1136
|
+
document.hidden ? Xe && Fr.current && Pr.current && (L.pause(), bn.current = !0) : bn.current &&= (L.play(), !1);
|
|
1106
1137
|
};
|
|
1107
1138
|
return document.addEventListener("visibilitychange", e), () => {
|
|
1108
1139
|
document.removeEventListener("visibilitychange", e);
|
|
1109
1140
|
};
|
|
1110
|
-
}, [
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1113
|
-
}, Br = () => {
|
|
1114
|
-
He && !ot.current && C.current && (ot.current = !0, C.current.requestFullscreen().catch(() => {}));
|
|
1141
|
+
}, [L, Xe]);
|
|
1142
|
+
let Br = () => {
|
|
1143
|
+
Rr();
|
|
1115
1144
|
}, Vr = () => {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1145
|
+
He && !at.current && T.current && (at.current = !0, T.current.requestFullscreen().catch(() => {}));
|
|
1146
|
+
}, Hr = () => {
|
|
1147
|
+
if (L) {
|
|
1148
|
+
if (Y) {
|
|
1149
|
+
L.casting.remotePlayPause(), Rr();
|
|
1119
1150
|
return;
|
|
1120
1151
|
}
|
|
1121
|
-
if (
|
|
1152
|
+
if (sn) Q(0), Vr(), L.play(), cn(!1);
|
|
1122
1153
|
else if (Bt) {
|
|
1123
|
-
|
|
1154
|
+
L.pause();
|
|
1124
1155
|
try {
|
|
1125
|
-
let e =
|
|
1156
|
+
let e = L.getVideoElement?.();
|
|
1126
1157
|
e && !e.paused && e.pause();
|
|
1127
1158
|
} catch {}
|
|
1128
|
-
if (
|
|
1159
|
+
if (T.current && T.current.querySelectorAll("video").forEach((e) => {
|
|
1129
1160
|
try {
|
|
1130
1161
|
e.pause();
|
|
1131
1162
|
} catch {}
|
|
1132
|
-
}),
|
|
1133
|
-
|
|
1163
|
+
}), D.current && !D.current.paused) try {
|
|
1164
|
+
D.current.pause();
|
|
1134
1165
|
} catch {}
|
|
1135
|
-
} else
|
|
1136
|
-
|
|
1166
|
+
} else Vr(), L.play();
|
|
1167
|
+
Rr();
|
|
1137
1168
|
}
|
|
1138
|
-
}, Hr = (e) => {
|
|
1139
|
-
if (!w.current || !P || V === 0) return 0;
|
|
1140
|
-
let t = w.current.getBoundingClientRect();
|
|
1141
|
-
return U(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * V);
|
|
1142
1169
|
}, Ur = (e) => {
|
|
1143
|
-
if (!
|
|
1144
|
-
|
|
1170
|
+
if (!E.current || !L || H === 0) return 0;
|
|
1171
|
+
let t = E.current.getBoundingClientRect();
|
|
1172
|
+
return W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1173
|
+
}, Wr = (e) => {
|
|
1174
|
+
if (!L || Z) return;
|
|
1175
|
+
ut.current = !0, Dr(Ur(e));
|
|
1145
1176
|
let t = (e) => {
|
|
1146
|
-
if (!
|
|
1147
|
-
let t =
|
|
1148
|
-
|
|
1177
|
+
if (!ut.current || !E.current) return;
|
|
1178
|
+
let t = E.current.getBoundingClientRect(), n = W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1179
|
+
Dr(n), vr(e.clientX - t.left), Sr(n), D.current && (D.current.currentTime = n), Rr();
|
|
1149
1180
|
}, n = (e) => {
|
|
1150
|
-
if (
|
|
1151
|
-
let t =
|
|
1152
|
-
|
|
1181
|
+
if (ut.current = !1, E.current) {
|
|
1182
|
+
let t = E.current.getBoundingClientRect();
|
|
1183
|
+
Q(W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H));
|
|
1153
1184
|
}
|
|
1154
|
-
|
|
1185
|
+
Dr(null), vr(null), wr(null), Er(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
1155
1186
|
};
|
|
1156
1187
|
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
1157
|
-
},
|
|
1158
|
-
if (!
|
|
1159
|
-
if (
|
|
1160
|
-
|
|
1188
|
+
}, Q = (e, t) => {
|
|
1189
|
+
if (!L) return;
|
|
1190
|
+
if (Y) {
|
|
1191
|
+
L.casting.remoteSeek(e);
|
|
1161
1192
|
return;
|
|
1162
1193
|
}
|
|
1163
1194
|
let n = Math.max(0, Ut > 0 ? Math.min(e, Ut) : e);
|
|
1164
1195
|
if (t) {
|
|
1165
1196
|
let { eventType: e, ...n } = t;
|
|
1166
|
-
|
|
1197
|
+
L.attributeNextSeek(e, n);
|
|
1167
1198
|
}
|
|
1168
|
-
let r =
|
|
1169
|
-
if (n > r &&
|
|
1170
|
-
let e =
|
|
1199
|
+
let r = L.getCurrentTime();
|
|
1200
|
+
if (n > r && V.current.length > 0) {
|
|
1201
|
+
let e = V.current.filter((e) => e.startTime > r && e.startTime < n && !un.current.has(e.startTime)).sort((e, t) => e.startTime - t.startTime);
|
|
1171
1202
|
if (e.length > 0) {
|
|
1172
|
-
|
|
1203
|
+
_t.current = n;
|
|
1173
1204
|
let t = e[e.length - 1].startTime;
|
|
1174
|
-
|
|
1175
|
-
|
|
1205
|
+
O.current = !0, k.current = t, A.current = r, Ht(t), M.current && (M.current.style.opacity = "1"), mt(L.getVideoElement()), L.seek(t), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
1206
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, M.current && (M.current.style.opacity = "0"), ht(L.getVideoElement());
|
|
1176
1207
|
}, 3e3);
|
|
1177
1208
|
return;
|
|
1178
1209
|
}
|
|
1179
1210
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1211
|
+
_t.current = null;
|
|
1212
|
+
let i = V.current.find((e) => un.current.has(e.startTime) && n >= e.startTime - .5 && n < e.endTime + 2), a = i ? Math.max(n, i.endTime + .5) : n;
|
|
1213
|
+
O.current = !0, k.current = a, A.current = r, Ht(a), M.current && (M.current.style.opacity = "0"), ht(L.getVideoElement()), L.seek(a), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
1214
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, M.current && (M.current.style.opacity = "0");
|
|
1182
1215
|
}, 3e3);
|
|
1183
1216
|
};
|
|
1184
|
-
|
|
1185
|
-
let
|
|
1186
|
-
if (!
|
|
1187
|
-
if (
|
|
1188
|
-
|
|
1217
|
+
vt.current = Q;
|
|
1218
|
+
let Gr = () => {
|
|
1219
|
+
if (!L) return;
|
|
1220
|
+
if (Y) {
|
|
1221
|
+
L.casting.remoteSetMute(!(cr?.isMuted ?? !1));
|
|
1189
1222
|
return;
|
|
1190
1223
|
}
|
|
1191
1224
|
let e = !qt;
|
|
1192
|
-
|
|
1193
|
-
}, Gr = (e) => {
|
|
1194
|
-
P && (P.setPlaybackRate(e), Yn(e), q("none"), tr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
|
|
1225
|
+
L.setMute(e), Jt(e);
|
|
1195
1226
|
}, Kr = (e) => {
|
|
1196
|
-
|
|
1197
|
-
P.setQuality(e);
|
|
1198
|
-
let t = Mn.find((t) => t.id === e);
|
|
1199
|
-
t && (Fn(t), tr(`Quality: ${t.label}`)), q("none");
|
|
1227
|
+
L && (L.setPlaybackRate(e), Xn(e), J("none"), nr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
|
|
1200
1228
|
}, qr = (e) => {
|
|
1201
|
-
if (
|
|
1229
|
+
if (!L) return;
|
|
1230
|
+
L.setQuality(e);
|
|
1231
|
+
let t = Nn.find((t) => t.id === e);
|
|
1232
|
+
t && (In(t), nr(`Quality: ${t.label}`)), J("none");
|
|
1233
|
+
}, Jr = (e) => {
|
|
1234
|
+
if (L) if (L.subtitles.setActiveTrack(e), zn(e), J("none"), e === "off") nr("Captions off");
|
|
1202
1235
|
else {
|
|
1203
|
-
let t =
|
|
1204
|
-
|
|
1236
|
+
let t = Bn.find((t) => t.id === e);
|
|
1237
|
+
nr(`Captions: ${t ? b(t) : "on"}`);
|
|
1205
1238
|
}
|
|
1206
|
-
},
|
|
1207
|
-
|
|
1208
|
-
},
|
|
1209
|
-
|
|
1239
|
+
}, Yr = (e) => {
|
|
1240
|
+
L && (N.current &&= (clearTimeout(N.current), null), ir(null), P.current && (P.current.style.opacity = "1"), Xt(!0), bt.current === null && (yt.current = L.getCurrentTime()), bt.current = { targetIdx: e }, J("none"), nr(`Source: ${S?.[e]?.label ?? ""}`), tt?.(e));
|
|
1241
|
+
}, Xr = (e, t) => {
|
|
1242
|
+
Q(e, {
|
|
1210
1243
|
eventType: "key_moments",
|
|
1211
1244
|
momentTitle: t?.title ?? "",
|
|
1212
1245
|
momentTime: e
|
|
1213
|
-
}),
|
|
1214
|
-
}, Xr = () => {
|
|
1215
|
-
P && P.togglePictureInPicture();
|
|
1246
|
+
}), J("none");
|
|
1216
1247
|
}, Zr = () => {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1248
|
+
L && L.togglePictureInPicture();
|
|
1249
|
+
}, Qr = () => {
|
|
1250
|
+
if (!T.current) return;
|
|
1251
|
+
let e = T.current, t = document, n = e, r = !!(document.fullscreenElement || t.webkitFullscreenElement), i = () => {
|
|
1252
|
+
en(!0), Qt(!0), document.body.style.overflow = "hidden", document.body.style.touchAction = "none", L?.analytics.track("fullscreen_enter", L.getVideoElement());
|
|
1220
1253
|
}, a = () => {
|
|
1221
|
-
|
|
1254
|
+
en(!1), Qt(!1), document.body.style.overflow = "", document.body.style.touchAction = "", L?.analytics.track("fullscreen_exit", L.getVideoElement());
|
|
1222
1255
|
};
|
|
1223
|
-
if (r ||
|
|
1256
|
+
if (r || $t) nn(!1), document.fullscreenElement ? document.exitFullscreen() : t.webkitFullscreenElement ? t.webkitExitFullscreen?.() : a();
|
|
1224
1257
|
else {
|
|
1225
|
-
|
|
1258
|
+
nn(Dt.current);
|
|
1226
1259
|
let t = e.requestFullscreen?.bind(e) ?? n.webkitRequestFullscreen?.bind(n);
|
|
1227
1260
|
t ? t().catch(i) : i();
|
|
1228
1261
|
}
|
|
1229
1262
|
};
|
|
1230
1263
|
c(() => {
|
|
1231
|
-
|
|
1264
|
+
ft.current = Qr;
|
|
1232
1265
|
});
|
|
1233
|
-
let
|
|
1234
|
-
if (!
|
|
1235
|
-
let e =
|
|
1236
|
-
e &&
|
|
1237
|
-
},
|
|
1238
|
-
|
|
1239
|
-
},
|
|
1266
|
+
let $r = () => {
|
|
1267
|
+
if (!Z) return;
|
|
1268
|
+
let e = B.find((e) => z >= e.startTime && z < e.endTime);
|
|
1269
|
+
e && gt.current?.(e.endTime);
|
|
1270
|
+
}, ei = () => {
|
|
1271
|
+
En.current && Dn.current.add(En.current.availId), wn(null), En.current = null;
|
|
1272
|
+
}, ti = (e) => {
|
|
1240
1273
|
e.clickTrackingUrl && fetch(e.clickTrackingUrl, { mode: "no-cors" }).catch(() => {}), e.clickThrough && window.open(e.clickThrough, "_blank", "noopener,noreferrer");
|
|
1241
|
-
},
|
|
1242
|
-
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
if (
|
|
1247
|
-
|
|
1274
|
+
}, ni = (e) => {
|
|
1275
|
+
window.open(e.url, "_blank", "noopener,noreferrer");
|
|
1276
|
+
}, ri = () => {
|
|
1277
|
+
L && (Y ? L.casting.stopCasting() : L.casting.requestSession(r, z));
|
|
1278
|
+
}, ii = () => {
|
|
1279
|
+
if (!L) return;
|
|
1280
|
+
let e = L.getVideoElement();
|
|
1281
|
+
if (pr) {
|
|
1282
|
+
L.casting.stopAirPlay(e);
|
|
1248
1283
|
return;
|
|
1249
1284
|
}
|
|
1250
|
-
typeof e.webkitShowPlaybackTargetPicker == "function" ||
|
|
1251
|
-
}, ri = (e) => {
|
|
1252
|
-
if (!w.current || V === 0 || !P || X) return;
|
|
1253
|
-
let t = w.current.getBoundingClientRect();
|
|
1254
|
-
st.current = t.width, yr(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
|
|
1255
|
-
let n = U(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * V);
|
|
1256
|
-
_r(e.clientX - t.left), xr(n), ut.current && window.clearTimeout(ut.current), ut.current = window.setTimeout(() => {
|
|
1257
|
-
T.current && (T.current.currentTime = n);
|
|
1258
|
-
}, 100), Tr(P.keyMoments.getCurrentMoment(n).keyMoment);
|
|
1259
|
-
}, ii = (e) => {
|
|
1260
|
-
if (!w.current || V === 0) return 0;
|
|
1261
|
-
let t = w.current.getBoundingClientRect();
|
|
1262
|
-
return U(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * V);
|
|
1285
|
+
typeof e.webkitShowPlaybackTargetPicker == "function" || L.casting.isAirPlayAvailable() ? L.casting.requestAirPlaySession(e) : console.warn("[PlayerSDK AirPlay] AirPlay is not available on this device.");
|
|
1263
1286
|
}, ai = (e) => {
|
|
1264
|
-
if (!
|
|
1265
|
-
|
|
1287
|
+
if (!E.current || H === 0 || !L || Z) return;
|
|
1288
|
+
let t = E.current.getBoundingClientRect();
|
|
1289
|
+
ot.current = t.width, br(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
|
|
1290
|
+
let n = W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1291
|
+
vr(e.clientX - t.left), Sr(n), lt.current && window.clearTimeout(lt.current), lt.current = window.setTimeout(() => {
|
|
1292
|
+
D.current && (D.current.currentTime = n);
|
|
1293
|
+
}, 100), Er(L.keyMoments.getCurrentMoment(n).keyMoment);
|
|
1294
|
+
}, oi = (e) => {
|
|
1295
|
+
if (!E.current || H === 0) return 0;
|
|
1296
|
+
let t = E.current.getBoundingClientRect();
|
|
1297
|
+
return W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1298
|
+
}, si = (e) => {
|
|
1299
|
+
if (!L || Z || H === 0) return;
|
|
1300
|
+
e.preventDefault(), ut.current = !0, Dr(oi(e.touches[0]));
|
|
1266
1301
|
let t = (e) => {
|
|
1267
|
-
if (!
|
|
1268
|
-
let t = e.touches[0], n =
|
|
1269
|
-
|
|
1302
|
+
if (!ut.current || !E.current) return;
|
|
1303
|
+
let t = e.touches[0], n = E.current.getBoundingClientRect(), r = W(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * H);
|
|
1304
|
+
Dr(r), Sr(r), Rr();
|
|
1270
1305
|
}, n = (e) => {
|
|
1271
|
-
if (
|
|
1272
|
-
let t = e.changedTouches[0], n =
|
|
1273
|
-
|
|
1306
|
+
if (ut.current = !1, E.current && e.changedTouches[0]) {
|
|
1307
|
+
let t = e.changedTouches[0], n = E.current.getBoundingClientRect();
|
|
1308
|
+
Q(W(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * H));
|
|
1274
1309
|
}
|
|
1275
|
-
|
|
1310
|
+
Dr(null), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", n);
|
|
1276
1311
|
};
|
|
1277
1312
|
document.addEventListener("touchmove", t, { passive: !1 }), document.addEventListener("touchend", n);
|
|
1278
|
-
},
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1313
|
+
}, ci = () => {
|
|
1314
|
+
vr(null), wr(null), Er(null), lt.current && window.clearTimeout(lt.current);
|
|
1315
|
+
}, $ = (e) => {
|
|
1281
1316
|
if (isNaN(e) || e < 0) return "00:00";
|
|
1282
1317
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => String(e).padStart(2, "0");
|
|
1283
1318
|
return n > 0 ? `${a(n)}:${a(r)}:${a(i)}` : `${a(r)}:${a(i)}`;
|
|
1284
1319
|
};
|
|
1285
1320
|
c(() => {
|
|
1286
|
-
|
|
1321
|
+
ar.current && nr(Bt ? "Playing" : "Paused");
|
|
1287
1322
|
}, [Bt]), c(() => {
|
|
1288
|
-
|
|
1323
|
+
ar.current && nr(qt ? "Muted" : "Unmuted");
|
|
1289
1324
|
}, [qt]), c(() => {
|
|
1290
|
-
|
|
1325
|
+
ar.current = !0;
|
|
1291
1326
|
}, []), c(() => {
|
|
1292
1327
|
let e = (e) => {
|
|
1293
|
-
e.key === "Escape" &&
|
|
1328
|
+
e.key === "Escape" && Ir.current !== "none" && (e.preventDefault(), J("none"));
|
|
1294
1329
|
};
|
|
1295
1330
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1296
1331
|
}, []);
|
|
1297
|
-
let
|
|
1298
|
-
if (
|
|
1299
|
-
let t = Date.now(), n =
|
|
1332
|
+
let li = Y ? !(cr?.isPaused ?? !0) : Bt, ui = Y ? cr?.currentTime ?? 0 : z, di = Y ? cr?.duration ?? 0 : H, fi = Y ? cr?.volumeLevel ?? 1 : Gt, pi = Y ? cr?.isMuted ?? !1 : qt, mi = o((e) => {
|
|
1333
|
+
if (Z || e.target.closest(".sdk-mobile-ctrl")) return;
|
|
1334
|
+
let t = Date.now(), n = T.current?.getBoundingClientRect(), r = e.clientX - (n?.left ?? 0), i = Ot.current;
|
|
1300
1335
|
if (i && t - i.time < 300) {
|
|
1301
|
-
|
|
1336
|
+
Ot.current = null;
|
|
1302
1337
|
let e = r < (n?.width ?? 0) / 2, t = e ? -10 : 10;
|
|
1303
|
-
|
|
1338
|
+
Q(W(Math.max(0, Math.min(H, U(ui) + t))), {
|
|
1304
1339
|
eventType: e ? "fast_backward" : "fast_forward",
|
|
1305
1340
|
skipSeconds: 10
|
|
1306
|
-
}),
|
|
1307
|
-
} else
|
|
1341
|
+
}), At(e ? "left" : "right"), window.setTimeout(() => At(null), 700), Rr();
|
|
1342
|
+
} else Ot.current = {
|
|
1308
1343
|
time: t,
|
|
1309
1344
|
x: r
|
|
1310
|
-
},
|
|
1345
|
+
}, Ar ? (jr(!1), Nr.current && window.clearTimeout(Nr.current)) : Rr();
|
|
1311
1346
|
}, [
|
|
1312
|
-
|
|
1313
|
-
V,
|
|
1347
|
+
Z,
|
|
1314
1348
|
H,
|
|
1315
|
-
ci,
|
|
1316
1349
|
U,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
},
|
|
1350
|
+
ui,
|
|
1351
|
+
W,
|
|
1352
|
+
Q,
|
|
1353
|
+
Ar
|
|
1354
|
+
]), hi = () => p(pi || fi === 0 ? Ee : fi < .3 ? De : fi < .7 ? we : Te, { size: 18 }), gi = (e) => (t) => {
|
|
1355
|
+
t.key === "Enter" || t.key === " " ? (t.preventDefault(), e()) : t.key === "Escape" && (t.preventDefault(), J("none"));
|
|
1356
|
+
}, _i = (e) => (t) => {
|
|
1322
1357
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e());
|
|
1323
|
-
},
|
|
1324
|
-
if (!
|
|
1358
|
+
}, vi = (e) => {
|
|
1359
|
+
if (!Z) if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
1325
1360
|
e.preventDefault();
|
|
1326
1361
|
let t = e.key === "ArrowLeft" ? -5 : 5;
|
|
1327
|
-
|
|
1328
|
-
} else e.key === "Home" ? (e.preventDefault(),
|
|
1329
|
-
},
|
|
1330
|
-
q
|
|
1331
|
-
},
|
|
1362
|
+
Q(W(Math.max(0, Math.min(H, U(ui) + t))));
|
|
1363
|
+
} else e.key === "Home" ? (e.preventDefault(), Q(W(0))) : e.key === "End" && (e.preventDefault(), Q(W(H)));
|
|
1364
|
+
}, yi = (e) => {
|
|
1365
|
+
J(q === e ? "none" : e);
|
|
1366
|
+
}, bi = o((e) => {
|
|
1332
1367
|
if (!e) return;
|
|
1333
1368
|
e.style.left = "";
|
|
1334
|
-
let t =
|
|
1369
|
+
let t = T.current;
|
|
1335
1370
|
if (!t) return;
|
|
1336
1371
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.right - (r.right - 8), a = r.left + 8 - n.left;
|
|
1337
1372
|
i > 0 ? e.style.left = `calc(50% - ${Math.ceil(i)}px)` : a > 0 && (e.style.left = `calc(50% + ${Math.ceil(a)}px)`);
|
|
1338
1373
|
}, []);
|
|
1339
1374
|
return /* @__PURE__ */ m("div", {
|
|
1340
|
-
ref:
|
|
1375
|
+
ref: T,
|
|
1341
1376
|
role: "region",
|
|
1342
|
-
"aria-label":
|
|
1343
|
-
className: `sdk-player-container ${
|
|
1344
|
-
onMouseMove:
|
|
1345
|
-
onTouchStart:
|
|
1377
|
+
"aria-label": x || Or ? `${x || Or} video player` : "Video player",
|
|
1378
|
+
className: `sdk-player-container ${Ar ? "controls-active" : ""} ${$t ? "sdk-fs-simulated" : ""}`,
|
|
1379
|
+
onMouseMove: Br,
|
|
1380
|
+
onTouchStart: rn ? void 0 : Rr,
|
|
1346
1381
|
onMouseLeave: () => {},
|
|
1347
1382
|
style: {
|
|
1348
|
-
border:
|
|
1349
|
-
"--sdk-theme-color":
|
|
1350
|
-
"--sdk-theme-color-rgb":
|
|
1383
|
+
border: $t ? "none" : "1px solid rgba(255, 255, 255, 0.08)",
|
|
1384
|
+
"--sdk-theme-color": h,
|
|
1385
|
+
"--sdk-theme-color-rgb": Ne(h)
|
|
1351
1386
|
},
|
|
1352
1387
|
children: [
|
|
1353
1388
|
/* @__PURE__ */ p("canvas", {
|
|
1354
|
-
ref:
|
|
1389
|
+
ref: st,
|
|
1355
1390
|
width: 160,
|
|
1356
1391
|
height: 90,
|
|
1357
1392
|
style: {
|
|
@@ -1366,10 +1401,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1366
1401
|
"aria-live": "polite",
|
|
1367
1402
|
"aria-atomic": "true",
|
|
1368
1403
|
className: "sdk-sr-only",
|
|
1369
|
-
children:
|
|
1404
|
+
children: tr
|
|
1370
1405
|
}),
|
|
1371
1406
|
/* @__PURE__ */ p("div", {
|
|
1372
|
-
ref:
|
|
1407
|
+
ref: M,
|
|
1373
1408
|
style: {
|
|
1374
1409
|
opacity: 0,
|
|
1375
1410
|
position: "absolute",
|
|
@@ -1382,9 +1417,9 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1382
1417
|
"aria-hidden": "true"
|
|
1383
1418
|
}),
|
|
1384
1419
|
/* @__PURE__ */ p("div", {
|
|
1385
|
-
ref:
|
|
1420
|
+
ref: P,
|
|
1386
1421
|
style: {
|
|
1387
|
-
opacity:
|
|
1422
|
+
opacity: w && w > 0 ? 1 : 0,
|
|
1388
1423
|
position: "absolute",
|
|
1389
1424
|
inset: 0,
|
|
1390
1425
|
background: "#000",
|
|
@@ -1416,7 +1451,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1416
1451
|
Lt(!1), zt((e) => e + 1);
|
|
1417
1452
|
} })
|
|
1418
1453
|
}),
|
|
1419
|
-
|
|
1454
|
+
rr && /* @__PURE__ */ p("div", {
|
|
1420
1455
|
style: {
|
|
1421
1456
|
position: "absolute",
|
|
1422
1457
|
top: "50%",
|
|
@@ -1435,9 +1470,9 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1435
1470
|
backdropFilter: "blur(8px)",
|
|
1436
1471
|
border: "1px solid rgba(255,255,255,0.12)"
|
|
1437
1472
|
},
|
|
1438
|
-
children:
|
|
1473
|
+
children: rr
|
|
1439
1474
|
}),
|
|
1440
|
-
|
|
1475
|
+
R.enableSubtitles && !Z && Ln && G !== "off" && /* @__PURE__ */ p("div", {
|
|
1441
1476
|
className: "sdk-subtitles-overlay",
|
|
1442
1477
|
children: /* @__PURE__ */ p("span", {
|
|
1443
1478
|
className: "sdk-subtitles-text",
|
|
@@ -1448,11 +1483,11 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1448
1483
|
border: We.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
|
|
1449
1484
|
backdropFilter: We.background === "none" ? "none" : "blur(8px)"
|
|
1450
1485
|
},
|
|
1451
|
-
dangerouslySetInnerHTML: { __html:
|
|
1486
|
+
dangerouslySetInnerHTML: { __html: Ln }
|
|
1452
1487
|
})
|
|
1453
1488
|
}),
|
|
1454
|
-
|
|
1455
|
-
className: `sdk-overlay-ad sdk-overlay-ad--${
|
|
1489
|
+
Cn && /* @__PURE__ */ m("div", {
|
|
1490
|
+
className: `sdk-overlay-ad sdk-overlay-ad--${Cn.position}`,
|
|
1456
1491
|
role: "complementary",
|
|
1457
1492
|
"aria-label": "Advertisement",
|
|
1458
1493
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -1460,53 +1495,88 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1460
1495
|
children: [/* @__PURE__ */ p("span", {
|
|
1461
1496
|
className: "sdk-overlay-ad-label",
|
|
1462
1497
|
children: "Ad"
|
|
1463
|
-
}),
|
|
1498
|
+
}), Cn.dismissible && /* @__PURE__ */ p("button", {
|
|
1464
1499
|
className: "sdk-overlay-ad-close",
|
|
1465
|
-
onClick:
|
|
1500
|
+
onClick: ei,
|
|
1466
1501
|
"aria-label": "Close advertisement",
|
|
1467
1502
|
children: "✕"
|
|
1468
1503
|
})]
|
|
1469
1504
|
}), /* @__PURE__ */ p("img", {
|
|
1470
|
-
src:
|
|
1471
|
-
width:
|
|
1472
|
-
height:
|
|
1473
|
-
alt:
|
|
1505
|
+
src: Cn.imageUrl,
|
|
1506
|
+
width: Cn.imageWidth,
|
|
1507
|
+
height: Cn.imageHeight,
|
|
1508
|
+
alt: Cn.title || "Advertisement",
|
|
1474
1509
|
className: "sdk-overlay-ad-img",
|
|
1475
|
-
onClick: () =>
|
|
1510
|
+
onClick: () => ti(Cn)
|
|
1476
1511
|
})]
|
|
1477
1512
|
}),
|
|
1478
|
-
|
|
1479
|
-
let e =
|
|
1480
|
-
return /* @__PURE__ */ m(f, { children: [
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1513
|
+
Z && (() => {
|
|
1514
|
+
let e = B.find((e) => z >= e.startTime && z < e.endTime), t = e ? Math.max(0, e.endTime - z) : 0, n = e ? z - e.startTime : 0, r = On.find((e) => z >= e.startTimeSeconds && z < e.startTimeSeconds + e.durationSeconds), i = r ? r.skippable : Ze, a = r ? r.skipOffsetSeconds : Qe, o = i && n >= a, s = Math.ceil(a - n);
|
|
1515
|
+
return /* @__PURE__ */ m(f, { children: [
|
|
1516
|
+
/* @__PURE__ */ m("div", {
|
|
1517
|
+
className: "sdk-ad-countdown",
|
|
1518
|
+
role: "timer",
|
|
1519
|
+
"aria-label": `Advertisement — ${$(t)} remaining`,
|
|
1520
|
+
"aria-live": "off",
|
|
1521
|
+
children: [
|
|
1522
|
+
/* @__PURE__ */ p("span", {
|
|
1523
|
+
className: "sdk-ad-countdown-label",
|
|
1524
|
+
"aria-hidden": "true",
|
|
1525
|
+
children: "Ad"
|
|
1526
|
+
}),
|
|
1527
|
+
/* @__PURE__ */ p("span", {
|
|
1528
|
+
className: "sdk-ad-countdown-sep",
|
|
1529
|
+
"aria-hidden": "true",
|
|
1530
|
+
children: "·"
|
|
1531
|
+
}),
|
|
1532
|
+
/* @__PURE__ */ p("span", {
|
|
1533
|
+
className: "sdk-ad-countdown-time",
|
|
1534
|
+
"aria-hidden": "true",
|
|
1535
|
+
children: $(t)
|
|
1536
|
+
})
|
|
1537
|
+
]
|
|
1538
|
+
}),
|
|
1539
|
+
i && /* @__PURE__ */ p("button", {
|
|
1540
|
+
className: `sdk-skip-ad-btn ${o ? "sdk-skip-ad-btn--ready" : ""}`,
|
|
1541
|
+
onClick: o ? $r : void 0,
|
|
1542
|
+
disabled: !o,
|
|
1543
|
+
"aria-label": o ? "Skip advertisement" : `Skip advertisement available in ${s} seconds`,
|
|
1544
|
+
"aria-disabled": !o,
|
|
1545
|
+
children: o ? "Skip Ad ›" : `Skip in ${s}s`
|
|
1546
|
+
}),
|
|
1547
|
+
r?.cta && (() => {
|
|
1548
|
+
let e = r.cta, t = /* @__PURE__ */ m("button", {
|
|
1549
|
+
className: "sdk-ad-cta-btn",
|
|
1550
|
+
onClick: () => ni(e),
|
|
1551
|
+
"aria-label": `${e.text} — opens advertiser site in a new tab`,
|
|
1552
|
+
children: [/* @__PURE__ */ p("span", {
|
|
1553
|
+
className: "sdk-ad-cta-btn-text",
|
|
1554
|
+
children: e.text
|
|
1555
|
+
}), /* @__PURE__ */ p(me, {
|
|
1556
|
+
size: 15,
|
|
1557
|
+
"aria-hidden": "true"
|
|
1558
|
+
})]
|
|
1559
|
+
});
|
|
1560
|
+
return /* @__PURE__ */ p("div", {
|
|
1561
|
+
className: "sdk-ad-cta",
|
|
1562
|
+
role: "complementary",
|
|
1563
|
+
"aria-label": "Advertisement call to action",
|
|
1564
|
+
children: e.title ? /* @__PURE__ */ m("div", {
|
|
1565
|
+
className: "sdk-ad-cta-card",
|
|
1566
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1567
|
+
className: "sdk-ad-cta-info",
|
|
1568
|
+
children: [/* @__PURE__ */ p("div", {
|
|
1569
|
+
className: "sdk-ad-cta-title",
|
|
1570
|
+
children: e.title
|
|
1571
|
+
}), e.description && /* @__PURE__ */ p("div", {
|
|
1572
|
+
className: "sdk-ad-cta-desc",
|
|
1573
|
+
children: e.description
|
|
1574
|
+
})]
|
|
1575
|
+
}), t]
|
|
1576
|
+
}) : t
|
|
1577
|
+
});
|
|
1578
|
+
})()
|
|
1579
|
+
] });
|
|
1510
1580
|
})(),
|
|
1511
1581
|
Ft && /* @__PURE__ */ p("div", {
|
|
1512
1582
|
style: {
|
|
@@ -1534,72 +1604,72 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1534
1604
|
})]
|
|
1535
1605
|
})
|
|
1536
1606
|
}),
|
|
1537
|
-
(
|
|
1538
|
-
|
|
1539
|
-
className: `sdk-mobile-overlay ${
|
|
1540
|
-
onClick:
|
|
1541
|
-
children: [
|
|
1542
|
-
className: `sdk-mobile-doubletap ${
|
|
1607
|
+
(Y || pr) && /* @__PURE__ */ p("div", { className: "sdk-cast-bg" }),
|
|
1608
|
+
rn && /* @__PURE__ */ m("div", {
|
|
1609
|
+
className: `sdk-mobile-overlay ${Ar ? "active" : ""}`,
|
|
1610
|
+
onClick: mi,
|
|
1611
|
+
children: [kt && /* @__PURE__ */ p("div", {
|
|
1612
|
+
className: `sdk-mobile-doubletap ${kt}`,
|
|
1543
1613
|
children: /* @__PURE__ */ m("div", {
|
|
1544
1614
|
className: "sdk-mobile-doubletap-icon",
|
|
1545
|
-
children: [p(
|
|
1615
|
+
children: [p(kt === "left" ? Se : Ce, { size: 26 }), /* @__PURE__ */ p("span", {
|
|
1546
1616
|
className: "sdk-mobile-doubletap-label",
|
|
1547
1617
|
children: "10s"
|
|
1548
1618
|
})]
|
|
1549
1619
|
})
|
|
1550
|
-
}),
|
|
1620
|
+
}), le && /* @__PURE__ */ m(f, { children: [
|
|
1551
1621
|
/* @__PURE__ */ m("div", {
|
|
1552
1622
|
className: "sdk-mobile-header sdk-mobile-ctrl",
|
|
1553
1623
|
children: [/* @__PURE__ */ m("div", {
|
|
1554
1624
|
className: "sdk-mobile-header-left",
|
|
1555
|
-
children: [(Zt ||
|
|
1625
|
+
children: [(Zt || $t) && /* @__PURE__ */ p("button", {
|
|
1556
1626
|
className: "sdk-mobile-back-btn",
|
|
1557
|
-
onClick:
|
|
1627
|
+
onClick: Qr,
|
|
1558
1628
|
"aria-label": "Exit fullscreen",
|
|
1559
|
-
children: /* @__PURE__ */ p(
|
|
1629
|
+
children: /* @__PURE__ */ p(pe, {
|
|
1560
1630
|
size: 22,
|
|
1561
1631
|
"aria-hidden": "true"
|
|
1562
1632
|
})
|
|
1563
|
-
}), (
|
|
1633
|
+
}), (x || Or) && /* @__PURE__ */ p("div", {
|
|
1564
1634
|
className: "sdk-mobile-title",
|
|
1565
|
-
children:
|
|
1635
|
+
children: x || Or
|
|
1566
1636
|
})]
|
|
1567
1637
|
}), /* @__PURE__ */ m("div", {
|
|
1568
1638
|
className: "sdk-mobile-header-actions",
|
|
1569
1639
|
children: [
|
|
1570
|
-
|
|
1640
|
+
R.enablePiP && /* @__PURE__ */ p("button", {
|
|
1571
1641
|
className: "sdk-mobile-hdr-btn",
|
|
1572
1642
|
onClick: () => {
|
|
1573
|
-
|
|
1643
|
+
Z || Zr();
|
|
1574
1644
|
},
|
|
1575
|
-
style: { color:
|
|
1576
|
-
"aria-label":
|
|
1577
|
-
"aria-pressed":
|
|
1578
|
-
children: /* @__PURE__ */ p(
|
|
1645
|
+
style: { color: an ? h : "" },
|
|
1646
|
+
"aria-label": an ? "Exit picture-in-picture" : "Enter picture-in-picture",
|
|
1647
|
+
"aria-pressed": an,
|
|
1648
|
+
children: /* @__PURE__ */ p(be, {
|
|
1579
1649
|
size: 20,
|
|
1580
1650
|
"aria-hidden": "true"
|
|
1581
1651
|
})
|
|
1582
1652
|
}),
|
|
1583
|
-
|
|
1653
|
+
R.enableChromecast && !Z && /* @__PURE__ */ p("button", {
|
|
1584
1654
|
className: "sdk-mobile-hdr-btn",
|
|
1585
|
-
onClick:
|
|
1586
|
-
title:
|
|
1587
|
-
"aria-label":
|
|
1588
|
-
"aria-pressed": !!
|
|
1589
|
-
style: { color:
|
|
1590
|
-
children: /* @__PURE__ */ p(
|
|
1655
|
+
onClick: ri,
|
|
1656
|
+
title: Y ? `Casting to ${Y} — tap to disconnect` : "Cast to device",
|
|
1657
|
+
"aria-label": Y ? `Stop casting to ${Y}` : "Cast to device",
|
|
1658
|
+
"aria-pressed": !!Y,
|
|
1659
|
+
style: { color: Y ? "#3b82f6" : "" },
|
|
1660
|
+
children: /* @__PURE__ */ p(fe, {
|
|
1591
1661
|
size: 20,
|
|
1592
|
-
fill:
|
|
1662
|
+
fill: Y ? "currentColor" : "none",
|
|
1593
1663
|
"aria-hidden": "true"
|
|
1594
1664
|
})
|
|
1595
1665
|
}),
|
|
1596
|
-
|
|
1666
|
+
R.allowAirplay && dr && /* @__PURE__ */ p("button", {
|
|
1597
1667
|
className: "sdk-mobile-hdr-btn",
|
|
1598
|
-
onClick:
|
|
1599
|
-
"aria-label":
|
|
1600
|
-
"aria-pressed":
|
|
1601
|
-
style: { color:
|
|
1602
|
-
children: /* @__PURE__ */ p(
|
|
1668
|
+
onClick: ii,
|
|
1669
|
+
"aria-label": pr ? `Stop AirPlay to ${hr || "device"}` : "AirPlay to device",
|
|
1670
|
+
"aria-pressed": pr,
|
|
1671
|
+
style: { color: pr ? h : "" },
|
|
1672
|
+
children: /* @__PURE__ */ p(ue, {
|
|
1603
1673
|
size: 20,
|
|
1604
1674
|
"aria-hidden": "true"
|
|
1605
1675
|
})
|
|
@@ -1610,14 +1680,14 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1610
1680
|
/* @__PURE__ */ m("div", {
|
|
1611
1681
|
className: "sdk-mobile-center-controls sdk-mobile-ctrl",
|
|
1612
1682
|
children: [
|
|
1613
|
-
!
|
|
1683
|
+
!Z && /* @__PURE__ */ m("button", {
|
|
1614
1684
|
className: "sdk-mobile-seek-btn",
|
|
1615
|
-
onClick: () =>
|
|
1685
|
+
onClick: () => Q(W(Math.max(0, U(ui) - 10)), {
|
|
1616
1686
|
eventType: "fast_backward",
|
|
1617
1687
|
skipSeconds: 10
|
|
1618
1688
|
}),
|
|
1619
1689
|
"aria-label": "Rewind 10 seconds",
|
|
1620
|
-
children: [/* @__PURE__ */ p(
|
|
1690
|
+
children: [/* @__PURE__ */ p(Se, {
|
|
1621
1691
|
size: 22,
|
|
1622
1692
|
"aria-hidden": "true"
|
|
1623
1693
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -1628,30 +1698,30 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1628
1698
|
}),
|
|
1629
1699
|
/* @__PURE__ */ p("button", {
|
|
1630
1700
|
className: "sdk-mobile-play-btn",
|
|
1631
|
-
onClick:
|
|
1632
|
-
"aria-label":
|
|
1633
|
-
children:
|
|
1701
|
+
onClick: Hr,
|
|
1702
|
+
"aria-label": sn ? "Replay" : li ? "Pause" : "Play",
|
|
1703
|
+
children: sn ? /* @__PURE__ */ p(Se, {
|
|
1634
1704
|
size: 38,
|
|
1635
1705
|
"aria-hidden": "true"
|
|
1636
|
-
}) :
|
|
1706
|
+
}) : li ? /* @__PURE__ */ p(v, {
|
|
1637
1707
|
size: 38,
|
|
1638
1708
|
fill: "currentColor",
|
|
1639
1709
|
"aria-hidden": "true"
|
|
1640
|
-
}) : /* @__PURE__ */ p(
|
|
1710
|
+
}) : /* @__PURE__ */ p(xe, {
|
|
1641
1711
|
size: 38,
|
|
1642
1712
|
fill: "currentColor",
|
|
1643
1713
|
style: { marginLeft: "3px" },
|
|
1644
1714
|
"aria-hidden": "true"
|
|
1645
1715
|
})
|
|
1646
1716
|
}),
|
|
1647
|
-
!
|
|
1717
|
+
!Z && /* @__PURE__ */ m("button", {
|
|
1648
1718
|
className: "sdk-mobile-seek-btn",
|
|
1649
|
-
onClick: () =>
|
|
1719
|
+
onClick: () => Q(W(Math.min(H, U(ui) + 10)), {
|
|
1650
1720
|
eventType: "fast_forward",
|
|
1651
1721
|
skipSeconds: 10
|
|
1652
1722
|
}),
|
|
1653
1723
|
"aria-label": "Skip forward 10 seconds",
|
|
1654
|
-
children: [/* @__PURE__ */ p(
|
|
1724
|
+
children: [/* @__PURE__ */ p(Ce, {
|
|
1655
1725
|
size: 22,
|
|
1656
1726
|
"aria-hidden": "true"
|
|
1657
1727
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -1665,25 +1735,25 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1665
1735
|
/* @__PURE__ */ m("div", {
|
|
1666
1736
|
className: "sdk-mobile-bottom-bar sdk-mobile-ctrl",
|
|
1667
1737
|
children: [
|
|
1668
|
-
|
|
1738
|
+
R.enableKeyMoments && Zn && K.length > 0 && /* @__PURE__ */ p("div", {
|
|
1669
1739
|
className: "sdk-mobile-chapters-scroll",
|
|
1670
|
-
children:
|
|
1671
|
-
let n =
|
|
1740
|
+
children: K.map((e, t) => {
|
|
1741
|
+
let n = Kn.index === t;
|
|
1672
1742
|
return /* @__PURE__ */ m("div", {
|
|
1673
1743
|
role: "button",
|
|
1674
1744
|
tabIndex: 0,
|
|
1675
1745
|
className: `sdk-mobile-chapter-card${n ? " active" : ""}`,
|
|
1676
|
-
style: { borderColor: n ?
|
|
1677
|
-
"aria-label": `${e.title}, ${
|
|
1746
|
+
style: { borderColor: n ? h : void 0 },
|
|
1747
|
+
"aria-label": `${e.title}, ${$(e.startTime)}${n ? ", current chapter" : ""}`,
|
|
1678
1748
|
"aria-current": n ? "true" : void 0,
|
|
1679
1749
|
onClick: () => {
|
|
1680
|
-
|
|
1750
|
+
Xr(e.startTime, e);
|
|
1681
1751
|
},
|
|
1682
|
-
onKeyDown:
|
|
1752
|
+
onKeyDown: _i(() => Xr(e.startTime, e)),
|
|
1683
1753
|
children: [/* @__PURE__ */ m("div", {
|
|
1684
1754
|
className: "sdk-mobile-chapter-thumb",
|
|
1685
|
-
children: [
|
|
1686
|
-
src:
|
|
1755
|
+
children: [$n[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
|
|
1756
|
+
src: $n[t] || e.thumbnail,
|
|
1687
1757
|
alt: "",
|
|
1688
1758
|
"aria-hidden": "true",
|
|
1689
1759
|
style: {
|
|
@@ -1695,61 +1765,61 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1695
1765
|
}) : /* @__PURE__ */ p(_e, {
|
|
1696
1766
|
size: 16,
|
|
1697
1767
|
"aria-hidden": "true",
|
|
1698
|
-
style: { color: n ?
|
|
1768
|
+
style: { color: n ? h : "rgba(255,255,255,0.3)" }
|
|
1699
1769
|
}), /* @__PURE__ */ p("span", {
|
|
1700
1770
|
className: "sdk-mobile-chapter-time-badge",
|
|
1701
1771
|
"aria-hidden": "true",
|
|
1702
|
-
children:
|
|
1772
|
+
children: $(e.startTime)
|
|
1703
1773
|
})]
|
|
1704
1774
|
}), /* @__PURE__ */ p("div", {
|
|
1705
1775
|
className: "sdk-mobile-chapter-title",
|
|
1706
|
-
style: { color: n ?
|
|
1776
|
+
style: { color: n ? h : void 0 },
|
|
1707
1777
|
children: e.title
|
|
1708
1778
|
})]
|
|
1709
1779
|
}, t);
|
|
1710
1780
|
})
|
|
1711
1781
|
}),
|
|
1712
1782
|
/* @__PURE__ */ p("div", {
|
|
1713
|
-
ref:
|
|
1714
|
-
role:
|
|
1715
|
-
"aria-label":
|
|
1716
|
-
"aria-valuemin":
|
|
1717
|
-
"aria-valuemax":
|
|
1718
|
-
"aria-valuenow":
|
|
1719
|
-
"aria-valuetext":
|
|
1720
|
-
tabIndex:
|
|
1721
|
-
className: `sdk-seekbar-container sdk-mobile-seekbar${
|
|
1722
|
-
onMouseDown:
|
|
1723
|
-
onMouseMove:
|
|
1724
|
-
onMouseLeave:
|
|
1725
|
-
onTouchStart:
|
|
1726
|
-
onKeyDown:
|
|
1783
|
+
ref: E,
|
|
1784
|
+
role: Z ? void 0 : "slider",
|
|
1785
|
+
"aria-label": Z ? void 0 : "Seek",
|
|
1786
|
+
"aria-valuemin": Z ? void 0 : 0,
|
|
1787
|
+
"aria-valuemax": Z ? void 0 : Math.round(H),
|
|
1788
|
+
"aria-valuenow": Z ? void 0 : Math.round(U(X === null ? z : X)),
|
|
1789
|
+
"aria-valuetext": Z ? void 0 : `${$(U(X === null ? z : X))} of ${$(H)}`,
|
|
1790
|
+
tabIndex: Z ? void 0 : 0,
|
|
1791
|
+
className: `sdk-seekbar-container sdk-mobile-seekbar${Z ? " sdk-ad-mode" : ""}`,
|
|
1792
|
+
onMouseDown: Z ? void 0 : Wr,
|
|
1793
|
+
onMouseMove: Z ? void 0 : ai,
|
|
1794
|
+
onMouseLeave: Z ? void 0 : ci,
|
|
1795
|
+
onTouchStart: Z ? void 0 : si,
|
|
1796
|
+
onKeyDown: Z ? void 0 : vi,
|
|
1727
1797
|
style: {
|
|
1728
|
-
pointerEvents:
|
|
1798
|
+
pointerEvents: Z ? "none" : void 0,
|
|
1729
1799
|
touchAction: "none"
|
|
1730
1800
|
},
|
|
1731
|
-
children:
|
|
1801
|
+
children: Z ? /* @__PURE__ */ p("div", {
|
|
1732
1802
|
className: "sdk-ad-progress-fill",
|
|
1733
1803
|
style: { width: (() => {
|
|
1734
|
-
let e =
|
|
1804
|
+
let e = L ? L.getCurrentTime() : z, t = B.find((t) => e >= t.startTime && e < t.endTime);
|
|
1735
1805
|
return t ? `${Math.min(100, Math.max(0, (e - t.startTime) / (t.endTime - t.startTime) * 100))}%` : "0%";
|
|
1736
1806
|
})() }
|
|
1737
1807
|
}) : /* @__PURE__ */ m(f, { children: [
|
|
1738
1808
|
/* @__PURE__ */ p("div", {
|
|
1739
1809
|
className: "sdk-seekbar-buffered",
|
|
1740
|
-
style: { width: `${Ut ? (
|
|
1810
|
+
style: { width: `${Ut ? (L && L.getBufferedRanges()[0]?.end || 0) / Ut * 100 : 0}%` }
|
|
1741
1811
|
}),
|
|
1742
|
-
|
|
1812
|
+
H > 0 && B.filter((e) => !fn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
|
|
1743
1813
|
className: "sdk-seekbar-adbreak",
|
|
1744
1814
|
style: {
|
|
1745
|
-
left: `${
|
|
1815
|
+
left: `${U(e.startTime) / H * 100}%`,
|
|
1746
1816
|
width: "3px"
|
|
1747
1817
|
}
|
|
1748
1818
|
}, t)),
|
|
1749
1819
|
/* @__PURE__ */ p("div", {
|
|
1750
1820
|
className: "sdk-seekbar-progress",
|
|
1751
1821
|
style: {
|
|
1752
|
-
width:
|
|
1822
|
+
width: Y ? `${di > 0 ? ui / di * 100 : 0}%` : `${H ? U(X === null ? z : X) / H * 100 : 0}%`,
|
|
1753
1823
|
background: "#ffffff",
|
|
1754
1824
|
boxShadow: "none"
|
|
1755
1825
|
},
|
|
@@ -1761,48 +1831,48 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1761
1831
|
}
|
|
1762
1832
|
})
|
|
1763
1833
|
}),
|
|
1764
|
-
|
|
1834
|
+
R.enableKeyMoments && K.map((e, t) => H === 0 ? null : /* @__PURE__ */ p("div", {
|
|
1765
1835
|
className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
|
|
1766
|
-
style: { left: `${
|
|
1836
|
+
style: { left: `${U(e.startTime) / H * 100}%` }
|
|
1767
1837
|
}, t))
|
|
1768
1838
|
] })
|
|
1769
1839
|
}),
|
|
1770
1840
|
/* @__PURE__ */ m("div", {
|
|
1771
1841
|
className: "sdk-mobile-controls-row",
|
|
1772
|
-
children: [!
|
|
1842
|
+
children: [!Z && /* @__PURE__ */ p("span", {
|
|
1773
1843
|
className: "sdk-time-display",
|
|
1774
|
-
children:
|
|
1844
|
+
children: Y ? `${$(ui)} / ${$(di)}` : `${$(U(X === null ? z : X))} / ${$(H)}`
|
|
1775
1845
|
}), /* @__PURE__ */ m("div", {
|
|
1776
1846
|
className: "sdk-mobile-bottom-icons",
|
|
1777
1847
|
children: [
|
|
1778
|
-
|
|
1779
|
-
className: `sdk-mobile-icon-btn${
|
|
1848
|
+
R.enableKeyMoments && K.length > 0 && !Z && /* @__PURE__ */ p("button", {
|
|
1849
|
+
className: `sdk-mobile-icon-btn${Zn ? " active" : ""}`,
|
|
1780
1850
|
onClick: () => {
|
|
1781
|
-
|
|
1851
|
+
Qn(!Zn);
|
|
1782
1852
|
},
|
|
1783
|
-
"aria-label":
|
|
1784
|
-
"aria-pressed":
|
|
1853
|
+
"aria-label": Zn ? "Hide chapters" : "Show chapters",
|
|
1854
|
+
"aria-pressed": Zn,
|
|
1785
1855
|
children: /* @__PURE__ */ p(_e, {
|
|
1786
1856
|
size: 18,
|
|
1787
1857
|
"aria-hidden": "true"
|
|
1788
1858
|
})
|
|
1789
1859
|
}),
|
|
1790
|
-
|
|
1860
|
+
R.enableSubtitles && !Z && Bn.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
|
|
1791
1861
|
className: "sdk-menu-container",
|
|
1792
1862
|
children: [/* @__PURE__ */ p("button", {
|
|
1793
|
-
className: `sdk-mobile-icon-btn${
|
|
1863
|
+
className: `sdk-mobile-icon-btn${G === "off" ? "" : " active"}`,
|
|
1794
1864
|
onClick: () => {
|
|
1795
|
-
|
|
1865
|
+
yi("subtitles");
|
|
1796
1866
|
},
|
|
1797
1867
|
"aria-label": "Captions",
|
|
1798
1868
|
"aria-haspopup": "listbox",
|
|
1799
|
-
"aria-expanded":
|
|
1800
|
-
children: /* @__PURE__ */ p(
|
|
1869
|
+
"aria-expanded": q === "subtitles",
|
|
1870
|
+
children: /* @__PURE__ */ p(de, {
|
|
1801
1871
|
size: 18,
|
|
1802
1872
|
"aria-hidden": "true"
|
|
1803
1873
|
})
|
|
1804
|
-
}),
|
|
1805
|
-
ref:
|
|
1874
|
+
}), q === "subtitles" && /* @__PURE__ */ m("div", {
|
|
1875
|
+
ref: bi,
|
|
1806
1876
|
className: "sdk-dropup-menu",
|
|
1807
1877
|
role: "listbox",
|
|
1808
1878
|
"aria-label": "Captions",
|
|
@@ -1814,24 +1884,24 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1814
1884
|
}),
|
|
1815
1885
|
/* @__PURE__ */ m("div", {
|
|
1816
1886
|
role: "option",
|
|
1817
|
-
"aria-selected":
|
|
1887
|
+
"aria-selected": G === "off",
|
|
1818
1888
|
tabIndex: 0,
|
|
1819
|
-
className: `sdk-dropup-item ${
|
|
1820
|
-
onClick: () =>
|
|
1821
|
-
onKeyDown:
|
|
1822
|
-
children: [/* @__PURE__ */ p("span", { children: "Off" }),
|
|
1889
|
+
className: `sdk-dropup-item ${G === "off" ? "active" : ""}`,
|
|
1890
|
+
onClick: () => Jr("off"),
|
|
1891
|
+
onKeyDown: gi(() => Jr("off")),
|
|
1892
|
+
children: [/* @__PURE__ */ p("span", { children: "Off" }), G === "off" && /* @__PURE__ */ p(_, {
|
|
1823
1893
|
size: 12,
|
|
1824
1894
|
"aria-hidden": "true"
|
|
1825
1895
|
})]
|
|
1826
1896
|
}),
|
|
1827
|
-
|
|
1897
|
+
Bn.map((e) => /* @__PURE__ */ m("div", {
|
|
1828
1898
|
role: "option",
|
|
1829
|
-
"aria-selected":
|
|
1899
|
+
"aria-selected": G === e.id,
|
|
1830
1900
|
tabIndex: 0,
|
|
1831
|
-
className: `sdk-dropup-item ${
|
|
1832
|
-
onClick: () =>
|
|
1833
|
-
onKeyDown:
|
|
1834
|
-
children: [/* @__PURE__ */ p("span", { children:
|
|
1901
|
+
className: `sdk-dropup-item ${G === e.id ? "active" : ""}`,
|
|
1902
|
+
onClick: () => Jr(e.id),
|
|
1903
|
+
onKeyDown: gi(() => Jr(e.id)),
|
|
1904
|
+
children: [/* @__PURE__ */ p("span", { children: b(e) }), G === e.id && /* @__PURE__ */ p(_, {
|
|
1835
1905
|
size: 12,
|
|
1836
1906
|
"aria-hidden": "true"
|
|
1837
1907
|
})]
|
|
@@ -1839,22 +1909,22 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1839
1909
|
]
|
|
1840
1910
|
})]
|
|
1841
1911
|
}),
|
|
1842
|
-
|
|
1912
|
+
R.allowMultipleAudio && Hn.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
1843
1913
|
className: "sdk-menu-container",
|
|
1844
1914
|
children: [/* @__PURE__ */ p("button", {
|
|
1845
|
-
className: `sdk-mobile-icon-btn${
|
|
1915
|
+
className: `sdk-mobile-icon-btn${q === "audio" ? " active" : ""}`,
|
|
1846
1916
|
onClick: () => {
|
|
1847
|
-
|
|
1917
|
+
yi("audio");
|
|
1848
1918
|
},
|
|
1849
1919
|
"aria-label": "Audio track",
|
|
1850
1920
|
"aria-haspopup": "listbox",
|
|
1851
|
-
"aria-expanded":
|
|
1921
|
+
"aria-expanded": q === "audio",
|
|
1852
1922
|
children: /* @__PURE__ */ p(ge, {
|
|
1853
1923
|
size: 18,
|
|
1854
1924
|
"aria-hidden": "true"
|
|
1855
1925
|
})
|
|
1856
|
-
}),
|
|
1857
|
-
ref:
|
|
1926
|
+
}), q === "audio" && /* @__PURE__ */ m("div", {
|
|
1927
|
+
ref: bi,
|
|
1858
1928
|
className: "sdk-dropup-menu",
|
|
1859
1929
|
role: "listbox",
|
|
1860
1930
|
"aria-label": "Audio track",
|
|
@@ -1862,40 +1932,40 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1862
1932
|
className: "sdk-dropup-header",
|
|
1863
1933
|
"aria-hidden": "true",
|
|
1864
1934
|
children: "Audio Track"
|
|
1865
|
-
}),
|
|
1935
|
+
}), Hn.map((e) => /* @__PURE__ */ m("div", {
|
|
1866
1936
|
role: "option",
|
|
1867
|
-
"aria-selected":
|
|
1937
|
+
"aria-selected": Wn === e.id,
|
|
1868
1938
|
tabIndex: 0,
|
|
1869
|
-
className: `sdk-dropup-item ${
|
|
1939
|
+
className: `sdk-dropup-item ${Wn === e.id ? "active" : ""}`,
|
|
1870
1940
|
onClick: () => {
|
|
1871
|
-
|
|
1941
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
1872
1942
|
},
|
|
1873
|
-
onKeyDown:
|
|
1874
|
-
|
|
1943
|
+
onKeyDown: gi(() => {
|
|
1944
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
1875
1945
|
}),
|
|
1876
|
-
children: [/* @__PURE__ */ p("span", { children:
|
|
1946
|
+
children: [/* @__PURE__ */ p("span", { children: b(e) }), Wn === e.id && /* @__PURE__ */ p(_, {
|
|
1877
1947
|
size: 12,
|
|
1878
1948
|
"aria-hidden": "true"
|
|
1879
1949
|
})]
|
|
1880
1950
|
}, e.id))]
|
|
1881
1951
|
})]
|
|
1882
1952
|
}),
|
|
1883
|
-
|
|
1953
|
+
R.enablePlaybackSpeed && !Z && /* @__PURE__ */ m("div", {
|
|
1884
1954
|
className: "sdk-menu-container",
|
|
1885
1955
|
children: [/* @__PURE__ */ p("button", {
|
|
1886
|
-
className: `sdk-mobile-icon-btn${
|
|
1956
|
+
className: `sdk-mobile-icon-btn${q === "speed" ? " active" : ""}`,
|
|
1887
1957
|
onClick: () => {
|
|
1888
|
-
|
|
1958
|
+
yi("speed");
|
|
1889
1959
|
},
|
|
1890
1960
|
"aria-label": "Playback speed",
|
|
1891
1961
|
"aria-haspopup": "listbox",
|
|
1892
|
-
"aria-expanded":
|
|
1962
|
+
"aria-expanded": q === "speed",
|
|
1893
1963
|
children: /* @__PURE__ */ p(he, {
|
|
1894
1964
|
size: 18,
|
|
1895
1965
|
"aria-hidden": "true"
|
|
1896
1966
|
})
|
|
1897
|
-
}),
|
|
1898
|
-
ref:
|
|
1967
|
+
}), q === "speed" && /* @__PURE__ */ m("div", {
|
|
1968
|
+
ref: bi,
|
|
1899
1969
|
className: "sdk-dropup-menu",
|
|
1900
1970
|
role: "listbox",
|
|
1901
1971
|
"aria-label": "Playback speed",
|
|
@@ -1912,34 +1982,34 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1912
1982
|
2
|
|
1913
1983
|
].map((e) => /* @__PURE__ */ m("div", {
|
|
1914
1984
|
role: "option",
|
|
1915
|
-
"aria-selected":
|
|
1985
|
+
"aria-selected": Yn === e,
|
|
1916
1986
|
tabIndex: 0,
|
|
1917
|
-
className: `sdk-dropup-item ${
|
|
1918
|
-
onClick: () =>
|
|
1919
|
-
onKeyDown:
|
|
1920
|
-
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }),
|
|
1987
|
+
className: `sdk-dropup-item ${Yn === e ? "active" : ""}`,
|
|
1988
|
+
onClick: () => Kr(e),
|
|
1989
|
+
onKeyDown: gi(() => Kr(e)),
|
|
1990
|
+
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), Yn === e && /* @__PURE__ */ p(_, {
|
|
1921
1991
|
size: 12,
|
|
1922
1992
|
"aria-hidden": "true"
|
|
1923
1993
|
})]
|
|
1924
1994
|
}, e))]
|
|
1925
1995
|
})]
|
|
1926
1996
|
}),
|
|
1927
|
-
|
|
1997
|
+
R.enableQuality && !Z && /* @__PURE__ */ m("div", {
|
|
1928
1998
|
className: "sdk-menu-container",
|
|
1929
1999
|
children: [/* @__PURE__ */ p("button", {
|
|
1930
|
-
className: `sdk-mobile-icon-btn${
|
|
2000
|
+
className: `sdk-mobile-icon-btn${Fn.id === -1 ? "" : " active"}`,
|
|
1931
2001
|
onClick: () => {
|
|
1932
|
-
|
|
2002
|
+
yi("quality");
|
|
1933
2003
|
},
|
|
1934
2004
|
"aria-label": "Video quality",
|
|
1935
2005
|
"aria-haspopup": "listbox",
|
|
1936
|
-
"aria-expanded":
|
|
1937
|
-
children: /* @__PURE__ */ p(
|
|
2006
|
+
"aria-expanded": q === "quality",
|
|
2007
|
+
children: /* @__PURE__ */ p(y, {
|
|
1938
2008
|
size: 18,
|
|
1939
2009
|
"aria-hidden": "true"
|
|
1940
2010
|
})
|
|
1941
|
-
}),
|
|
1942
|
-
ref:
|
|
2011
|
+
}), q === "quality" && /* @__PURE__ */ m("div", {
|
|
2012
|
+
ref: bi,
|
|
1943
2013
|
className: "sdk-dropup-menu large",
|
|
1944
2014
|
role: "listbox",
|
|
1945
2015
|
"aria-label": "Video quality",
|
|
@@ -1947,36 +2017,36 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1947
2017
|
className: "sdk-dropup-header",
|
|
1948
2018
|
"aria-hidden": "true",
|
|
1949
2019
|
children: "Quality"
|
|
1950
|
-
}),
|
|
2020
|
+
}), Nn.map((e) => /* @__PURE__ */ m("div", {
|
|
1951
2021
|
role: "option",
|
|
1952
|
-
"aria-selected":
|
|
2022
|
+
"aria-selected": Fn.id === e.id,
|
|
1953
2023
|
tabIndex: 0,
|
|
1954
|
-
className: `sdk-dropup-item ${
|
|
1955
|
-
onClick: () =>
|
|
1956
|
-
onKeyDown:
|
|
1957
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2024
|
+
className: `sdk-dropup-item ${Fn.id === e.id ? "active" : ""}`,
|
|
2025
|
+
onClick: () => qr(e.id),
|
|
2026
|
+
onKeyDown: gi(() => qr(e.id)),
|
|
2027
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), Fn.id === e.id && /* @__PURE__ */ p(_, {
|
|
1958
2028
|
size: 12,
|
|
1959
2029
|
"aria-hidden": "true"
|
|
1960
2030
|
})]
|
|
1961
2031
|
}, e.id))]
|
|
1962
2032
|
})]
|
|
1963
2033
|
}),
|
|
1964
|
-
S && S.length > 1 && !
|
|
2034
|
+
S && S.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
1965
2035
|
className: "sdk-menu-container",
|
|
1966
2036
|
children: [/* @__PURE__ */ p("button", {
|
|
1967
|
-
className: `sdk-mobile-icon-btn${
|
|
2037
|
+
className: `sdk-mobile-icon-btn${q === "sources" ? " active" : ""}`,
|
|
1968
2038
|
onClick: () => {
|
|
1969
|
-
|
|
2039
|
+
yi("sources");
|
|
1970
2040
|
},
|
|
1971
2041
|
"aria-label": "Select source",
|
|
1972
2042
|
"aria-haspopup": "listbox",
|
|
1973
|
-
"aria-expanded":
|
|
1974
|
-
children: /* @__PURE__ */ p(
|
|
2043
|
+
"aria-expanded": q === "sources",
|
|
2044
|
+
children: /* @__PURE__ */ p(Me, {
|
|
1975
2045
|
size: 18,
|
|
1976
2046
|
"aria-hidden": "true"
|
|
1977
2047
|
})
|
|
1978
|
-
}),
|
|
1979
|
-
ref:
|
|
2048
|
+
}), q === "sources" && /* @__PURE__ */ m("div", {
|
|
2049
|
+
ref: bi,
|
|
1980
2050
|
className: "sdk-dropup-menu",
|
|
1981
2051
|
role: "listbox",
|
|
1982
2052
|
"aria-label": "Select source",
|
|
@@ -1986,12 +2056,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1986
2056
|
children: "Source"
|
|
1987
2057
|
}), S.map((e, t) => /* @__PURE__ */ m("div", {
|
|
1988
2058
|
role: "option",
|
|
1989
|
-
"aria-selected":
|
|
2059
|
+
"aria-selected": C === t,
|
|
1990
2060
|
tabIndex: 0,
|
|
1991
|
-
className: `sdk-dropup-item ${
|
|
1992
|
-
onClick: () =>
|
|
1993
|
-
onKeyDown:
|
|
1994
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2061
|
+
className: `sdk-dropup-item ${C === t ? "active" : ""}`,
|
|
2062
|
+
onClick: () => Yr(t),
|
|
2063
|
+
onKeyDown: gi(() => Yr(t)),
|
|
2064
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), C === t && /* @__PURE__ */ p(_, {
|
|
1995
2065
|
size: 12,
|
|
1996
2066
|
"aria-hidden": "true"
|
|
1997
2067
|
})]
|
|
@@ -2000,9 +2070,9 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2000
2070
|
}),
|
|
2001
2071
|
/* @__PURE__ */ p("button", {
|
|
2002
2072
|
className: "sdk-mobile-icon-btn",
|
|
2003
|
-
onClick:
|
|
2004
|
-
"aria-label": Zt ||
|
|
2005
|
-
"aria-pressed": Zt ||
|
|
2073
|
+
onClick: Qr,
|
|
2074
|
+
"aria-label": Zt || $t ? "Exit fullscreen" : "Enter fullscreen",
|
|
2075
|
+
"aria-pressed": Zt || $t,
|
|
2006
2076
|
children: p(Zt ? ye : ve, {
|
|
2007
2077
|
size: 18,
|
|
2008
2078
|
"aria-hidden": "true"
|
|
@@ -2015,82 +2085,82 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2015
2085
|
})
|
|
2016
2086
|
] })]
|
|
2017
2087
|
}),
|
|
2018
|
-
!
|
|
2088
|
+
!rn && /* @__PURE__ */ m("div", {
|
|
2019
2089
|
className: "sdk-controls-overlay",
|
|
2020
2090
|
onClick: (e) => {
|
|
2021
|
-
|
|
2091
|
+
Z || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") || Hr();
|
|
2022
2092
|
},
|
|
2023
2093
|
children: [/* @__PURE__ */ m("div", {
|
|
2024
2094
|
className: "sdk-desktop-header",
|
|
2025
2095
|
children: [/* @__PURE__ */ m("div", {
|
|
2026
2096
|
className: "sdk-desktop-header-left",
|
|
2027
|
-
children: [(Zt ||
|
|
2097
|
+
children: [(Zt || $t) && /* @__PURE__ */ p("button", {
|
|
2028
2098
|
className: "sdk-desktop-back-btn",
|
|
2029
2099
|
onClick: (e) => {
|
|
2030
|
-
e.stopPropagation(),
|
|
2100
|
+
e.stopPropagation(), Qr();
|
|
2031
2101
|
},
|
|
2032
2102
|
"aria-label": "Exit fullscreen",
|
|
2033
|
-
children: /* @__PURE__ */ p(
|
|
2103
|
+
children: /* @__PURE__ */ p(pe, {
|
|
2034
2104
|
size: 22,
|
|
2035
2105
|
"aria-hidden": "true"
|
|
2036
2106
|
})
|
|
2037
|
-
}), (
|
|
2107
|
+
}), (x || Or) && /* @__PURE__ */ p("span", {
|
|
2038
2108
|
className: "sdk-desktop-title",
|
|
2039
|
-
children:
|
|
2109
|
+
children: x || Or
|
|
2040
2110
|
})]
|
|
2041
2111
|
}), /* @__PURE__ */ m("div", {
|
|
2042
2112
|
className: "sdk-desktop-header-right",
|
|
2043
2113
|
children: [
|
|
2044
|
-
|
|
2114
|
+
R.enableChromecast && !Z && /* @__PURE__ */ p("button", {
|
|
2045
2115
|
className: "sdk-desktop-hdr-btn",
|
|
2046
2116
|
onClick: (e) => {
|
|
2047
|
-
e.stopPropagation(),
|
|
2117
|
+
e.stopPropagation(), ri();
|
|
2048
2118
|
},
|
|
2049
|
-
title:
|
|
2050
|
-
"aria-label":
|
|
2051
|
-
"aria-pressed": !!
|
|
2052
|
-
style: { color:
|
|
2053
|
-
children: /* @__PURE__ */ p(
|
|
2119
|
+
title: Y ? `Casting to ${Y} — click to disconnect` : "Cast to device",
|
|
2120
|
+
"aria-label": Y ? `Stop casting to ${Y}` : "Cast to device",
|
|
2121
|
+
"aria-pressed": !!Y,
|
|
2122
|
+
style: { color: Y ? "#3b82f6" : "" },
|
|
2123
|
+
children: /* @__PURE__ */ p(fe, {
|
|
2054
2124
|
size: 20,
|
|
2055
|
-
fill:
|
|
2125
|
+
fill: Y ? "currentColor" : "none",
|
|
2056
2126
|
"aria-hidden": "true"
|
|
2057
2127
|
})
|
|
2058
2128
|
}),
|
|
2059
|
-
|
|
2129
|
+
Y && /* @__PURE__ */ m("span", {
|
|
2060
2130
|
className: "sdk-cast-indicator",
|
|
2061
2131
|
"aria-hidden": "true",
|
|
2062
|
-
children: [/* @__PURE__ */ p(
|
|
2132
|
+
children: [/* @__PURE__ */ p(fe, {
|
|
2063
2133
|
size: 10,
|
|
2064
2134
|
fill: "currentColor",
|
|
2065
2135
|
"aria-hidden": "true"
|
|
2066
|
-
}),
|
|
2136
|
+
}), Y]
|
|
2067
2137
|
}),
|
|
2068
|
-
|
|
2138
|
+
R.allowAirplay && dr && /* @__PURE__ */ p("button", {
|
|
2069
2139
|
className: "sdk-desktop-hdr-btn",
|
|
2070
2140
|
onClick: (e) => {
|
|
2071
|
-
e.stopPropagation(),
|
|
2141
|
+
e.stopPropagation(), ii();
|
|
2072
2142
|
},
|
|
2073
|
-
title:
|
|
2074
|
-
"aria-label":
|
|
2075
|
-
"aria-pressed":
|
|
2076
|
-
style: { color:
|
|
2077
|
-
children: /* @__PURE__ */ p(
|
|
2143
|
+
title: pr ? `AirPlay to ${hr || "device"} — click to disconnect` : "AirPlay to device",
|
|
2144
|
+
"aria-label": pr ? `Stop AirPlay to ${hr || "device"}` : "AirPlay to device",
|
|
2145
|
+
"aria-pressed": pr,
|
|
2146
|
+
style: { color: pr ? h : "" },
|
|
2147
|
+
children: /* @__PURE__ */ p(ue, {
|
|
2078
2148
|
size: 20,
|
|
2079
2149
|
"aria-hidden": "true"
|
|
2080
2150
|
})
|
|
2081
2151
|
})
|
|
2082
2152
|
]
|
|
2083
2153
|
})]
|
|
2084
|
-
}),
|
|
2154
|
+
}), le && /* @__PURE__ */ m(f, { children: [
|
|
2085
2155
|
/* @__PURE__ */ m("div", {
|
|
2086
2156
|
className: "sdk-desktop-center-controls",
|
|
2087
2157
|
style: { pointerEvents: "none" },
|
|
2088
2158
|
children: [
|
|
2089
|
-
!
|
|
2159
|
+
!Z && /* @__PURE__ */ p("button", {
|
|
2090
2160
|
className: "sdk-desktop-seek-btn",
|
|
2091
2161
|
style: { pointerEvents: "auto" },
|
|
2092
2162
|
onClick: (e) => {
|
|
2093
|
-
e.stopPropagation(),
|
|
2163
|
+
e.stopPropagation(), Q(W(Math.max(0, U(ui) - 10)), {
|
|
2094
2164
|
eventType: "fast_backward",
|
|
2095
2165
|
skipSeconds: 10
|
|
2096
2166
|
});
|
|
@@ -2104,7 +2174,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2104
2174
|
alignItems: "center",
|
|
2105
2175
|
justifyContent: "center"
|
|
2106
2176
|
},
|
|
2107
|
-
children: [/* @__PURE__ */ p(
|
|
2177
|
+
children: [/* @__PURE__ */ p(Se, {
|
|
2108
2178
|
size: 30,
|
|
2109
2179
|
"aria-hidden": "true"
|
|
2110
2180
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -2118,29 +2188,29 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2118
2188
|
className: "sdk-desktop-play-btn",
|
|
2119
2189
|
style: { pointerEvents: "auto" },
|
|
2120
2190
|
onClick: (e) => {
|
|
2121
|
-
e.stopPropagation(),
|
|
2191
|
+
e.stopPropagation(), Hr();
|
|
2122
2192
|
},
|
|
2123
|
-
title:
|
|
2124
|
-
"aria-label":
|
|
2125
|
-
children:
|
|
2193
|
+
title: sn ? "Replay" : li ? "Pause" : "Play",
|
|
2194
|
+
"aria-label": sn ? "Replay" : li ? "Pause" : "Play",
|
|
2195
|
+
children: sn ? /* @__PURE__ */ p(Se, {
|
|
2126
2196
|
size: 38,
|
|
2127
2197
|
"aria-hidden": "true"
|
|
2128
|
-
}) :
|
|
2198
|
+
}) : li ? /* @__PURE__ */ p(v, {
|
|
2129
2199
|
size: 38,
|
|
2130
2200
|
fill: "currentColor",
|
|
2131
2201
|
"aria-hidden": "true"
|
|
2132
|
-
}) : /* @__PURE__ */ p(
|
|
2202
|
+
}) : /* @__PURE__ */ p(xe, {
|
|
2133
2203
|
size: 38,
|
|
2134
2204
|
fill: "currentColor",
|
|
2135
2205
|
style: { marginLeft: "4px" },
|
|
2136
2206
|
"aria-hidden": "true"
|
|
2137
2207
|
})
|
|
2138
2208
|
}),
|
|
2139
|
-
!
|
|
2209
|
+
!Z && /* @__PURE__ */ p("button", {
|
|
2140
2210
|
className: "sdk-desktop-seek-btn",
|
|
2141
2211
|
style: { pointerEvents: "auto" },
|
|
2142
2212
|
onClick: (e) => {
|
|
2143
|
-
e.stopPropagation(),
|
|
2213
|
+
e.stopPropagation(), Q(W(Math.min(H, U(ui) + 10)), {
|
|
2144
2214
|
eventType: "fast_forward",
|
|
2145
2215
|
skipSeconds: 10
|
|
2146
2216
|
});
|
|
@@ -2154,7 +2224,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2154
2224
|
alignItems: "center",
|
|
2155
2225
|
justifyContent: "center"
|
|
2156
2226
|
},
|
|
2157
|
-
children: [/* @__PURE__ */ p(
|
|
2227
|
+
children: [/* @__PURE__ */ p(Ce, {
|
|
2158
2228
|
size: 30,
|
|
2159
2229
|
"aria-hidden": "true"
|
|
2160
2230
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -2166,7 +2236,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2166
2236
|
})
|
|
2167
2237
|
]
|
|
2168
2238
|
}),
|
|
2169
|
-
|
|
2239
|
+
R.enableKeyMoments && Zn && K.length > 0 && qe === "panel" && /* @__PURE__ */ m("div", {
|
|
2170
2240
|
className: "sdk-chapters-panel",
|
|
2171
2241
|
onClick: (e) => e.stopPropagation(),
|
|
2172
2242
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -2177,20 +2247,20 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2177
2247
|
})
|
|
2178
2248
|
}), /* @__PURE__ */ p("div", {
|
|
2179
2249
|
className: "sdk-chapters-panel-list",
|
|
2180
|
-
children:
|
|
2181
|
-
let n =
|
|
2250
|
+
children: K.map((e, t) => {
|
|
2251
|
+
let n = Kn.index === t;
|
|
2182
2252
|
return /* @__PURE__ */ m("div", {
|
|
2183
2253
|
role: "button",
|
|
2184
2254
|
tabIndex: 0,
|
|
2185
2255
|
className: `sdk-chapters-panel-item${n ? " active" : ""}`,
|
|
2186
|
-
"aria-label": `${e.title}, ${
|
|
2256
|
+
"aria-label": `${e.title}, ${$(e.startTime)}${n ? ", current chapter" : ""}`,
|
|
2187
2257
|
"aria-current": n ? "true" : void 0,
|
|
2188
|
-
onClick: () =>
|
|
2189
|
-
onKeyDown:
|
|
2258
|
+
onClick: () => Xr(e.startTime, e),
|
|
2259
|
+
onKeyDown: _i(() => Xr(e.startTime, e)),
|
|
2190
2260
|
children: [/* @__PURE__ */ p("div", {
|
|
2191
2261
|
className: "sdk-chapters-panel-thumb",
|
|
2192
|
-
children:
|
|
2193
|
-
src:
|
|
2262
|
+
children: $n[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
|
|
2263
|
+
src: $n[t] || e.thumbnail,
|
|
2194
2264
|
alt: "",
|
|
2195
2265
|
"aria-hidden": "true",
|
|
2196
2266
|
style: {
|
|
@@ -2218,7 +2288,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2218
2288
|
/* @__PURE__ */ p("div", {
|
|
2219
2289
|
className: "sdk-chapters-panel-item-time",
|
|
2220
2290
|
"aria-hidden": "true",
|
|
2221
|
-
children:
|
|
2291
|
+
children: $(e.startTime)
|
|
2222
2292
|
})
|
|
2223
2293
|
]
|
|
2224
2294
|
})]
|
|
@@ -2229,25 +2299,25 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2229
2299
|
/* @__PURE__ */ m("div", {
|
|
2230
2300
|
className: "sdk-desktop-bottom",
|
|
2231
2301
|
children: [
|
|
2232
|
-
|
|
2302
|
+
R.enableKeyMoments && Zn && K.length > 0 && qe === "strip" && /* @__PURE__ */ p("div", {
|
|
2233
2303
|
className: "sdk-desktop-chapters-strip",
|
|
2234
|
-
children:
|
|
2235
|
-
let n =
|
|
2304
|
+
children: K.map((e, t) => {
|
|
2305
|
+
let n = Kn.index === t;
|
|
2236
2306
|
return /* @__PURE__ */ m("div", {
|
|
2237
2307
|
role: "button",
|
|
2238
2308
|
tabIndex: 0,
|
|
2239
2309
|
className: `sdk-desktop-chapter-card${n ? " active" : ""}`,
|
|
2240
|
-
"aria-label": `${e.title}, ${
|
|
2310
|
+
"aria-label": `${e.title}, ${$(e.startTime)}${n ? ", current chapter" : ""}`,
|
|
2241
2311
|
"aria-current": n ? "true" : void 0,
|
|
2242
2312
|
onClick: (t) => {
|
|
2243
|
-
t.stopPropagation(),
|
|
2313
|
+
t.stopPropagation(), Xr(e.startTime, e);
|
|
2244
2314
|
},
|
|
2245
|
-
onKeyDown:
|
|
2315
|
+
onKeyDown: _i(() => Xr(e.startTime, e)),
|
|
2246
2316
|
children: [
|
|
2247
2317
|
/* @__PURE__ */ p("div", {
|
|
2248
2318
|
className: "sdk-desktop-chapter-thumb",
|
|
2249
|
-
children:
|
|
2250
|
-
src:
|
|
2319
|
+
children: $n[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
|
|
2320
|
+
src: $n[t] || e.thumbnail,
|
|
2251
2321
|
alt: "",
|
|
2252
2322
|
"aria-hidden": "true",
|
|
2253
2323
|
style: {
|
|
@@ -2269,67 +2339,67 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2269
2339
|
/* @__PURE__ */ p("div", {
|
|
2270
2340
|
className: "sdk-desktop-chapter-time",
|
|
2271
2341
|
"aria-hidden": "true",
|
|
2272
|
-
children:
|
|
2342
|
+
children: $(e.startTime)
|
|
2273
2343
|
})
|
|
2274
2344
|
]
|
|
2275
2345
|
}, t);
|
|
2276
2346
|
})
|
|
2277
2347
|
}),
|
|
2278
2348
|
/* @__PURE__ */ p("div", {
|
|
2279
|
-
ref:
|
|
2280
|
-
role:
|
|
2281
|
-
"aria-label":
|
|
2282
|
-
"aria-valuemin":
|
|
2283
|
-
"aria-valuemax":
|
|
2284
|
-
"aria-valuenow":
|
|
2285
|
-
"aria-valuetext":
|
|
2286
|
-
tabIndex:
|
|
2287
|
-
className: `sdk-seekbar-container sdk-desktop-seekbar${
|
|
2288
|
-
onMouseDown:
|
|
2289
|
-
onMouseMove:
|
|
2290
|
-
onMouseLeave:
|
|
2291
|
-
onTouchStart:
|
|
2292
|
-
onKeyDown:
|
|
2293
|
-
style: { pointerEvents:
|
|
2294
|
-
children:
|
|
2349
|
+
ref: E,
|
|
2350
|
+
role: Z ? void 0 : "slider",
|
|
2351
|
+
"aria-label": Z ? void 0 : "Seek",
|
|
2352
|
+
"aria-valuemin": Z ? void 0 : 0,
|
|
2353
|
+
"aria-valuemax": Z ? void 0 : Math.round(H),
|
|
2354
|
+
"aria-valuenow": Z ? void 0 : Math.round(U(X === null ? z : X)),
|
|
2355
|
+
"aria-valuetext": Z ? void 0 : `${$(U(X === null ? z : X))} of ${$(H)}`,
|
|
2356
|
+
tabIndex: Z ? void 0 : 0,
|
|
2357
|
+
className: `sdk-seekbar-container sdk-desktop-seekbar${Z ? " sdk-ad-mode" : ""}`,
|
|
2358
|
+
onMouseDown: Z ? void 0 : Wr,
|
|
2359
|
+
onMouseMove: Z ? void 0 : ai,
|
|
2360
|
+
onMouseLeave: Z ? void 0 : ci,
|
|
2361
|
+
onTouchStart: Z ? void 0 : si,
|
|
2362
|
+
onKeyDown: Z ? void 0 : vi,
|
|
2363
|
+
style: { pointerEvents: Z ? "none" : void 0 },
|
|
2364
|
+
children: Z ? /* @__PURE__ */ p("div", {
|
|
2295
2365
|
className: "sdk-ad-progress-fill",
|
|
2296
2366
|
style: { width: (() => {
|
|
2297
|
-
let e =
|
|
2367
|
+
let e = L ? L.getCurrentTime() : z, t = B.find((t) => e >= t.startTime && e < t.endTime);
|
|
2298
2368
|
return t ? `${Math.min(100, Math.max(0, (e - t.startTime) / (t.endTime - t.startTime) * 100))}%` : "0%";
|
|
2299
2369
|
})() }
|
|
2300
2370
|
}) : /* @__PURE__ */ m(f, { children: [
|
|
2301
2371
|
/* @__PURE__ */ p("div", {
|
|
2302
2372
|
className: "sdk-seekbar-buffered",
|
|
2303
|
-
style: { width: `${Ut ? (
|
|
2373
|
+
style: { width: `${Ut ? (L && L.getBufferedRanges()[0]?.end || 0) / Ut * 100 : 0}%` }
|
|
2304
2374
|
}),
|
|
2305
|
-
|
|
2375
|
+
H > 0 && B.filter((e) => !fn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
|
|
2306
2376
|
className: "sdk-seekbar-adbreak",
|
|
2307
2377
|
style: {
|
|
2308
|
-
left: `${
|
|
2378
|
+
left: `${U(e.startTime) / H * 100}%`,
|
|
2309
2379
|
width: "3px"
|
|
2310
2380
|
}
|
|
2311
2381
|
}, t)),
|
|
2312
2382
|
/* @__PURE__ */ p("div", {
|
|
2313
2383
|
className: "sdk-seekbar-progress",
|
|
2314
2384
|
style: {
|
|
2315
|
-
width:
|
|
2385
|
+
width: Y ? `${di > 0 ? ui / di * 100 : 0}%` : `${H ? U(X === null ? z : X) / H * 100 : 0}%`,
|
|
2316
2386
|
background: "#ffffff",
|
|
2317
2387
|
boxShadow: "none"
|
|
2318
2388
|
},
|
|
2319
2389
|
children: /* @__PURE__ */ p("div", { className: "sdk-seekbar-handle" })
|
|
2320
2390
|
}),
|
|
2321
|
-
|
|
2391
|
+
R.enableKeyMoments && K.map((e, t) => H === 0 ? null : /* @__PURE__ */ p("div", {
|
|
2322
2392
|
className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
|
|
2323
|
-
style: { left: `${
|
|
2393
|
+
style: { left: `${U(e.startTime) / H * 100}%` }
|
|
2324
2394
|
}, t)),
|
|
2325
|
-
|
|
2395
|
+
_r !== null && Cr && /* @__PURE__ */ m("div", {
|
|
2326
2396
|
className: "sdk-thumbnail-tooltip",
|
|
2327
|
-
style: { left: `${
|
|
2397
|
+
style: { left: `${yr}px` },
|
|
2328
2398
|
children: [
|
|
2329
2399
|
/* @__PURE__ */ p("div", {
|
|
2330
2400
|
className: "sdk-thumbnail-preview",
|
|
2331
2401
|
children: /* @__PURE__ */ p("img", {
|
|
2332
|
-
src:
|
|
2402
|
+
src: Cr,
|
|
2333
2403
|
alt: "preview",
|
|
2334
2404
|
style: {
|
|
2335
2405
|
width: "100%",
|
|
@@ -2340,13 +2410,13 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2340
2410
|
}
|
|
2341
2411
|
})
|
|
2342
2412
|
}),
|
|
2343
|
-
|
|
2413
|
+
Tr && /* @__PURE__ */ p("div", {
|
|
2344
2414
|
className: "sdk-thumbnail-chapter-name",
|
|
2345
|
-
children:
|
|
2415
|
+
children: Tr.title
|
|
2346
2416
|
}),
|
|
2347
2417
|
/* @__PURE__ */ p("div", {
|
|
2348
2418
|
className: "sdk-thumbnail-time-label",
|
|
2349
|
-
children:
|
|
2419
|
+
children: $(U(xr))
|
|
2350
2420
|
})
|
|
2351
2421
|
]
|
|
2352
2422
|
})
|
|
@@ -2356,33 +2426,33 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2356
2426
|
className: "sdk-desktop-controls-row",
|
|
2357
2427
|
children: [/* @__PURE__ */ m("div", {
|
|
2358
2428
|
className: "sdk-desktop-left-controls",
|
|
2359
|
-
children: [!
|
|
2429
|
+
children: [!Z && /* @__PURE__ */ p("div", {
|
|
2360
2430
|
className: "sdk-time-display",
|
|
2361
|
-
children:
|
|
2431
|
+
children: Y ? `${$(ui)} / ${$(di)}` : `${$(U(X === null ? z : X))} / ${$(H)}`
|
|
2362
2432
|
}), Je === "slider" && /* @__PURE__ */ m("div", {
|
|
2363
2433
|
className: "sdk-volume-control",
|
|
2364
2434
|
children: [/* @__PURE__ */ p("button", {
|
|
2365
2435
|
className: "sdk-desktop-icon-btn",
|
|
2366
2436
|
onClick: (e) => {
|
|
2367
|
-
e.stopPropagation(),
|
|
2437
|
+
e.stopPropagation(), Gr();
|
|
2368
2438
|
},
|
|
2369
|
-
title:
|
|
2370
|
-
"aria-label":
|
|
2371
|
-
"aria-pressed":
|
|
2372
|
-
children:
|
|
2439
|
+
title: pi ? "Unmute" : "Mute",
|
|
2440
|
+
"aria-label": pi ? "Unmute" : "Mute",
|
|
2441
|
+
"aria-pressed": pi,
|
|
2442
|
+
children: hi()
|
|
2373
2443
|
}), /* @__PURE__ */ p("input", {
|
|
2374
2444
|
type: "range",
|
|
2375
2445
|
className: "sdk-volume-slider",
|
|
2376
2446
|
min: 0,
|
|
2377
2447
|
max: 1,
|
|
2378
2448
|
step: .02,
|
|
2379
|
-
value:
|
|
2449
|
+
value: pi ? 0 : fi,
|
|
2380
2450
|
"aria-label": "Volume",
|
|
2381
|
-
"aria-valuetext":
|
|
2382
|
-
style: { "--vol-pct": Math.round((
|
|
2451
|
+
"aria-valuetext": pi ? "Muted" : `${Math.round(fi * 100)}%`,
|
|
2452
|
+
style: { "--vol-pct": Math.round((pi ? 0 : fi) * 100) },
|
|
2383
2453
|
onChange: (e) => {
|
|
2384
2454
|
let t = parseFloat(e.target.value);
|
|
2385
|
-
|
|
2455
|
+
Y ? (L?.casting.remoteSetVolume(t), t > 0 && L?.casting.remoteSetMute(!1)) : (L?.setVolume(t), t > 0 && qt && L?.setMute(!1));
|
|
2386
2456
|
},
|
|
2387
2457
|
onClick: (e) => e.stopPropagation()
|
|
2388
2458
|
})]
|
|
@@ -2390,36 +2460,36 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2390
2460
|
}), /* @__PURE__ */ m("div", {
|
|
2391
2461
|
className: "sdk-desktop-right-icons",
|
|
2392
2462
|
children: [
|
|
2393
|
-
|
|
2394
|
-
className: `sdk-desktop-icon-btn${
|
|
2463
|
+
R.enableKeyMoments && K.length > 0 && !Z && /* @__PURE__ */ p("button", {
|
|
2464
|
+
className: `sdk-desktop-icon-btn${Zn ? " active" : ""}`,
|
|
2395
2465
|
onClick: (e) => {
|
|
2396
|
-
e.stopPropagation(),
|
|
2466
|
+
e.stopPropagation(), Qn(!Zn);
|
|
2397
2467
|
},
|
|
2398
2468
|
title: "Key Moments",
|
|
2399
|
-
"aria-label":
|
|
2400
|
-
"aria-pressed":
|
|
2469
|
+
"aria-label": Zn ? "Hide chapters" : "Show chapters",
|
|
2470
|
+
"aria-pressed": Zn,
|
|
2401
2471
|
children: /* @__PURE__ */ p(_e, {
|
|
2402
2472
|
size: 20,
|
|
2403
2473
|
"aria-hidden": "true"
|
|
2404
2474
|
})
|
|
2405
2475
|
}),
|
|
2406
|
-
|
|
2476
|
+
R.enableSubtitles && !Z && Bn.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
|
|
2407
2477
|
className: "sdk-menu-container",
|
|
2408
2478
|
children: [/* @__PURE__ */ p("button", {
|
|
2409
|
-
className: `sdk-desktop-icon-btn${
|
|
2479
|
+
className: `sdk-desktop-icon-btn${G === "off" ? "" : " active"}`,
|
|
2410
2480
|
onClick: (e) => {
|
|
2411
|
-
e.stopPropagation(),
|
|
2481
|
+
e.stopPropagation(), yi("subtitles");
|
|
2412
2482
|
},
|
|
2413
2483
|
title: "Captions",
|
|
2414
2484
|
"aria-label": "Captions",
|
|
2415
2485
|
"aria-haspopup": "listbox",
|
|
2416
|
-
"aria-expanded":
|
|
2417
|
-
children: /* @__PURE__ */ p(
|
|
2486
|
+
"aria-expanded": q === "subtitles",
|
|
2487
|
+
children: /* @__PURE__ */ p(de, {
|
|
2418
2488
|
size: 20,
|
|
2419
2489
|
"aria-hidden": "true"
|
|
2420
2490
|
})
|
|
2421
|
-
}),
|
|
2422
|
-
ref:
|
|
2491
|
+
}), q === "subtitles" && /* @__PURE__ */ m("div", {
|
|
2492
|
+
ref: bi,
|
|
2423
2493
|
className: "sdk-dropup-menu",
|
|
2424
2494
|
role: "listbox",
|
|
2425
2495
|
"aria-label": "Captions",
|
|
@@ -2431,24 +2501,24 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2431
2501
|
}),
|
|
2432
2502
|
/* @__PURE__ */ m("div", {
|
|
2433
2503
|
role: "option",
|
|
2434
|
-
"aria-selected":
|
|
2504
|
+
"aria-selected": G === "off",
|
|
2435
2505
|
tabIndex: 0,
|
|
2436
|
-
className: `sdk-dropup-item ${
|
|
2437
|
-
onClick: () =>
|
|
2438
|
-
onKeyDown:
|
|
2439
|
-
children: [/* @__PURE__ */ p("span", { children: "Off" }),
|
|
2506
|
+
className: `sdk-dropup-item ${G === "off" ? "active" : ""}`,
|
|
2507
|
+
onClick: () => Jr("off"),
|
|
2508
|
+
onKeyDown: gi(() => Jr("off")),
|
|
2509
|
+
children: [/* @__PURE__ */ p("span", { children: "Off" }), G === "off" && /* @__PURE__ */ p(_, {
|
|
2440
2510
|
size: 12,
|
|
2441
2511
|
"aria-hidden": "true"
|
|
2442
2512
|
})]
|
|
2443
2513
|
}),
|
|
2444
|
-
|
|
2514
|
+
Bn.map((e) => /* @__PURE__ */ m("div", {
|
|
2445
2515
|
role: "option",
|
|
2446
|
-
"aria-selected":
|
|
2516
|
+
"aria-selected": G === e.id,
|
|
2447
2517
|
tabIndex: 0,
|
|
2448
|
-
className: `sdk-dropup-item ${
|
|
2449
|
-
onClick: () =>
|
|
2450
|
-
onKeyDown:
|
|
2451
|
-
children: [/* @__PURE__ */ p("span", { children:
|
|
2518
|
+
className: `sdk-dropup-item ${G === e.id ? "active" : ""}`,
|
|
2519
|
+
onClick: () => Jr(e.id),
|
|
2520
|
+
onKeyDown: gi(() => Jr(e.id)),
|
|
2521
|
+
children: [/* @__PURE__ */ p("span", { children: b(e) }), G === e.id && /* @__PURE__ */ p(_, {
|
|
2452
2522
|
size: 12,
|
|
2453
2523
|
"aria-hidden": "true"
|
|
2454
2524
|
})]
|
|
@@ -2456,23 +2526,23 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2456
2526
|
]
|
|
2457
2527
|
})]
|
|
2458
2528
|
}),
|
|
2459
|
-
|
|
2529
|
+
R.allowMultipleAudio && Hn.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
2460
2530
|
className: "sdk-menu-container",
|
|
2461
2531
|
children: [/* @__PURE__ */ p("button", {
|
|
2462
|
-
className: `sdk-desktop-icon-btn${
|
|
2532
|
+
className: `sdk-desktop-icon-btn${q === "audio" ? " active" : ""}`,
|
|
2463
2533
|
onClick: (e) => {
|
|
2464
|
-
e.stopPropagation(),
|
|
2534
|
+
e.stopPropagation(), yi("audio");
|
|
2465
2535
|
},
|
|
2466
2536
|
title: "Audio Track",
|
|
2467
2537
|
"aria-label": "Audio track",
|
|
2468
2538
|
"aria-haspopup": "listbox",
|
|
2469
|
-
"aria-expanded":
|
|
2539
|
+
"aria-expanded": q === "audio",
|
|
2470
2540
|
children: /* @__PURE__ */ p(ge, {
|
|
2471
2541
|
size: 20,
|
|
2472
2542
|
"aria-hidden": "true"
|
|
2473
2543
|
})
|
|
2474
|
-
}),
|
|
2475
|
-
ref:
|
|
2544
|
+
}), q === "audio" && /* @__PURE__ */ m("div", {
|
|
2545
|
+
ref: bi,
|
|
2476
2546
|
className: "sdk-dropup-menu",
|
|
2477
2547
|
role: "listbox",
|
|
2478
2548
|
"aria-label": "Audio track",
|
|
@@ -2480,41 +2550,41 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2480
2550
|
className: "sdk-dropup-header",
|
|
2481
2551
|
"aria-hidden": "true",
|
|
2482
2552
|
children: "Audio Track"
|
|
2483
|
-
}),
|
|
2553
|
+
}), Hn.map((e) => /* @__PURE__ */ m("div", {
|
|
2484
2554
|
role: "option",
|
|
2485
|
-
"aria-selected":
|
|
2555
|
+
"aria-selected": Wn === e.id,
|
|
2486
2556
|
tabIndex: 0,
|
|
2487
|
-
className: `sdk-dropup-item ${
|
|
2557
|
+
className: `sdk-dropup-item ${Wn === e.id ? "active" : ""}`,
|
|
2488
2558
|
onClick: () => {
|
|
2489
|
-
|
|
2559
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
2490
2560
|
},
|
|
2491
|
-
onKeyDown:
|
|
2492
|
-
|
|
2561
|
+
onKeyDown: gi(() => {
|
|
2562
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
2493
2563
|
}),
|
|
2494
|
-
children: [/* @__PURE__ */ p("span", { children:
|
|
2564
|
+
children: [/* @__PURE__ */ p("span", { children: b(e) }), Wn === e.id && /* @__PURE__ */ p(_, {
|
|
2495
2565
|
size: 12,
|
|
2496
2566
|
"aria-hidden": "true"
|
|
2497
2567
|
})]
|
|
2498
2568
|
}, e.id))]
|
|
2499
2569
|
})]
|
|
2500
2570
|
}),
|
|
2501
|
-
|
|
2571
|
+
R.enablePlaybackSpeed && !Z && /* @__PURE__ */ m("div", {
|
|
2502
2572
|
className: "sdk-menu-container",
|
|
2503
2573
|
children: [/* @__PURE__ */ p("button", {
|
|
2504
|
-
className: `sdk-desktop-icon-btn${
|
|
2574
|
+
className: `sdk-desktop-icon-btn${q === "speed" ? " active" : ""}`,
|
|
2505
2575
|
onClick: (e) => {
|
|
2506
|
-
e.stopPropagation(),
|
|
2576
|
+
e.stopPropagation(), yi("speed");
|
|
2507
2577
|
},
|
|
2508
2578
|
title: "Playback Speed",
|
|
2509
2579
|
"aria-label": "Playback speed",
|
|
2510
2580
|
"aria-haspopup": "listbox",
|
|
2511
|
-
"aria-expanded":
|
|
2581
|
+
"aria-expanded": q === "speed",
|
|
2512
2582
|
children: /* @__PURE__ */ p(he, {
|
|
2513
2583
|
size: 20,
|
|
2514
2584
|
"aria-hidden": "true"
|
|
2515
2585
|
})
|
|
2516
|
-
}),
|
|
2517
|
-
ref:
|
|
2586
|
+
}), q === "speed" && /* @__PURE__ */ m("div", {
|
|
2587
|
+
ref: bi,
|
|
2518
2588
|
className: "sdk-dropup-menu",
|
|
2519
2589
|
role: "listbox",
|
|
2520
2590
|
"aria-label": "Playback speed",
|
|
@@ -2531,35 +2601,35 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2531
2601
|
2
|
|
2532
2602
|
].map((e) => /* @__PURE__ */ m("div", {
|
|
2533
2603
|
role: "option",
|
|
2534
|
-
"aria-selected":
|
|
2604
|
+
"aria-selected": Yn === e,
|
|
2535
2605
|
tabIndex: 0,
|
|
2536
|
-
className: `sdk-dropup-item ${
|
|
2537
|
-
onClick: () =>
|
|
2538
|
-
onKeyDown:
|
|
2539
|
-
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }),
|
|
2606
|
+
className: `sdk-dropup-item ${Yn === e ? "active" : ""}`,
|
|
2607
|
+
onClick: () => Kr(e),
|
|
2608
|
+
onKeyDown: gi(() => Kr(e)),
|
|
2609
|
+
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), Yn === e && /* @__PURE__ */ p(_, {
|
|
2540
2610
|
size: 12,
|
|
2541
2611
|
"aria-hidden": "true"
|
|
2542
2612
|
})]
|
|
2543
2613
|
}, e))]
|
|
2544
2614
|
})]
|
|
2545
2615
|
}),
|
|
2546
|
-
|
|
2616
|
+
R.enableQuality && !Z && /* @__PURE__ */ m("div", {
|
|
2547
2617
|
className: "sdk-menu-container",
|
|
2548
2618
|
children: [/* @__PURE__ */ p("button", {
|
|
2549
|
-
className: `sdk-desktop-icon-btn${
|
|
2619
|
+
className: `sdk-desktop-icon-btn${Fn.id === -1 ? "" : " active"}`,
|
|
2550
2620
|
onClick: (e) => {
|
|
2551
|
-
e.stopPropagation(),
|
|
2621
|
+
e.stopPropagation(), yi("quality");
|
|
2552
2622
|
},
|
|
2553
2623
|
title: "Quality",
|
|
2554
2624
|
"aria-label": "Video quality",
|
|
2555
2625
|
"aria-haspopup": "listbox",
|
|
2556
|
-
"aria-expanded":
|
|
2557
|
-
children: /* @__PURE__ */ p(
|
|
2626
|
+
"aria-expanded": q === "quality",
|
|
2627
|
+
children: /* @__PURE__ */ p(y, {
|
|
2558
2628
|
size: 20,
|
|
2559
2629
|
"aria-hidden": "true"
|
|
2560
2630
|
})
|
|
2561
|
-
}),
|
|
2562
|
-
ref:
|
|
2631
|
+
}), q === "quality" && /* @__PURE__ */ m("div", {
|
|
2632
|
+
ref: bi,
|
|
2563
2633
|
className: "sdk-dropup-menu large",
|
|
2564
2634
|
role: "listbox",
|
|
2565
2635
|
"aria-label": "Video quality",
|
|
@@ -2567,37 +2637,37 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2567
2637
|
className: "sdk-dropup-header",
|
|
2568
2638
|
"aria-hidden": "true",
|
|
2569
2639
|
children: "Quality"
|
|
2570
|
-
}),
|
|
2640
|
+
}), Nn.map((e) => /* @__PURE__ */ m("div", {
|
|
2571
2641
|
role: "option",
|
|
2572
|
-
"aria-selected":
|
|
2642
|
+
"aria-selected": Fn.id === e.id,
|
|
2573
2643
|
tabIndex: 0,
|
|
2574
|
-
className: `sdk-dropup-item ${
|
|
2575
|
-
onClick: () =>
|
|
2576
|
-
onKeyDown:
|
|
2577
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2644
|
+
className: `sdk-dropup-item ${Fn.id === e.id ? "active" : ""}`,
|
|
2645
|
+
onClick: () => qr(e.id),
|
|
2646
|
+
onKeyDown: gi(() => qr(e.id)),
|
|
2647
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), Fn.id === e.id && /* @__PURE__ */ p(_, {
|
|
2578
2648
|
size: 12,
|
|
2579
2649
|
"aria-hidden": "true"
|
|
2580
2650
|
})]
|
|
2581
2651
|
}, e.id))]
|
|
2582
2652
|
})]
|
|
2583
2653
|
}),
|
|
2584
|
-
S && S.length > 1 && !
|
|
2654
|
+
S && S.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
2585
2655
|
className: "sdk-menu-container",
|
|
2586
2656
|
children: [/* @__PURE__ */ p("button", {
|
|
2587
|
-
className: `sdk-desktop-icon-btn${
|
|
2657
|
+
className: `sdk-desktop-icon-btn${q === "sources" ? " active" : ""}`,
|
|
2588
2658
|
onClick: (e) => {
|
|
2589
|
-
e.stopPropagation(),
|
|
2659
|
+
e.stopPropagation(), yi("sources");
|
|
2590
2660
|
},
|
|
2591
2661
|
title: "Select Source",
|
|
2592
2662
|
"aria-label": "Select source",
|
|
2593
2663
|
"aria-haspopup": "listbox",
|
|
2594
|
-
"aria-expanded":
|
|
2595
|
-
children: /* @__PURE__ */ p(
|
|
2664
|
+
"aria-expanded": q === "sources",
|
|
2665
|
+
children: /* @__PURE__ */ p(Me, {
|
|
2596
2666
|
size: 20,
|
|
2597
2667
|
"aria-hidden": "true"
|
|
2598
2668
|
})
|
|
2599
|
-
}),
|
|
2600
|
-
ref:
|
|
2669
|
+
}), q === "sources" && /* @__PURE__ */ m("div", {
|
|
2670
|
+
ref: bi,
|
|
2601
2671
|
className: "sdk-dropup-menu",
|
|
2602
2672
|
role: "listbox",
|
|
2603
2673
|
"aria-label": "Select source",
|
|
@@ -2607,27 +2677,27 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2607
2677
|
children: "Source"
|
|
2608
2678
|
}), S.map((e, t) => /* @__PURE__ */ m("div", {
|
|
2609
2679
|
role: "option",
|
|
2610
|
-
"aria-selected":
|
|
2680
|
+
"aria-selected": C === t,
|
|
2611
2681
|
tabIndex: 0,
|
|
2612
|
-
className: `sdk-dropup-item ${
|
|
2613
|
-
onClick: () =>
|
|
2614
|
-
onKeyDown:
|
|
2615
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2682
|
+
className: `sdk-dropup-item ${C === t ? "active" : ""}`,
|
|
2683
|
+
onClick: () => Yr(t),
|
|
2684
|
+
onKeyDown: gi(() => Yr(t)),
|
|
2685
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), C === t && /* @__PURE__ */ p(_, {
|
|
2616
2686
|
size: 12,
|
|
2617
2687
|
"aria-hidden": "true"
|
|
2618
2688
|
})]
|
|
2619
2689
|
}, t))]
|
|
2620
2690
|
})]
|
|
2621
2691
|
}),
|
|
2622
|
-
|
|
2623
|
-
className: `sdk-desktop-icon-btn${
|
|
2692
|
+
R.enablePiP && !Z && /* @__PURE__ */ p("button", {
|
|
2693
|
+
className: `sdk-desktop-icon-btn${an ? " active" : ""}`,
|
|
2624
2694
|
onClick: (e) => {
|
|
2625
|
-
e.stopPropagation(),
|
|
2695
|
+
e.stopPropagation(), Zr();
|
|
2626
2696
|
},
|
|
2627
2697
|
title: "Picture-in-Picture",
|
|
2628
|
-
"aria-label":
|
|
2629
|
-
"aria-pressed":
|
|
2630
|
-
children: /* @__PURE__ */ p(
|
|
2698
|
+
"aria-label": an ? "Exit picture-in-picture" : "Enter picture-in-picture",
|
|
2699
|
+
"aria-pressed": an,
|
|
2700
|
+
children: /* @__PURE__ */ p(be, {
|
|
2631
2701
|
size: 20,
|
|
2632
2702
|
"aria-hidden": "true"
|
|
2633
2703
|
})
|
|
@@ -2635,21 +2705,21 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2635
2705
|
Je === "button" && /* @__PURE__ */ p("button", {
|
|
2636
2706
|
className: "sdk-desktop-icon-btn",
|
|
2637
2707
|
onClick: (e) => {
|
|
2638
|
-
e.stopPropagation(),
|
|
2708
|
+
e.stopPropagation(), Gr();
|
|
2639
2709
|
},
|
|
2640
|
-
title:
|
|
2641
|
-
"aria-label":
|
|
2642
|
-
"aria-pressed":
|
|
2643
|
-
children:
|
|
2710
|
+
title: pi ? "Unmute" : "Mute",
|
|
2711
|
+
"aria-label": pi ? "Unmute" : "Mute",
|
|
2712
|
+
"aria-pressed": pi,
|
|
2713
|
+
children: hi()
|
|
2644
2714
|
}),
|
|
2645
2715
|
Ve && /* @__PURE__ */ p("button", {
|
|
2646
2716
|
className: "sdk-desktop-icon-btn",
|
|
2647
2717
|
onClick: (e) => {
|
|
2648
|
-
e.stopPropagation(),
|
|
2718
|
+
e.stopPropagation(), Qr();
|
|
2649
2719
|
},
|
|
2650
|
-
title: Zt ||
|
|
2651
|
-
"aria-label": Zt ||
|
|
2652
|
-
"aria-pressed": Zt ||
|
|
2720
|
+
title: Zt || $t ? "Exit fullscreen" : "Fullscreen",
|
|
2721
|
+
"aria-label": Zt || $t ? "Exit fullscreen" : "Enter fullscreen",
|
|
2722
|
+
"aria-pressed": Zt || $t,
|
|
2653
2723
|
children: p(Zt ? ye : ve, {
|
|
2654
2724
|
size: 20,
|
|
2655
2725
|
"aria-hidden": "true"
|
|
@@ -2678,8 +2748,7 @@ async function Ve(e, t = ze) {
|
|
|
2678
2748
|
body: JSON.stringify({})
|
|
2679
2749
|
});
|
|
2680
2750
|
if (!n.ok) throw Error(`SDK init failed: ${n.status}`);
|
|
2681
|
-
|
|
2682
|
-
return console.log("[SDK] Init response:", r), r;
|
|
2751
|
+
return await n.json();
|
|
2683
2752
|
}
|
|
2684
2753
|
async function He(e, t, n, r = ze) {
|
|
2685
2754
|
let i = await fetch(`${r}/api/player/sdk/session/start`, {
|
|
@@ -2691,24 +2760,18 @@ async function He(e, t, n, r = ze) {
|
|
|
2691
2760
|
})
|
|
2692
2761
|
});
|
|
2693
2762
|
if (!i.ok) throw Error(`Session start failed: ${i.status}`);
|
|
2694
|
-
let a = await i.json().catch(() => null);
|
|
2695
|
-
console.log("[SDK] Session start response:", a);
|
|
2696
2763
|
}
|
|
2697
2764
|
async function Ue(e, t, n, r, i = ze) {
|
|
2698
2765
|
let a = {
|
|
2699
2766
|
sessionId: t,
|
|
2700
2767
|
currentTime: n,
|
|
2701
2768
|
duration: r
|
|
2702
|
-
}
|
|
2703
|
-
console.log("[SDK] Heartbeat request:", a);
|
|
2704
|
-
let o = await fetch(`${i}/api/player/sdk/session/heartbeat`, {
|
|
2769
|
+
}, o = await fetch(`${i}/api/player/sdk/session/heartbeat`, {
|
|
2705
2770
|
method: "POST",
|
|
2706
2771
|
headers: Be(e),
|
|
2707
2772
|
body: JSON.stringify(a)
|
|
2708
2773
|
});
|
|
2709
2774
|
if (!o.ok) throw Error(`Heartbeat failed: ${o.status}`);
|
|
2710
|
-
let s = await o.json().catch(() => null);
|
|
2711
|
-
console.log("[SDK] Heartbeat response:", s);
|
|
2712
2775
|
}
|
|
2713
2776
|
async function We(e, t, n = ze) {
|
|
2714
2777
|
let r = await fetch(`${n}/api/player/sdk/session/end`, {
|
|
@@ -2717,11 +2780,8 @@ async function We(e, t, n = ze) {
|
|
|
2717
2780
|
body: JSON.stringify({ sessionId: t })
|
|
2718
2781
|
});
|
|
2719
2782
|
if (!r.ok) throw Error(`Session end failed: ${r.status}`);
|
|
2720
|
-
let i = await r.json().catch(() => null);
|
|
2721
|
-
console.log("[SDK] Session end response:", i);
|
|
2722
2783
|
}
|
|
2723
2784
|
async function Ge(e, t, n = ze) {
|
|
2724
|
-
console.log("[SDK] Event request:", t);
|
|
2725
2785
|
let r = await fetch(`${n}/api/player/sdk/events`, {
|
|
2726
2786
|
method: "POST",
|
|
2727
2787
|
headers: Be(e),
|
|
@@ -2738,8 +2798,123 @@ function Ke(e, t, n = ze) {
|
|
|
2738
2798
|
});
|
|
2739
2799
|
}
|
|
2740
2800
|
//#endregion
|
|
2741
|
-
//#region src/
|
|
2742
|
-
|
|
2801
|
+
//#region src/delegate.ts
|
|
2802
|
+
function x() {
|
|
2803
|
+
if (!(typeof screen > "u")) return screen.orientation?.type ?? void 0;
|
|
2804
|
+
}
|
|
2805
|
+
var qe = class {
|
|
2806
|
+
constructor() {
|
|
2807
|
+
this.autoplay = !1, this.keyMoments = [], this.isPlaybackActive = !1, this.hasFinished = !1, this.hasDismissed = !1, this.lastCurrentTime = 0, this.lastDuration = 0, this.lastWatchDuration = 0, this.prevSpeed = 1, this.pendingSeek = null;
|
|
2808
|
+
}
|
|
2809
|
+
setDelegate(e) {
|
|
2810
|
+
this.delegate = e;
|
|
2811
|
+
}
|
|
2812
|
+
setAutoplay(e) {
|
|
2813
|
+
this.autoplay = e;
|
|
2814
|
+
}
|
|
2815
|
+
setKeyMoments(e) {
|
|
2816
|
+
this.keyMoments = e;
|
|
2817
|
+
}
|
|
2818
|
+
handleAnalyticsEvent(e) {
|
|
2819
|
+
switch (typeof e.currentTime == "number" && !Number.isNaN(e.currentTime) && (this.lastCurrentTime = e.currentTime), typeof e.duration == "number" && !Number.isNaN(e.duration) && (this.lastDuration = e.duration), typeof e.totalWatchTime == "number" && (this.lastWatchDuration = e.totalWatchTime), e.eventType) {
|
|
2820
|
+
case "play":
|
|
2821
|
+
this.isPlaybackActive ? this.call("playerDidResumePlaying", e.currentTime) : (this.isPlaybackActive = !0, this.hasFinished = !1, this.call("playerDidStartPlaying", e.currentTime, this.autoplay));
|
|
2822
|
+
break;
|
|
2823
|
+
case "pause":
|
|
2824
|
+
e.duration > 0 && e.currentTime >= e.duration - .25 || this.call("playerDidPause", e.currentTime);
|
|
2825
|
+
break;
|
|
2826
|
+
case "ended":
|
|
2827
|
+
this.isPlaybackActive = !1, this.hasFinished = !0, this.call("playerDidFinishPlaying", e.currentTime, e.totalWatchTime ?? this.lastWatchDuration);
|
|
2828
|
+
break;
|
|
2829
|
+
case "seek":
|
|
2830
|
+
this.beginSeek(e.seekFrom ?? this.lastCurrentTime, e.seekTo ?? e.currentTime);
|
|
2831
|
+
break;
|
|
2832
|
+
case "fast_forward":
|
|
2833
|
+
this.beginSeek(Math.max(0, e.currentTime - (e.skipSeconds ?? 10)), e.currentTime);
|
|
2834
|
+
break;
|
|
2835
|
+
case "fast_backward":
|
|
2836
|
+
this.beginSeek(e.currentTime + (e.skipSeconds ?? 10), e.currentTime);
|
|
2837
|
+
break;
|
|
2838
|
+
case "buffering_start":
|
|
2839
|
+
this.call("playerDidStartBuffering", e.currentTime);
|
|
2840
|
+
break;
|
|
2841
|
+
case "buffering_end":
|
|
2842
|
+
this.call("playerDidFinishBuffering", e.currentTime);
|
|
2843
|
+
break;
|
|
2844
|
+
case "quality_change": {
|
|
2845
|
+
let t = e.rendition;
|
|
2846
|
+
t && t !== this.prevQuality && (this.call("playerDidChangeQuality", this.prevQuality, t, e.isAutoSwitch ?? !1), this.prevQuality = t);
|
|
2847
|
+
break;
|
|
2848
|
+
}
|
|
2849
|
+
case "subtitle_change":
|
|
2850
|
+
if (e.subtitleEnabled === !1) this.call("playerDidDisableSubtitle", this.prevSubtitle), this.prevSubtitle = void 0;
|
|
2851
|
+
else {
|
|
2852
|
+
let t = e.subtitleLanguage ?? "";
|
|
2853
|
+
this.call("playerDidChangeSubtitle", this.prevSubtitle, t), this.prevSubtitle = t;
|
|
2854
|
+
}
|
|
2855
|
+
break;
|
|
2856
|
+
case "audio_track_change": {
|
|
2857
|
+
let t = e.audioTrack ?? "";
|
|
2858
|
+
this.call("playerDidChangeAudioTrack", this.prevAudioTrack, t), this.prevAudioTrack = t;
|
|
2859
|
+
break;
|
|
2860
|
+
}
|
|
2861
|
+
case "speed_change": {
|
|
2862
|
+
let t = e.speed ?? 1;
|
|
2863
|
+
t !== this.prevSpeed && (this.call("playerDidChangePlaybackSpeed", this.prevSpeed, t), this.prevSpeed = t);
|
|
2864
|
+
break;
|
|
2865
|
+
}
|
|
2866
|
+
case "fullscreen_enter":
|
|
2867
|
+
this.call("playerDidEnterFullscreen", x());
|
|
2868
|
+
break;
|
|
2869
|
+
case "fullscreen_exit":
|
|
2870
|
+
this.call("playerDidExitFullscreen", x());
|
|
2871
|
+
break;
|
|
2872
|
+
case "key_moments": {
|
|
2873
|
+
let t = e.momentTitle ?? "", n = e.momentTime ?? e.currentTime, r = this.keyMoments, i = r.findIndex((e) => t && e.title === t || e.startTime === n), a = i >= 0 ? r[i] : void 0;
|
|
2874
|
+
this.call("playerDidSelectKeyMoment", i >= 0 ? String(i) : void 0, a?.title ?? t, a?.startTime ?? n, a?.endTime ?? n);
|
|
2875
|
+
break;
|
|
2876
|
+
}
|
|
2877
|
+
case "pip_toggle":
|
|
2878
|
+
(e.pipState ? e.pipState === "entered" : e.errorMessage === "entered") ? this.call("playerDidEnterPictureInPicture", e.currentTime) : this.call("playerDidExitPictureInPicture", e.currentTime);
|
|
2879
|
+
break;
|
|
2880
|
+
case "error":
|
|
2881
|
+
this.call("playerDidEncounterPlaybackError", e.errorCode == null ? "PLAYER_ERROR" : String(e.errorCode), e.errorMessage ?? "Unknown player error", e.isRecoverable ?? !1);
|
|
2882
|
+
break;
|
|
2883
|
+
case "network_error":
|
|
2884
|
+
this.call("playerDidEncounterNetworkError", e.errorCode ?? 0, e.errorMessage ?? "Network error", e.isRecoverable ?? !1);
|
|
2885
|
+
break;
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
handleTimeUpdate(e) {
|
|
2889
|
+
if (this.lastCurrentTime = e, this.pendingSeek) {
|
|
2890
|
+
let { fromTime: t, startedWallMs: n } = this.pendingSeek;
|
|
2891
|
+
this.pendingSeek = null, this.call("playerDidFinishSeeking", t, e, (Date.now() - n) / 1e3);
|
|
2892
|
+
}
|
|
2893
|
+
this.call("playerDidUpdateCurrentTime", e, this.lastDuration);
|
|
2894
|
+
}
|
|
2895
|
+
notifyDismissed() {
|
|
2896
|
+
this.hasDismissed || !this.isPlaybackActive || this.hasFinished || (this.hasDismissed = !0, this.call("playerDidDismiss", this.lastCurrentTime, this.lastWatchDuration));
|
|
2897
|
+
}
|
|
2898
|
+
beginSeek(e, t) {
|
|
2899
|
+
if (this.pendingSeek) {
|
|
2900
|
+
this.pendingSeek.toTime = t;
|
|
2901
|
+
return;
|
|
2902
|
+
}
|
|
2903
|
+
this.pendingSeek = {
|
|
2904
|
+
fromTime: e,
|
|
2905
|
+
toTime: t,
|
|
2906
|
+
startedWallMs: Date.now()
|
|
2907
|
+
}, this.call("playerDidStartSeeking", e);
|
|
2908
|
+
}
|
|
2909
|
+
call(e, ...t) {
|
|
2910
|
+
let n = this.delegate, r = n?.[e];
|
|
2911
|
+
if (typeof r == "function") try {
|
|
2912
|
+
r.apply(n, t);
|
|
2913
|
+
} catch (t) {
|
|
2914
|
+
console.error(`[PlayerSDK Delegate] ${String(e)} callback failed:`, t);
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
}, Je = {
|
|
2743
2918
|
subtitles: "subtitle_support",
|
|
2744
2919
|
ads: "ad_support",
|
|
2745
2920
|
chapterMarkers: "key_moments",
|
|
@@ -2753,7 +2928,7 @@ var b = {
|
|
|
2753
2928
|
screenRecordingPrevention: "screen_recording_prevention",
|
|
2754
2929
|
signalStrength: "signal_strength"
|
|
2755
2930
|
};
|
|
2756
|
-
function
|
|
2931
|
+
function Ye(e) {
|
|
2757
2932
|
let t = {
|
|
2758
2933
|
m3u8_playback: !0,
|
|
2759
2934
|
subtitle_support: !1,
|
|
@@ -2769,10 +2944,10 @@ function qe(e) {
|
|
|
2769
2944
|
signal_strength: !1,
|
|
2770
2945
|
ad_support: !1
|
|
2771
2946
|
};
|
|
2772
|
-
for (let [n, r] of Object.entries(
|
|
2947
|
+
for (let [n, r] of Object.entries(Je)) n in e && (t[r] = e[n]);
|
|
2773
2948
|
return t;
|
|
2774
2949
|
}
|
|
2775
|
-
function
|
|
2950
|
+
function Xe(e) {
|
|
2776
2951
|
if (!e) return (e) => e;
|
|
2777
2952
|
let t = [];
|
|
2778
2953
|
for (let n of e.split(",")) {
|
|
@@ -2792,8 +2967,12 @@ function Je(e) {
|
|
|
2792
2967
|
return e;
|
|
2793
2968
|
};
|
|
2794
2969
|
}
|
|
2795
|
-
|
|
2796
|
-
|
|
2970
|
+
function Ze(e) {
|
|
2971
|
+
let t = e.replace("#", "");
|
|
2972
|
+
return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : "99, 102, 241";
|
|
2973
|
+
}
|
|
2974
|
+
var Qe = 3e4;
|
|
2975
|
+
function $e(e, t) {
|
|
2797
2976
|
switch (e.eventType) {
|
|
2798
2977
|
case "pause": return {
|
|
2799
2978
|
eventType: "pause",
|
|
@@ -2833,11 +3012,11 @@ function Xe(e, t) {
|
|
|
2833
3012
|
eventType: "buffering_end",
|
|
2834
3013
|
extras: {}
|
|
2835
3014
|
};
|
|
2836
|
-
case "quality_change": return {
|
|
3015
|
+
case "quality_change": return !t || !e.rendition || t === e.rendition ? null : {
|
|
2837
3016
|
eventType: "quality_change",
|
|
2838
3017
|
extras: {
|
|
2839
|
-
|
|
2840
|
-
|
|
3018
|
+
from: t,
|
|
3019
|
+
to: e.rendition
|
|
2841
3020
|
}
|
|
2842
3021
|
};
|
|
2843
3022
|
case "speed_change": return {
|
|
@@ -2887,19 +3066,25 @@ function Xe(e, t) {
|
|
|
2887
3066
|
default: return null;
|
|
2888
3067
|
}
|
|
2889
3068
|
}
|
|
2890
|
-
function
|
|
2891
|
-
let [ge, _e] = d([]), [ve, ye] = d(0),
|
|
3069
|
+
function et({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i = "#6366f1", firebaseConfig: a, proxyDomains: s, apiBaseUrl: l, adTrackingUrl: f, overlayAdUrl: ee, title: ne, watermark: re, autoplay: h = !1, muted: ie = !1, autoFullscreen: ae = !1, enableControls: oe = !0, enableSkipAd: se, skipAdAfterSeconds: ce, chaptersDisplayMode: le = "strip", volumeControlType: g = "slider", subtitleStyle: ue, drmConfig: de, onAnalyticsEvent: fe, delegate: _, onKeyMomentsLoaded: pe, initialTime: me, onTimeUpdate: he }) {
|
|
3070
|
+
let [ge, _e] = d([]), [ve, ye] = d(0), [v] = d(() => new qe());
|
|
3071
|
+
c(() => {
|
|
3072
|
+
v.setDelegate(_), v.setAutoplay(h);
|
|
3073
|
+
}, [
|
|
3074
|
+
v,
|
|
3075
|
+
_,
|
|
3076
|
+
h
|
|
3077
|
+
]), c(() => () => v.notifyDismissed(), [v]);
|
|
3078
|
+
let be = Array.isArray(t) ? t : [{
|
|
2892
3079
|
label: "Default",
|
|
2893
3080
|
url: t
|
|
2894
|
-
}], xe = be[ve]?.url ?? be[0]?.url ?? "", [Se, Ce] = d("loading"), [we, Te] = d(null), [Ee, De] = d(0), [Oe, ke] = d("network"), Ae = u(null), je = u(!1),
|
|
3081
|
+
}], xe = be[ve]?.url ?? be[0]?.url ?? "", [Se, Ce] = d("loading"), [we, Te] = d(null), [Ee, De] = d(0), [Oe, ke] = d("network"), Ae = u(null), je = u(!1), y = u(""), Me = u(!1), Ne = u(!1), Pe = u(void 0), Fe = u(!1), b = u(null), Ie = u(0), Le = u(null), ze = u({
|
|
2895
3082
|
currentTime: 0,
|
|
2896
3083
|
duration: 0
|
|
2897
|
-
}),
|
|
3084
|
+
}), Be = u(() => {}), x = xe.split("/").filter(Boolean), Je = (x[x.length - 1] ?? "").replace(/\.m3u8.*$/, "") || "video", et = o(() => Xe(s), [s])(), S = Ze(i);
|
|
2898
3085
|
c(() => {
|
|
2899
|
-
document.documentElement.style.setProperty("--accent-indigo", i);
|
|
2900
|
-
|
|
2901
|
-
e.length === 6 && (t = `${parseInt(e.substring(0, 2), 16)}, ${parseInt(e.substring(2, 4), 16)}, ${parseInt(e.substring(4, 6), 16)}`), document.documentElement.style.setProperty("--accent-indigo-rgb", t);
|
|
2902
|
-
}, [i]), c(() => {
|
|
3086
|
+
document.documentElement.style.setProperty("--accent-indigo", i), document.documentElement.style.setProperty("--accent-indigo-rgb", S);
|
|
3087
|
+
}, [i, S]), c(() => {
|
|
2903
3088
|
let t = !1;
|
|
2904
3089
|
return Ve(e, l).then((e) => {
|
|
2905
3090
|
if (t) return;
|
|
@@ -2907,7 +3092,7 @@ function Ze({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
2907
3092
|
let { features: n, planTier: r } = e.result.data, i = {
|
|
2908
3093
|
package: r,
|
|
2909
3094
|
is_active: !0,
|
|
2910
|
-
features:
|
|
3095
|
+
features: Ye(n),
|
|
2911
3096
|
limits: { streaming_minutes: 0 }
|
|
2912
3097
|
};
|
|
2913
3098
|
console.log("[SDK] Player key validated. Features:", i.features), Te(i), Ce("ready");
|
|
@@ -2917,78 +3102,82 @@ function Ze({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
2917
3102
|
let n = e.message ?? "";
|
|
2918
3103
|
ke(/init failed: 4\d\d/.test(n) ? "auth" : "network"), Ce("error");
|
|
2919
3104
|
}), () => {
|
|
2920
|
-
t = !0,
|
|
3105
|
+
t = !0, b.current &&= (clearTimeout(b.current), null), Ie.current = 0, Le.current = null, Ce("loading"), Te(null), Me.current = !1, y.current = "", Ne.current = !1, Pe.current = void 0;
|
|
2921
3106
|
};
|
|
2922
3107
|
}, [
|
|
2923
3108
|
e,
|
|
2924
3109
|
l,
|
|
2925
3110
|
Ee
|
|
2926
3111
|
]);
|
|
2927
|
-
let
|
|
2928
|
-
|
|
2929
|
-
}, []),
|
|
2930
|
-
|
|
2931
|
-
}, []),
|
|
2932
|
-
if (
|
|
2933
|
-
|
|
2934
|
-
let t =
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
let { currentTime: t, duration: n } =
|
|
2938
|
-
console.log("[SDK] Heartbeat timer fired — 30s of real content elapsed"), Ue(e,
|
|
3112
|
+
let C = o(() => {
|
|
3113
|
+
b.current && (clearTimeout(b.current), b.current = null, Le.current !== null && (Ie.current += Date.now() - Le.current, Le.current = null));
|
|
3114
|
+
}, []), tt = o(() => {
|
|
3115
|
+
b.current &&= (clearTimeout(b.current), null), Ie.current = 0, Le.current = null;
|
|
3116
|
+
}, []), w = o(() => {
|
|
3117
|
+
if (b.current || !y.current) return;
|
|
3118
|
+
Le.current = Date.now();
|
|
3119
|
+
let t = Qe - Ie.current;
|
|
3120
|
+
b.current = setTimeout(() => {
|
|
3121
|
+
b.current = null, Ie.current = 0, Le.current = null;
|
|
3122
|
+
let { currentTime: t, duration: n } = ze.current;
|
|
3123
|
+
console.log("[SDK] Heartbeat timer fired — 30s of real content elapsed"), Ue(e, y.current, t, n, l).catch((e) => console.warn("[SDK] Heartbeat failed:", e.message)), Be.current();
|
|
2939
3124
|
}, t);
|
|
2940
3125
|
}, [e, l]);
|
|
2941
3126
|
c(() => {
|
|
2942
|
-
|
|
2943
|
-
}, [
|
|
2944
|
-
let
|
|
3127
|
+
Be.current = w;
|
|
3128
|
+
}, [w]);
|
|
3129
|
+
let nt = u(!0);
|
|
2945
3130
|
c(() => {
|
|
2946
|
-
if (
|
|
2947
|
-
|
|
3131
|
+
if (nt.current) {
|
|
3132
|
+
nt.current = !1;
|
|
2948
3133
|
return;
|
|
2949
3134
|
}
|
|
2950
|
-
Fe.current = !0,
|
|
2951
|
-
}, [ve,
|
|
3135
|
+
Fe.current = !0, Pe.current = void 0, C();
|
|
3136
|
+
}, [ve, C]), c(() => {
|
|
2952
3137
|
let t = () => {
|
|
2953
|
-
|
|
3138
|
+
v.notifyDismissed(), y.current && (Ne.current = !0, tt(), Ke(e, y.current, l));
|
|
2954
3139
|
};
|
|
2955
3140
|
return window.addEventListener("beforeunload", t), () => {
|
|
2956
|
-
window.removeEventListener("beforeunload", t),
|
|
3141
|
+
window.removeEventListener("beforeunload", t), tt();
|
|
2957
3142
|
};
|
|
2958
3143
|
}, [
|
|
2959
3144
|
e,
|
|
2960
3145
|
l,
|
|
2961
|
-
|
|
3146
|
+
tt,
|
|
3147
|
+
v
|
|
2962
3148
|
]);
|
|
2963
|
-
let
|
|
3149
|
+
let rt = o((t) => {
|
|
2964
3150
|
let n = t;
|
|
2965
|
-
if (t.currentTime !== void 0 && (
|
|
3151
|
+
if (t.currentTime !== void 0 && (ze.current = {
|
|
2966
3152
|
currentTime: t.currentTime,
|
|
2967
3153
|
duration: t.duration
|
|
2968
|
-
}), t.eventType === "session_start" && !Me.current && (Me.current = !0, Ne.current = !1,
|
|
2969
|
-
let n =
|
|
2970
|
-
n &&
|
|
3154
|
+
}), t.eventType === "session_start" && !Me.current && (Me.current = !0, Ne.current = !1, y.current = typeof n.sessionId == "string" ? n.sessionId : "", He(e, y.current, Je, l).catch((e) => console.warn("[SDK] Session start failed:", e.message)), je.current || w()), t.eventType === "play" && Me.current && !je.current && !Fe.current && w(), t.eventType === "pause" && C(), t.eventType === "buffering_start" && C(), t.eventType === "buffering_end" && Me.current && !je.current && (Fe.current = !1, w()), t.eventType === "ended" && (tt(), y.current && (Ne.current = !0, We(e, y.current, l).catch((e) => console.warn("[SDK] Session end failed:", e.message)))), Me.current && y.current && !Ne.current) {
|
|
3155
|
+
let n = $e(t, Pe.current);
|
|
3156
|
+
n && Ge(e, {
|
|
2971
3157
|
eventType: n.eventType,
|
|
2972
|
-
sessionId:
|
|
3158
|
+
sessionId: y.current,
|
|
2973
3159
|
currentTime: t.currentTime ?? 0,
|
|
2974
|
-
videoId:
|
|
3160
|
+
videoId: Je,
|
|
2975
3161
|
...n.extras
|
|
2976
|
-
}, l).catch((e) => console.warn(`[SDK] Event ${n.eventType} failed:`, e.message))
|
|
3162
|
+
}, l).catch((e) => console.warn(`[SDK] Event ${n.eventType} failed:`, e.message));
|
|
2977
3163
|
}
|
|
2978
|
-
console.log("[SDK Analytics]", t),
|
|
3164
|
+
t.eventType === "quality_change" && t.rendition && (Pe.current = t.rendition), console.log("[SDK Analytics]", t), v.handleAnalyticsEvent(t), fe?.(t);
|
|
2979
3165
|
}, [
|
|
2980
3166
|
e,
|
|
2981
3167
|
l,
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3168
|
+
Je,
|
|
3169
|
+
w,
|
|
3170
|
+
C,
|
|
3171
|
+
tt,
|
|
3172
|
+
fe,
|
|
3173
|
+
v
|
|
3174
|
+
]), T = o((e) => {
|
|
3175
|
+
je.current = e, e ? (C(), console.log("[SDK] Ad break started — heartbeat timer paused")) : (Me.current && w(), console.log("[SDK] Ad break ended — heartbeat timer resumed"));
|
|
3176
|
+
}, [C, w]), it = o((e) => {
|
|
3177
|
+
v.setKeyMoments(e), _e(e), pe?.(e);
|
|
3178
|
+
}, [pe, v]), at = o((e) => {
|
|
3179
|
+
v.handleTimeUpdate(e), he?.(e);
|
|
3180
|
+
}, [he, v]);
|
|
2992
3181
|
if (Se === "loading") return /* @__PURE__ */ m("div", {
|
|
2993
3182
|
style: {
|
|
2994
3183
|
width: "100%",
|
|
@@ -3000,12 +3189,14 @@ function Ze({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3000
3189
|
justifyContent: "center"
|
|
3001
3190
|
},
|
|
3002
3191
|
children: [/* @__PURE__ */ p("style", { children: "@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}" }), /* @__PURE__ */ p("div", { style: {
|
|
3003
|
-
width:
|
|
3004
|
-
height:
|
|
3192
|
+
width: 60,
|
|
3193
|
+
height: 60,
|
|
3005
3194
|
borderRadius: "50%",
|
|
3006
|
-
border:
|
|
3007
|
-
|
|
3008
|
-
|
|
3195
|
+
border: `4px solid rgba(${S}, 0.1)`,
|
|
3196
|
+
borderLeftColor: i,
|
|
3197
|
+
borderRightColor: `rgba(${S}, 0.2)`,
|
|
3198
|
+
filter: `drop-shadow(0 0 10px rgba(${S}, 0.5))`,
|
|
3199
|
+
animation: "boss-sdk-spin 1s linear infinite"
|
|
3009
3200
|
} })]
|
|
3010
3201
|
});
|
|
3011
3202
|
if (Se === "error") {
|
|
@@ -3042,36 +3233,36 @@ function Ze({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3042
3233
|
licenseKey: r,
|
|
3043
3234
|
title: ne,
|
|
3044
3235
|
watermark: re,
|
|
3045
|
-
autoplay:
|
|
3046
|
-
muted:
|
|
3047
|
-
autoFullscreen:
|
|
3048
|
-
enableControls:
|
|
3049
|
-
enableSkipAd:
|
|
3050
|
-
skipAdAfterSeconds:
|
|
3051
|
-
chaptersDisplayMode:
|
|
3052
|
-
volumeControlType:
|
|
3053
|
-
subtitleStyle:
|
|
3054
|
-
drmConfig:
|
|
3236
|
+
autoplay: h,
|
|
3237
|
+
muted: ie,
|
|
3238
|
+
autoFullscreen: ae,
|
|
3239
|
+
enableControls: oe,
|
|
3240
|
+
enableSkipAd: se,
|
|
3241
|
+
skipAdAfterSeconds: ce,
|
|
3242
|
+
chaptersDisplayMode: le,
|
|
3243
|
+
volumeControlType: g,
|
|
3244
|
+
subtitleStyle: ue,
|
|
3245
|
+
drmConfig: de,
|
|
3055
3246
|
overlayAdUrl: ee,
|
|
3056
3247
|
adTrackingUrl: f,
|
|
3057
|
-
urlTransformer:
|
|
3058
|
-
onAnalyticsEvent:
|
|
3059
|
-
onAdBreakChange:
|
|
3060
|
-
onKeyMomentsLoaded:
|
|
3248
|
+
urlTransformer: et,
|
|
3249
|
+
onAnalyticsEvent: rt,
|
|
3250
|
+
onAdBreakChange: T,
|
|
3251
|
+
onKeyMomentsLoaded: it,
|
|
3061
3252
|
initialTime: me,
|
|
3062
|
-
onTimeUpdate:
|
|
3253
|
+
onTimeUpdate: at
|
|
3063
3254
|
});
|
|
3064
3255
|
}
|
|
3065
3256
|
//#endregion
|
|
3066
3257
|
//#region src/create-player.ts
|
|
3067
|
-
function
|
|
3258
|
+
function S(e, t) {
|
|
3068
3259
|
let n = ee(e), r = t;
|
|
3069
|
-
return n.render(i(
|
|
3260
|
+
return n.render(i(et, r)), {
|
|
3070
3261
|
update(e) {
|
|
3071
3262
|
r = {
|
|
3072
3263
|
...r,
|
|
3073
3264
|
...e
|
|
3074
|
-
}, n.render(i(
|
|
3265
|
+
}, n.render(i(et, r));
|
|
3075
3266
|
},
|
|
3076
3267
|
destroy() {
|
|
3077
3268
|
n.unmount();
|
|
@@ -3079,6 +3270,6 @@ function Qe(e, t) {
|
|
|
3079
3270
|
};
|
|
3080
3271
|
}
|
|
3081
3272
|
//#endregion
|
|
3082
|
-
export {
|
|
3273
|
+
export { et as BossVideoPlayer, e as FirebaseAnalyticsProvider, t as VideoPlayerSDK, Re as WebVideoPlayer, S as createPlayer, We as endSession, Ve as initSdk, Ge as sendEvent, Ue as sendHeartbeat, He as startSession };
|
|
3083
3274
|
|
|
3084
3275
|
//# sourceMappingURL=index.js.map
|