@halibegic/react-video-player 0.0.41 → 0.0.43
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.
|
@@ -19,7 +19,7 @@ var ne = (e, t) => {
|
|
|
19
19
|
t.indexOf(o) < 0 && yt.call(e, o) && (n[o] = e[o]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
import St, { useLayoutEffect as An, useEffect as
|
|
22
|
+
import St, { useLayoutEffect as An, useEffect as O, useRef as V, useState as G, createContext as jt, useContext as Lt, useCallback as W, forwardRef as Ne } from "react";
|
|
23
23
|
import { create as Pt, useStore as It } from "zustand";
|
|
24
24
|
import On from "mitt";
|
|
25
25
|
import re from "hls.js";
|
|
@@ -112,8 +112,8 @@ function Un(e, t) {
|
|
|
112
112
|
e.apply(t, arguments);
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
if (!(this instanceof
|
|
115
|
+
function M(e) {
|
|
116
|
+
if (!(this instanceof M))
|
|
117
117
|
throw new TypeError("Promises must be constructed via new");
|
|
118
118
|
if (typeof e != "function") throw new TypeError("not a function");
|
|
119
119
|
this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], At(e, this);
|
|
@@ -125,7 +125,7 @@ function Vt(e, t) {
|
|
|
125
125
|
e._deferreds.push(t);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
e._handled = !0,
|
|
128
|
+
e._handled = !0, M._immediateFn(function() {
|
|
129
129
|
var n = e._state === 1 ? t.onFulfilled : t.onRejected;
|
|
130
130
|
if (n === null) {
|
|
131
131
|
(e._state === 1 ? Ke : xe)(t.promise, e._value);
|
|
@@ -147,7 +147,7 @@ function Ke(e, t) {
|
|
|
147
147
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
148
148
|
if (t && (typeof t == "object" || typeof t == "function")) {
|
|
149
149
|
var n = t.then;
|
|
150
|
-
if (t instanceof
|
|
150
|
+
if (t instanceof M) {
|
|
151
151
|
e._state = 3, e._value = t, Ye(e);
|
|
152
152
|
return;
|
|
153
153
|
} else if (typeof n == "function") {
|
|
@@ -164,8 +164,8 @@ function xe(e, t) {
|
|
|
164
164
|
e._state = 2, e._value = t, Ye(e);
|
|
165
165
|
}
|
|
166
166
|
function Ye(e) {
|
|
167
|
-
e._state === 2 && e._deferreds.length === 0 &&
|
|
168
|
-
e._handled ||
|
|
167
|
+
e._state === 2 && e._deferreds.length === 0 && M._immediateFn(function() {
|
|
168
|
+
e._handled || M._unhandledRejectionFn(e._value);
|
|
169
169
|
});
|
|
170
170
|
for (var t = 0, n = e._deferreds.length; t < n; t++)
|
|
171
171
|
Vt(e, e._deferreds[t]);
|
|
@@ -190,16 +190,16 @@ function At(e, t) {
|
|
|
190
190
|
n = !0, xe(t, o);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
M.prototype.catch = function(e) {
|
|
194
194
|
return this.then(null, e);
|
|
195
195
|
};
|
|
196
|
-
|
|
196
|
+
M.prototype.then = function(e, t) {
|
|
197
197
|
var n = new this.constructor($n);
|
|
198
198
|
return Vt(this, new Bn(e, t, n)), n;
|
|
199
199
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return new
|
|
200
|
+
M.prototype.finally = kt;
|
|
201
|
+
M.all = function(e) {
|
|
202
|
+
return new M(function(t, n) {
|
|
203
203
|
if (!Nt(e))
|
|
204
204
|
return n(new TypeError("Promise.all accepts an array"));
|
|
205
205
|
var o = Array.prototype.slice.call(e);
|
|
@@ -229,33 +229,33 @@ F.all = function(e) {
|
|
|
229
229
|
l(u, o[u]);
|
|
230
230
|
});
|
|
231
231
|
};
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
return e && typeof e == "object" && e.constructor ===
|
|
232
|
+
M.any = Mt;
|
|
233
|
+
M.allSettled = Dt;
|
|
234
|
+
M.resolve = function(e) {
|
|
235
|
+
return e && typeof e == "object" && e.constructor === M ? e : new M(function(t) {
|
|
236
236
|
t(e);
|
|
237
237
|
});
|
|
238
238
|
};
|
|
239
|
-
|
|
240
|
-
return new
|
|
239
|
+
M.reject = function(e) {
|
|
240
|
+
return new M(function(t, n) {
|
|
241
241
|
n(e);
|
|
242
242
|
});
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
return new
|
|
244
|
+
M.race = function(e) {
|
|
245
|
+
return new M(function(t, n) {
|
|
246
246
|
if (!Nt(e))
|
|
247
247
|
return n(new TypeError("Promise.race accepts an array"));
|
|
248
248
|
for (var o = 0, a = e.length; o < a; o++)
|
|
249
|
-
|
|
249
|
+
M.resolve(e[o]).then(t, n);
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
M._immediateFn = // @ts-ignore
|
|
253
253
|
typeof setImmediate == "function" && function(e) {
|
|
254
254
|
setImmediate(e);
|
|
255
255
|
} || function(e) {
|
|
256
256
|
Hn(e, 0);
|
|
257
257
|
};
|
|
258
|
-
|
|
258
|
+
M._unhandledRejectionFn = function(t) {
|
|
259
259
|
typeof console != "undefined" && console && console.warn("Possible Unhandled Promise Rejection:", t);
|
|
260
260
|
};
|
|
261
261
|
var ae = (function() {
|
|
@@ -267,7 +267,7 @@ var ae = (function() {
|
|
|
267
267
|
return global;
|
|
268
268
|
throw new Error("unable to locate global object");
|
|
269
269
|
})();
|
|
270
|
-
typeof ae.Promise != "function" ? ae.Promise =
|
|
270
|
+
typeof ae.Promise != "function" ? ae.Promise = M : (ae.Promise.prototype.finally || (ae.Promise.prototype.finally = kt), ae.Promise.allSettled || (ae.Promise.allSettled = Dt), ae.Promise.any || (ae.Promise.any = Mt));
|
|
271
271
|
var Pe = { exports: {} }, ge = {};
|
|
272
272
|
var gt;
|
|
273
273
|
function zn() {
|
|
@@ -294,7 +294,7 @@ function Wn() {
|
|
|
294
294
|
var h = D && r[D] || r[_];
|
|
295
295
|
return typeof h == "function" ? h : null;
|
|
296
296
|
}
|
|
297
|
-
var
|
|
297
|
+
var N = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
298
298
|
function R(r) {
|
|
299
299
|
{
|
|
300
300
|
for (var h = arguments.length, m = new Array(h > 1 ? h - 1 : 0), w = 1; w < h; w++)
|
|
@@ -304,7 +304,7 @@ function Wn() {
|
|
|
304
304
|
}
|
|
305
305
|
function P(r, h, m) {
|
|
306
306
|
{
|
|
307
|
-
var w =
|
|
307
|
+
var w = N.ReactDebugCurrentFrame, E = w.getStackAddendum();
|
|
308
308
|
E !== "" && (h += "%s", m = m.concat([E]));
|
|
309
309
|
var b = m.map(function(C) {
|
|
310
310
|
return String(C);
|
|
@@ -312,14 +312,14 @@ function Wn() {
|
|
|
312
312
|
b.unshift("Warning: " + h), Function.prototype.apply.call(console[r], console, b);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
var x = !1, I = !1, p = !1, $ = !1,
|
|
316
|
-
|
|
317
|
-
function
|
|
318
|
-
return !!(typeof r == "string" || typeof r == "function" || r === o || r === l ||
|
|
315
|
+
var x = !1, I = !1, p = !1, $ = !1, Y = !1, B;
|
|
316
|
+
B = Symbol.for("react.module.reference");
|
|
317
|
+
function F(r) {
|
|
318
|
+
return !!(typeof r == "string" || typeof r == "function" || r === o || r === l || Y || r === a || r === d || r === v || $ || r === L || x || I || p || typeof r == "object" && r !== null && (r.$$typeof === g || r.$$typeof === y || r.$$typeof === u || r.$$typeof === i || r.$$typeof === c || // This needs to include all possible module reference object
|
|
319
319
|
// types supported by any Flight configuration anywhere since
|
|
320
320
|
// we don't know which Flight build this will end up being used
|
|
321
321
|
// with.
|
|
322
|
-
r.$$typeof ===
|
|
322
|
+
r.$$typeof === B || r.getModuleId !== void 0));
|
|
323
323
|
}
|
|
324
324
|
function k(r, h, m) {
|
|
325
325
|
var w = r.displayName;
|
|
@@ -376,14 +376,14 @@ function Wn() {
|
|
|
376
376
|
}
|
|
377
377
|
return null;
|
|
378
378
|
}
|
|
379
|
-
var
|
|
379
|
+
var Z = Object.assign, oe = 0, ue, te, q, ve, Xe, Ge, Je;
|
|
380
380
|
function Qe() {
|
|
381
381
|
}
|
|
382
382
|
Qe.__reactDisabledLog = !0;
|
|
383
383
|
function ln() {
|
|
384
384
|
{
|
|
385
385
|
if (oe === 0) {
|
|
386
|
-
ue = console.log, te = console.info,
|
|
386
|
+
ue = console.log, te = console.info, q = console.warn, ve = console.error, Xe = console.group, Ge = console.groupCollapsed, Je = console.groupEnd;
|
|
387
387
|
var r = {
|
|
388
388
|
configurable: !0,
|
|
389
389
|
enumerable: !0,
|
|
@@ -412,25 +412,25 @@ function Wn() {
|
|
|
412
412
|
writable: !0
|
|
413
413
|
};
|
|
414
414
|
Object.defineProperties(console, {
|
|
415
|
-
log:
|
|
415
|
+
log: Z({}, r, {
|
|
416
416
|
value: ue
|
|
417
417
|
}),
|
|
418
|
-
info:
|
|
418
|
+
info: Z({}, r, {
|
|
419
419
|
value: te
|
|
420
420
|
}),
|
|
421
|
-
warn:
|
|
422
|
-
value:
|
|
421
|
+
warn: Z({}, r, {
|
|
422
|
+
value: q
|
|
423
423
|
}),
|
|
424
|
-
error:
|
|
424
|
+
error: Z({}, r, {
|
|
425
425
|
value: ve
|
|
426
426
|
}),
|
|
427
|
-
group:
|
|
427
|
+
group: Z({}, r, {
|
|
428
428
|
value: Xe
|
|
429
429
|
}),
|
|
430
|
-
groupCollapsed:
|
|
430
|
+
groupCollapsed: Z({}, r, {
|
|
431
431
|
value: Ge
|
|
432
432
|
}),
|
|
433
|
-
groupEnd:
|
|
433
|
+
groupEnd: Z({}, r, {
|
|
434
434
|
value: Je
|
|
435
435
|
})
|
|
436
436
|
});
|
|
@@ -438,7 +438,7 @@ function Wn() {
|
|
|
438
438
|
oe < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
var Oe =
|
|
441
|
+
var Oe = N.ReactCurrentDispatcher, He;
|
|
442
442
|
function Ce(r, h, m) {
|
|
443
443
|
{
|
|
444
444
|
if (He === void 0)
|
|
@@ -506,14 +506,14 @@ function Wn() {
|
|
|
506
506
|
} catch (J) {
|
|
507
507
|
if (J && w && typeof J.stack == "string") {
|
|
508
508
|
for (var T = J.stack.split(`
|
|
509
|
-
`),
|
|
510
|
-
`), H = T.length - 1, U =
|
|
509
|
+
`), X = w.stack.split(`
|
|
510
|
+
`), H = T.length - 1, U = X.length - 1; H >= 1 && U >= 0 && T[H] !== X[U]; )
|
|
511
511
|
U--;
|
|
512
512
|
for (; H >= 1 && U >= 0; H--, U--)
|
|
513
|
-
if (T[H] !==
|
|
513
|
+
if (T[H] !== X[U]) {
|
|
514
514
|
if (H !== 1 || U !== 1)
|
|
515
515
|
do
|
|
516
|
-
if (H--, U--, U < 0 || T[H] !==
|
|
516
|
+
if (H--, U--, U < 0 || T[H] !== X[U]) {
|
|
517
517
|
var ee = `
|
|
518
518
|
` + T[H].replace(" at new ", " at ");
|
|
519
519
|
return r.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", r.displayName)), typeof r == "function" && Ee.set(r, ee), ee;
|
|
@@ -564,7 +564,7 @@ function Wn() {
|
|
|
564
564
|
}
|
|
565
565
|
return "";
|
|
566
566
|
}
|
|
567
|
-
var ye = Object.prototype.hasOwnProperty, tt = {}, nt =
|
|
567
|
+
var ye = Object.prototype.hasOwnProperty, tt = {}, nt = N.ReactDebugCurrentFrame;
|
|
568
568
|
function be(r) {
|
|
569
569
|
if (r) {
|
|
570
570
|
var h = r._owner, m = Re(r.type, r._source, h ? h.type : null);
|
|
@@ -580,8 +580,8 @@ function Wn() {
|
|
|
580
580
|
var T = void 0;
|
|
581
581
|
try {
|
|
582
582
|
if (typeof r[C] != "function") {
|
|
583
|
-
var
|
|
584
|
-
throw
|
|
583
|
+
var X = Error((w || "React class") + ": " + m + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
584
|
+
throw X.name = "Invariant Violation", X;
|
|
585
585
|
}
|
|
586
586
|
T = r[C](h, C, w, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
587
587
|
} catch (H) {
|
|
@@ -615,7 +615,7 @@ function Wn() {
|
|
|
615
615
|
if (vn(r))
|
|
616
616
|
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pn(r)), rt(r);
|
|
617
617
|
}
|
|
618
|
-
var it =
|
|
618
|
+
var it = N.ReactCurrentOwner, yn = {
|
|
619
619
|
key: !0,
|
|
620
620
|
ref: !0,
|
|
621
621
|
__self: !0,
|
|
@@ -693,8 +693,8 @@ function Wn() {
|
|
|
693
693
|
};
|
|
694
694
|
function En(r, h, m, w, E) {
|
|
695
695
|
{
|
|
696
|
-
var b, C = {}, T = null,
|
|
697
|
-
m !== void 0 && (ot(m), T = "" + m), wn(h) && (ot(h.key), T = "" + h.key), gn(h) && (
|
|
696
|
+
var b, C = {}, T = null, X = null;
|
|
697
|
+
m !== void 0 && (ot(m), T = "" + m), wn(h) && (ot(h.key), T = "" + h.key), gn(h) && (X = h.ref, xn(h, E));
|
|
698
698
|
for (b in h)
|
|
699
699
|
ye.call(h, b) && !yn.hasOwnProperty(b) && (C[b] = h[b]);
|
|
700
700
|
if (r && r.defaultProps) {
|
|
@@ -702,14 +702,14 @@ function Wn() {
|
|
|
702
702
|
for (b in H)
|
|
703
703
|
C[b] === void 0 && (C[b] = H[b]);
|
|
704
704
|
}
|
|
705
|
-
if (T ||
|
|
705
|
+
if (T || X) {
|
|
706
706
|
var U = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
707
|
-
T && _n(C, U),
|
|
707
|
+
T && _n(C, U), X && Tn(C, U);
|
|
708
708
|
}
|
|
709
|
-
return Cn(r, T,
|
|
709
|
+
return Cn(r, T, X, E, w, it.current, C);
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
var Be =
|
|
712
|
+
var Be = N.ReactCurrentOwner, lt = N.ReactDebugCurrentFrame;
|
|
713
713
|
function de(r) {
|
|
714
714
|
if (r) {
|
|
715
715
|
var h = r._owner, m = Re(r.type, r._source, h ? h.type : null);
|
|
@@ -822,12 +822,12 @@ Check the top-level render call using <` + m + ">.");
|
|
|
822
822
|
var ht = {};
|
|
823
823
|
function mt(r, h, m, w, E, b) {
|
|
824
824
|
{
|
|
825
|
-
var C =
|
|
825
|
+
var C = F(r);
|
|
826
826
|
if (!C) {
|
|
827
827
|
var T = "";
|
|
828
828
|
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
829
|
-
var
|
|
830
|
-
|
|
829
|
+
var X = Rn();
|
|
830
|
+
X ? T += X : T += ct();
|
|
831
831
|
var H;
|
|
832
832
|
r === null ? H = "null" : Ue(r) ? H = "array" : r !== void 0 && r.$$typeof === t ? (H = "<" + (K(r.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : H = typeof r, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", H, T);
|
|
833
833
|
}
|
|
@@ -884,12 +884,12 @@ const qn = "_playerNotice_x3acc_1", Kn = "_playerNoticeTitle_x3acc_19", Yn = "_p
|
|
|
884
884
|
playerNoticeTitle: Kn,
|
|
885
885
|
playerNoticeText: Yn,
|
|
886
886
|
playerNoticeLowZIndex: Xn
|
|
887
|
-
}, Ot = typeof window != "undefined" ? An :
|
|
887
|
+
}, Ot = typeof window != "undefined" ? An : O;
|
|
888
888
|
function Ve(e, t) {
|
|
889
|
-
const n =
|
|
889
|
+
const n = V(e);
|
|
890
890
|
Ot(() => {
|
|
891
891
|
n.current = e;
|
|
892
|
-
}, [e]),
|
|
892
|
+
}, [e]), O(() => {
|
|
893
893
|
if (t === null)
|
|
894
894
|
return;
|
|
895
895
|
const o = setInterval(() => {
|
|
@@ -901,7 +901,7 @@ function Ve(e, t) {
|
|
|
901
901
|
}, [t]);
|
|
902
902
|
}
|
|
903
903
|
function Gn(e) {
|
|
904
|
-
const [, t] =
|
|
904
|
+
const [, t] = G(0);
|
|
905
905
|
Ve(() => t((n) => n + 1), e);
|
|
906
906
|
}
|
|
907
907
|
const Jn = () => Pt((e) => ({
|
|
@@ -914,11 +914,11 @@ const Jn = () => Pt((e) => ({
|
|
|
914
914
|
})), Ht = jt(
|
|
915
915
|
null
|
|
916
916
|
), Qn = ({ children: e }) => {
|
|
917
|
-
const t =
|
|
917
|
+
const t = V(
|
|
918
918
|
null
|
|
919
919
|
);
|
|
920
920
|
return t.current || (t.current = Jn()), /* @__PURE__ */ s.jsx(Ht.Provider, { value: t.current, children: e });
|
|
921
|
-
},
|
|
921
|
+
}, A = (e) => {
|
|
922
922
|
const t = Lt(Ht);
|
|
923
923
|
if (!t)
|
|
924
924
|
throw new Error("usePlayerStore must be used within PlayerStoreProvider");
|
|
@@ -1210,7 +1210,7 @@ const lr = () => On(), cr = (e, t) => ({
|
|
|
1210
1210
|
containerRef: t
|
|
1211
1211
|
})(...n))), Bt = jt(null);
|
|
1212
1212
|
function gr({ children: e }) {
|
|
1213
|
-
const t =
|
|
1213
|
+
const t = V(null), n = V(null), o = V(null);
|
|
1214
1214
|
return t.current || (t.current = yr(n, o)), /* @__PURE__ */ s.jsx(Bt.Provider, { value: t.current, children: e });
|
|
1215
1215
|
}
|
|
1216
1216
|
const f = (e) => {
|
|
@@ -1291,11 +1291,11 @@ async function Tr(e) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
function Cr(n) {
|
|
1293
1293
|
var o = n, { url: e } = o, t = ne(o, ["url"]);
|
|
1294
|
-
const [a, l] =
|
|
1294
|
+
const [a, l] = G(!0), u = A((d) => d.startDate), i = A((d) => d.setStartDate), c = W(async () => {
|
|
1295
1295
|
const d = await Tr(e);
|
|
1296
1296
|
d && i(d);
|
|
1297
1297
|
}, [e, i]);
|
|
1298
|
-
return
|
|
1298
|
+
return O(() => {
|
|
1299
1299
|
(async () => {
|
|
1300
1300
|
l(!0), await c(), l(!1);
|
|
1301
1301
|
})();
|
|
@@ -1306,7 +1306,7 @@ function Er({
|
|
|
1306
1306
|
messages: t = {}
|
|
1307
1307
|
}) {
|
|
1308
1308
|
var u, i, c;
|
|
1309
|
-
const n =
|
|
1309
|
+
const n = A((d) => d.startDate), o = f((d) => d.isStarted);
|
|
1310
1310
|
return Gn(o ? null : 5e3), n ? Date.now() < n.getTime() ? /* @__PURE__ */ s.jsx(
|
|
1311
1311
|
Rr,
|
|
1312
1312
|
{
|
|
@@ -1331,7 +1331,7 @@ function Rr({ startDate: e, title: t, message: n }) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
function zt({ callback: e }) {
|
|
1333
1333
|
const t = f((n) => n.eventEmitter);
|
|
1334
|
-
return
|
|
1334
|
+
return O(() => {
|
|
1335
1335
|
const n = () => e("play", void 0), o = () => e("pause", void 0), a = () => e("ended", void 0), l = () => e("seeking", void 0), u = () => e("seeked", void 0), i = (_) => e("volumeChange", _), c = (_) => e("fullscreenChange", _), d = (_) => e("qualityChange", _), v = (_) => e("loadedMetadata", _), y = () => e("loadStart", void 0), g = () => e("playing", void 0), L = () => e("waiting", void 0), D = () => e("error", void 0);
|
|
1336
1336
|
return t.on("play", n), t.on("pause", o), t.on("ended", a), t.on("seeking", l), t.on("seeked", u), t.on("volumeChange", i), t.on("fullscreenChange", c), t.on("qualityChange", d), t.on("loadedMetadata", v), t.on("loadStart", y), t.on("playing", g), t.on("waiting", L), t.on("error", D), () => {
|
|
1337
1337
|
t.off("play", n), t.off("pause", o), t.off("ended", a), t.off("seeking", l), t.off("seeked", u), t.off("volumeChange", i), t.off("fullscreenChange", c), t.off("qualityChange", d), t.off("loadedMetadata", v), t.off("loadStart", y), t.off("playing", g), t.off("waiting", L), t.off("error", D);
|
|
@@ -1369,8 +1369,8 @@ function jr({
|
|
|
1369
1369
|
}), a;
|
|
1370
1370
|
}
|
|
1371
1371
|
function Lr({ callback: e }) {
|
|
1372
|
-
const t =
|
|
1373
|
-
return
|
|
1372
|
+
const t = A((l) => l.delay), n = A((l) => l.startDate), o = n ? n.getTime() : 0, a = f((l) => l.eventEmitter);
|
|
1373
|
+
return O(() => {
|
|
1374
1374
|
const l = () => e("timeUpdate", {
|
|
1375
1375
|
currentTime: Zt(o, t),
|
|
1376
1376
|
duration: -1
|
|
@@ -1381,7 +1381,7 @@ function Lr({ callback: e }) {
|
|
|
1381
1381
|
}, [e, a]), /* @__PURE__ */ s.jsx(zt, { callback: e });
|
|
1382
1382
|
}
|
|
1383
1383
|
function qt() {
|
|
1384
|
-
const e = f((i) => i.exitFullscreen), t = f((i) => i.isFullscreen), n = f((i) => i.isFullscreenReady), o = f((i) => i.requestFullscreen), a = f((i) => i.setVolume), l = f((i) => i.volume), u =
|
|
1384
|
+
const e = f((i) => i.exitFullscreen), t = f((i) => i.isFullscreen), n = f((i) => i.isFullscreenReady), o = f((i) => i.requestFullscreen), a = f((i) => i.setVolume), l = f((i) => i.volume), u = W(
|
|
1385
1385
|
(i) => {
|
|
1386
1386
|
let c = !1;
|
|
1387
1387
|
if (!(i.target instanceof HTMLInputElement || i.ctrlKey)) {
|
|
@@ -1411,12 +1411,12 @@ function qt() {
|
|
|
1411
1411
|
l
|
|
1412
1412
|
]
|
|
1413
1413
|
);
|
|
1414
|
-
return
|
|
1414
|
+
return O(() => (document.addEventListener("keydown", u), () => {
|
|
1415
1415
|
document.removeEventListener("keydown", u);
|
|
1416
1416
|
}), [u]), null;
|
|
1417
1417
|
}
|
|
1418
1418
|
function Pr() {
|
|
1419
|
-
const e =
|
|
1419
|
+
const e = A((i) => i.delay), t = f((i) => i.isPlaying), n = f((i) => i.pause), o = f((i) => i.getPauseTimeDiff), a = f((i) => i.play), l = A((i) => i.setDelay), u = W(
|
|
1420
1420
|
(i) => {
|
|
1421
1421
|
let c = !1;
|
|
1422
1422
|
if (!(i.target instanceof HTMLInputElement || i.ctrlKey)) {
|
|
@@ -1442,7 +1442,7 @@ function Pr() {
|
|
|
1442
1442
|
},
|
|
1443
1443
|
[e, o, t, n, a, l]
|
|
1444
1444
|
);
|
|
1445
|
-
return
|
|
1445
|
+
return O(() => (document.addEventListener("keydown", u), () => {
|
|
1446
1446
|
document.removeEventListener("keydown", u);
|
|
1447
1447
|
}), [u]), /* @__PURE__ */ s.jsx(qt, {});
|
|
1448
1448
|
}
|
|
@@ -1453,7 +1453,7 @@ function Ir({ children: e }) {
|
|
|
1453
1453
|
return /* @__PURE__ */ s.jsx(Qn, { children: /* @__PURE__ */ s.jsx(Kt, { children: e }) });
|
|
1454
1454
|
}
|
|
1455
1455
|
function kr({ url: e, isLive: t, messages: n }) {
|
|
1456
|
-
const o =
|
|
1456
|
+
const o = V(null), a = f((x) => x.level), l = f((x) => x.levels), u = f((x) => x.setLevel), i = f((x) => x.setLevels), c = f((x) => x.techRef), d = f((x) => x.setError), v = V(0), y = V(null), g = 50, L = 1e4, D = W(
|
|
1457
1457
|
(x) => {
|
|
1458
1458
|
if (o.current && (o.current.nextLevel = x, u(null), l)) {
|
|
1459
1459
|
const I = l.map((p) => he(j({}, p), {
|
|
@@ -1463,20 +1463,20 @@ function kr({ url: e, isLive: t, messages: n }) {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
},
|
|
1465
1465
|
[l, u, i, o]
|
|
1466
|
-
), _ =
|
|
1466
|
+
), _ = W(() => {
|
|
1467
1467
|
o.current && (console.log("[Player][HLS] MEDIA_ATTACHED"), o.current.loadSource(e));
|
|
1468
|
-
}, [e]), S =
|
|
1468
|
+
}, [e]), S = W(() => {
|
|
1469
1469
|
if (!o.current) return;
|
|
1470
1470
|
console.log("[Player][HLS] MANIFEST_LOADED"), d(null), y.current && (clearTimeout(y.current), y.current = null), v.current = 0;
|
|
1471
1471
|
const x = o.current.levels, I = o.current.currentLevel, p = o.current.autoLevelEnabled;
|
|
1472
1472
|
i(
|
|
1473
1473
|
jr({
|
|
1474
|
-
levels: x.map(($,
|
|
1475
|
-
const { bitrate:
|
|
1474
|
+
levels: x.map(($, Y) => {
|
|
1475
|
+
const { bitrate: B, height: F, width: k } = $;
|
|
1476
1476
|
return {
|
|
1477
|
-
bitrate:
|
|
1478
|
-
height:
|
|
1479
|
-
index:
|
|
1477
|
+
bitrate: B,
|
|
1478
|
+
height: F,
|
|
1479
|
+
index: Y,
|
|
1480
1480
|
width: k
|
|
1481
1481
|
};
|
|
1482
1482
|
}),
|
|
@@ -1484,29 +1484,26 @@ function kr({ url: e, isLive: t, messages: n }) {
|
|
|
1484
1484
|
isAuto: p
|
|
1485
1485
|
})
|
|
1486
1486
|
);
|
|
1487
|
-
}, [d, i]),
|
|
1487
|
+
}, [d, i]), N = W(
|
|
1488
1488
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1489
1489
|
(x, I) => {
|
|
1490
1490
|
var p, $;
|
|
1491
|
-
if (
|
|
1491
|
+
if (o.current && I.fatal)
|
|
1492
1492
|
switch (I.type) {
|
|
1493
1493
|
case re.ErrorTypes.NETWORK_ERROR:
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
code: "NETWORK_ERROR",
|
|
1508
|
-
tech: "hls"
|
|
1509
|
-
}), o.current.startLoad());
|
|
1494
|
+
let Y = (p = n == null ? void 0 : n.unableToPlay) != null ? p : "Unable to play the video. Please try again later.", B = "NETWORK_ERROR";
|
|
1495
|
+
console.log("[Player][HLS] NETWORK_ERROR", I), t ? (
|
|
1496
|
+
// Initial load failure
|
|
1497
|
+
(I.details === "manifestLoadError" || // Level load failure during playback (e.g. OBS disconnect)
|
|
1498
|
+
I.details === "levelLoadError") && (v.current < g && (y.current && clearTimeout(y.current), v.current += 1, y.current = setTimeout(() => {
|
|
1499
|
+
if (o.current)
|
|
1500
|
+
try {
|
|
1501
|
+
console.log("[Player][HLS] Retrying stream..."), o.current.loadSource(e);
|
|
1502
|
+
} catch (F) {
|
|
1503
|
+
console.error("[Player][HLS] Retry failed:", F);
|
|
1504
|
+
}
|
|
1505
|
+
}, L)), Y = ($ = n == null ? void 0 : n.eventFinished) != null ? $ : "Live event will be back shortly.", B = "LIVE_MANIFEST_LOAD_ERROR")
|
|
1506
|
+
) : o.current.startLoad(), d({ message: Y, code: B, tech: "hls" });
|
|
1510
1507
|
break;
|
|
1511
1508
|
case re.ErrorTypes.MEDIA_ERROR:
|
|
1512
1509
|
o.current.recoverMediaError();
|
|
@@ -1514,7 +1511,7 @@ function kr({ url: e, isLive: t, messages: n }) {
|
|
|
1514
1511
|
}
|
|
1515
1512
|
},
|
|
1516
1513
|
[t, e, d]
|
|
1517
|
-
), R =
|
|
1514
|
+
), R = W(() => {
|
|
1518
1515
|
if (!c.current) return;
|
|
1519
1516
|
let x = {
|
|
1520
1517
|
startLevel: -1,
|
|
@@ -1523,23 +1520,23 @@ function kr({ url: e, isLive: t, messages: n }) {
|
|
|
1523
1520
|
};
|
|
1524
1521
|
rr ? (x.backBufferLength = -1, x.enableWorker = !1) : t ? x.backBufferLength = 10 : x.backBufferLength = 60;
|
|
1525
1522
|
try {
|
|
1526
|
-
console.log("[Player][HLS] URL", e), console.log("[Player][HLS] Config", JSON.stringify(x)), console.log("[Player][HLS] Version", re.version), o.current = new re(x), o.current.attachMedia(c.current), o.current.on(re.Events.MEDIA_ATTACHED, _), o.current.on(re.Events.MANIFEST_LOADED, S), o.current.on(re.Events.ERROR,
|
|
1523
|
+
console.log("[Player][HLS] URL", e), console.log("[Player][HLS] Config", JSON.stringify(x)), console.log("[Player][HLS] Version", re.version), o.current = new re(x), o.current.attachMedia(c.current), o.current.on(re.Events.MEDIA_ATTACHED, _), o.current.on(re.Events.MANIFEST_LOADED, S), o.current.on(re.Events.ERROR, N);
|
|
1527
1524
|
} catch (I) {
|
|
1528
1525
|
throw new Error(`Error initializing Hls: ${I}`);
|
|
1529
1526
|
}
|
|
1530
1527
|
}, [
|
|
1531
1528
|
S,
|
|
1532
1529
|
_,
|
|
1533
|
-
|
|
1530
|
+
N,
|
|
1534
1531
|
t,
|
|
1535
1532
|
c,
|
|
1536
1533
|
e
|
|
1537
|
-
]), P =
|
|
1538
|
-
o.current && (o.current.off(re.Events.MEDIA_ATTACHED, _), o.current.off(re.Events.MANIFEST_LOADED, S), o.current.off(re.Events.ERROR,
|
|
1539
|
-
}, [S, _,
|
|
1540
|
-
return
|
|
1534
|
+
]), P = W(() => {
|
|
1535
|
+
o.current && (o.current.off(re.Events.MEDIA_ATTACHED, _), o.current.off(re.Events.MANIFEST_LOADED, S), o.current.off(re.Events.ERROR, N), o.current.destroy(), o.current = null), y.current && (clearTimeout(y.current), y.current = null), v.current = 0;
|
|
1536
|
+
}, [S, _, N]);
|
|
1537
|
+
return O(() => {
|
|
1541
1538
|
a !== null && D(a);
|
|
1542
|
-
}, [a, D]),
|
|
1539
|
+
}, [a, D]), O(() => (re.isSupported() && R(), P), [P, R]), null;
|
|
1543
1540
|
}
|
|
1544
1541
|
const Dr = "_playerVideo_wc0sm_1", Fr = {
|
|
1545
1542
|
playerVideo: Dr
|
|
@@ -1550,7 +1547,7 @@ function Yt({
|
|
|
1550
1547
|
isMuted: n = !1,
|
|
1551
1548
|
messages: o = {}
|
|
1552
1549
|
}) {
|
|
1553
|
-
const a = f((p) => p.handleDurationChange), l = f((p) => p.handleEnd), u = f((p) => p.handleLoadedMetadata), i = f((p) => p.handleLoadStart), c = f((p) => p.handlePause), d = f((p) => p.handlePlay), v = f((p) => p.handlePlaying), y = f((p) => p.handleSeeked), g = f((p) => p.handleSeeking), L = f((p) => p.handleTimeUpdate), D = f((p) => p.handleWaiting), _ = f((p) => p.handleVolumeChange), S = f((p) => p.handleError),
|
|
1550
|
+
const a = f((p) => p.handleDurationChange), l = f((p) => p.handleEnd), u = f((p) => p.handleLoadedMetadata), i = f((p) => p.handleLoadStart), c = f((p) => p.handlePause), d = f((p) => p.handlePlay), v = f((p) => p.handlePlaying), y = f((p) => p.handleSeeked), g = f((p) => p.handleSeeking), L = f((p) => p.handleTimeUpdate), D = f((p) => p.handleWaiting), _ = f((p) => p.handleVolumeChange), S = f((p) => p.handleError), N = f((p) => p.techRef), R = V(null), P = () => t ? {
|
|
1554
1551
|
onTimeUpdate: x
|
|
1555
1552
|
} : {
|
|
1556
1553
|
onDurationChange: a,
|
|
@@ -1565,7 +1562,7 @@ function Yt({
|
|
|
1565
1562
|
/* @__PURE__ */ s.jsx(
|
|
1566
1563
|
"video",
|
|
1567
1564
|
j({
|
|
1568
|
-
ref:
|
|
1565
|
+
ref: N,
|
|
1569
1566
|
className: Fr.playerVideo,
|
|
1570
1567
|
playsInline: !0,
|
|
1571
1568
|
autoPlay: !0,
|
|
@@ -1588,12 +1585,12 @@ function Yt({
|
|
|
1588
1585
|
] });
|
|
1589
1586
|
}
|
|
1590
1587
|
function Mr({ url: e, messages: t = {} }) {
|
|
1591
|
-
const [n, o] =
|
|
1588
|
+
const [n, o] = G(null), a = A((u) => u.delay), l = W(async () => {
|
|
1592
1589
|
o(
|
|
1593
1590
|
a ? e.replace("-live", "-catchup").replace("playlist.m3u8", `playlist_fmp4_dvr_timeshift-${a}.m3u8`) : e
|
|
1594
1591
|
);
|
|
1595
1592
|
}, [a, e]);
|
|
1596
|
-
return
|
|
1593
|
+
return O(() => {
|
|
1597
1594
|
l();
|
|
1598
1595
|
}, [l]), n ? /* @__PURE__ */ s.jsx(Yt, { url: n, isLive: !0, messages: t }) : null;
|
|
1599
1596
|
}
|
|
@@ -1601,7 +1598,7 @@ function Nr({ url: e }) {
|
|
|
1601
1598
|
return f((n) => n.isStarted) ? /* @__PURE__ */ s.jsx(Vr, { url: e }) : null;
|
|
1602
1599
|
}
|
|
1603
1600
|
function Vr({ url: e }) {
|
|
1604
|
-
const t =
|
|
1601
|
+
const t = A((l) => l.setViewerCount), n = V(null), o = (l) => {
|
|
1605
1602
|
try {
|
|
1606
1603
|
return new URL(l).pathname.split("/").filter((d) => d.length > 0)[0] || null;
|
|
1607
1604
|
} catch (u) {
|
|
@@ -1630,7 +1627,7 @@ function Vr({ url: e }) {
|
|
|
1630
1627
|
console.error("Failed to fetch viewer count:", d), t(null);
|
|
1631
1628
|
}
|
|
1632
1629
|
};
|
|
1633
|
-
return
|
|
1630
|
+
return O(() => (a(), () => {
|
|
1634
1631
|
n.current && n.current.abort();
|
|
1635
1632
|
}), [e]), Ve(a, 15e3), null;
|
|
1636
1633
|
}
|
|
@@ -1638,7 +1635,7 @@ function Ar(e, {
|
|
|
1638
1635
|
defaultValue: t = !1,
|
|
1639
1636
|
initializeWithValue: n = !0
|
|
1640
1637
|
} = {}) {
|
|
1641
|
-
const o = (i) => typeof window == "undefined" ? t : window.matchMedia(i).matches, [a, l] =
|
|
1638
|
+
const o = (i) => typeof window == "undefined" ? t : window.matchMedia(i).matches, [a, l] = G(() => n ? o(e) : t);
|
|
1642
1639
|
function u() {
|
|
1643
1640
|
l(o(e));
|
|
1644
1641
|
}
|
|
@@ -1687,7 +1684,7 @@ function Xt(i) {
|
|
|
1687
1684
|
}
|
|
1688
1685
|
function Wr(o) {
|
|
1689
1686
|
var a = o, { className: e, onClick: t } = a, n = ne(a, ["className", "onClick"]);
|
|
1690
|
-
const l =
|
|
1687
|
+
const l = V(null), u = f((_) => _.exitFullscreen), i = f((_) => _.isFullscreen), c = f((_) => _.requestFullscreen), d = f((_) => _.resetIdle), v = (_) => {
|
|
1691
1688
|
L() ? (g(), i ? u() : c()) : y(_);
|
|
1692
1689
|
}, y = (_) => {
|
|
1693
1690
|
l.current = window.setTimeout(() => {
|
|
@@ -1698,7 +1695,7 @@ function Wr(o) {
|
|
|
1698
1695
|
}, L = () => l.current !== null, D = () => {
|
|
1699
1696
|
d();
|
|
1700
1697
|
};
|
|
1701
|
-
return
|
|
1698
|
+
return O(() => () => {
|
|
1702
1699
|
g();
|
|
1703
1700
|
}, []), /* @__PURE__ */ s.jsx(
|
|
1704
1701
|
"button",
|
|
@@ -1724,36 +1721,36 @@ function Zr(u) {
|
|
|
1724
1721
|
"onForwardSeek",
|
|
1725
1722
|
"onBackwardSeek"
|
|
1726
1723
|
]);
|
|
1727
|
-
const c =
|
|
1724
|
+
const c = V(null), d = V({
|
|
1728
1725
|
single: null,
|
|
1729
1726
|
indicator: null,
|
|
1730
1727
|
accumulate: null
|
|
1731
|
-
}), v =
|
|
1728
|
+
}), v = V(null), y = V(0), g = V(null), [L, D] = G({ visible: !1, direction: null, time: 0 }), _ = f((p) => p.isIdle), S = f((p) => p.setIsIdle), N = f((p) => p.resetIdle), R = (p, $) => p < $ / 2 ? "backward" : "forward", P = (p) => {
|
|
1732
1729
|
if (!v.current) return;
|
|
1733
1730
|
const $ = p.changedTouches[0];
|
|
1734
1731
|
if (!$) return;
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1732
|
+
const Y = Date.now(), B = v.current.getBoundingClientRect(), F = $.clientX - B.left, k = $.clientY - B.top;
|
|
1733
|
+
if (F < 0 || F > B.width || k < 0 || k > B.height)
|
|
1737
1734
|
return;
|
|
1738
|
-
const Q = c.current, K = Q ?
|
|
1739
|
-
if (Q !== null && g.current === null && K < 300 && Math.abs(
|
|
1740
|
-
p.preventDefault(), p.stopPropagation(), d.current.single && (window.clearTimeout(d.current.single), d.current.single = null),
|
|
1741
|
-
const te =
|
|
1735
|
+
const Q = c.current, K = Q ? Y - Q.time : 1 / 0, Z = R(F, B.width), oe = g.current !== null && g.current === Z && Q !== null && K < 700 && Math.abs(F - Q.x) < 100;
|
|
1736
|
+
if (Q !== null && g.current === null && K < 300 && Math.abs(F - Q.x) < 50 || oe) {
|
|
1737
|
+
p.preventDefault(), p.stopPropagation(), d.current.single && (window.clearTimeout(d.current.single), d.current.single = null), N(), (g.current === null || g.current !== Z) && (y.current = 0, g.current = Z);
|
|
1738
|
+
const te = Z === "backward" ? n : t;
|
|
1742
1739
|
y.current = Math.min(
|
|
1743
1740
|
y.current + zr,
|
|
1744
1741
|
te != null ? te : 1 / 0
|
|
1745
|
-
), x(
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
}, 500), c.current = { time:
|
|
1742
|
+
), x(Z, y.current), d.current.accumulate && window.clearTimeout(d.current.accumulate), d.current.accumulate = window.setTimeout(() => {
|
|
1743
|
+
const q = y.current;
|
|
1744
|
+
q > 0 && (g.current === "backward" ? a == null || a(q) : o == null || o(q), N()), y.current = 0, g.current = null, c.current = null, I(), d.current.accumulate = null;
|
|
1745
|
+
}, 500), c.current = { time: Y, x: F };
|
|
1749
1746
|
} else {
|
|
1750
|
-
c.current = { time:
|
|
1747
|
+
c.current = { time: Y, x: F }, d.current.single && window.clearTimeout(d.current.single);
|
|
1751
1748
|
const te = g.current !== null ? 700 : 350;
|
|
1752
1749
|
d.current.single = window.setTimeout(() => {
|
|
1753
1750
|
if (g.current === null) {
|
|
1754
1751
|
d.current.single = null;
|
|
1755
|
-
const
|
|
1756
|
-
S(!
|
|
1752
|
+
const q = _;
|
|
1753
|
+
S(!q), q && N();
|
|
1757
1754
|
}
|
|
1758
1755
|
c.current = null;
|
|
1759
1756
|
}, te);
|
|
@@ -1765,7 +1762,7 @@ function Zr(u) {
|
|
|
1765
1762
|
}, I = () => {
|
|
1766
1763
|
D({ visible: !1, direction: null, time: 0 }), d.current.indicator && (window.clearTimeout(d.current.indicator), d.current.indicator = null);
|
|
1767
1764
|
};
|
|
1768
|
-
return
|
|
1765
|
+
return O(() => () => {
|
|
1769
1766
|
d.current.single && window.clearTimeout(d.current.single), d.current.indicator && window.clearTimeout(d.current.indicator), d.current.accumulate && window.clearTimeout(d.current.accumulate);
|
|
1770
1767
|
}, []), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1771
1768
|
/* @__PURE__ */ s.jsx(
|
|
@@ -1790,7 +1787,7 @@ function Zr(u) {
|
|
|
1790
1787
|
] });
|
|
1791
1788
|
}
|
|
1792
1789
|
function qr() {
|
|
1793
|
-
const e = f((c) => c.isPlaying), t = f((c) => c.pause), n = f((c) => c.getPauseTimeDiff), o = f((c) => c.play), a =
|
|
1790
|
+
const e = f((c) => c.isPlaying), t = f((c) => c.pause), n = f((c) => c.getPauseTimeDiff), o = f((c) => c.play), a = A((c) => c.delay), l = A((c) => c.setDelay), u = A((c) => c.startDate), i = u ? u.getTime() : 0;
|
|
1794
1791
|
return /* @__PURE__ */ s.jsx(
|
|
1795
1792
|
Xt,
|
|
1796
1793
|
{
|
|
@@ -1833,7 +1830,7 @@ const Xr = "_liveIndicator_1jczn_1", Gr = "_liveIndicatorHasDelay_1jczn_9", Jr =
|
|
|
1833
1830
|
};
|
|
1834
1831
|
function Qr(n) {
|
|
1835
1832
|
var o = n, { message: e } = o, t = ne(o, ["message"]);
|
|
1836
|
-
const a =
|
|
1833
|
+
const a = A((c) => c.delay), l = A((c) => c.setDelay), u = () => {
|
|
1837
1834
|
a && l(0);
|
|
1838
1835
|
}, i = a ? `${Ie.liveIndicator} ${Ie.liveIndicatorHasDelay}` : `${Ie.liveIndicator} ${Ie.liveIndicatorNoDelay}`;
|
|
1839
1836
|
return /* @__PURE__ */ s.jsxs(le, he(j({ onClick: u, shape: "square" }, t), { children: [
|
|
@@ -1864,7 +1861,7 @@ function Jt() {
|
|
|
1864
1861
|
);
|
|
1865
1862
|
}
|
|
1866
1863
|
function eo() {
|
|
1867
|
-
const e = f((i) => i.isPlaying), t = f((i) => i.pause), n = f((i) => i.getPauseTimeDiff), o = f((i) => i.play), a =
|
|
1864
|
+
const e = f((i) => i.isPlaying), t = f((i) => i.pause), n = f((i) => i.getPauseTimeDiff), o = f((i) => i.play), a = A((i) => i.delay), l = A((i) => i.setDelay), u = () => {
|
|
1868
1865
|
if (e)
|
|
1869
1866
|
t();
|
|
1870
1867
|
else {
|
|
@@ -1922,7 +1919,7 @@ function Me(e) {
|
|
|
1922
1919
|
}
|
|
1923
1920
|
const Tt = "vod-player-progress-bar";
|
|
1924
1921
|
function uo() {
|
|
1925
|
-
const e =
|
|
1922
|
+
const e = V(null), t = V(null), [n, o] = G(0), [a, l] = G(0), [u, i] = G(!1), [c, d] = G(-1), [v, y] = G(-1), g = A((k) => k.delay), L = A((k) => k.startDate), D = L ? L.getTime() : 0, _ = (/* @__PURE__ */ new Date()).getTime(), S = A((k) => k.setDelay), N = f((k) => k.isPlaying), R = f((k) => k.addIdleLock), P = f((k) => k.removeIdleLock), x = W(() => {
|
|
1926
1923
|
o(Zt(D, g)), l(br(D, _));
|
|
1927
1924
|
}, [g, _, D]), I = parseFloat(
|
|
1928
1925
|
(a ? (v !== -1 ? v : n) / a * 100 : 0).toFixed(1)
|
|
@@ -1933,22 +1930,22 @@ function uo() {
|
|
|
1933
1930
|
const k = Wt(D, v);
|
|
1934
1931
|
S(k), y(-1), P(Tt);
|
|
1935
1932
|
}
|
|
1936
|
-
},
|
|
1933
|
+
}, Y = () => i(!0), B = () => i(!1), F = W(
|
|
1937
1934
|
(k) => {
|
|
1938
1935
|
const Q = e.current, K = t.current;
|
|
1939
1936
|
if (Q && K) {
|
|
1940
|
-
const
|
|
1937
|
+
const Z = Me(Q), oe = Me(K), ue = (k.pageX || k.clientX) - Z.left, te = ue / Z.width;
|
|
1941
1938
|
if (te < 0) return;
|
|
1942
|
-
let
|
|
1943
|
-
|
|
1939
|
+
let q = ue - oe.width / 2;
|
|
1940
|
+
q < 0 && (q = 0), q > Z.width - oe.width && (q = -1), K.style.left = q > -1 ? `${q}px` : "auto", K.style.right = q > -1 ? "auto" : "0px";
|
|
1944
1941
|
const ve = a - te * a;
|
|
1945
1942
|
d(ve > 0 ? ve : 0);
|
|
1946
1943
|
}
|
|
1947
|
-
|
|
1944
|
+
Y();
|
|
1948
1945
|
},
|
|
1949
1946
|
[a]
|
|
1950
1947
|
);
|
|
1951
|
-
return Ve(() => x(),
|
|
1948
|
+
return Ve(() => x(), N ? 1e3 : null), O(() => {
|
|
1952
1949
|
x();
|
|
1953
1950
|
}, [x]), /* @__PURE__ */ s.jsxs("div", { className: se.progressSlider, children: [
|
|
1954
1951
|
/* @__PURE__ */ s.jsx(
|
|
@@ -1956,9 +1953,9 @@ function uo() {
|
|
|
1956
1953
|
{
|
|
1957
1954
|
ref: e,
|
|
1958
1955
|
value: [I],
|
|
1959
|
-
onPointerLeave:
|
|
1960
|
-
onPointerDown:
|
|
1961
|
-
onPointerMove:
|
|
1956
|
+
onPointerLeave: B,
|
|
1957
|
+
onPointerDown: B,
|
|
1958
|
+
onPointerMove: F,
|
|
1962
1959
|
onValueChange: p,
|
|
1963
1960
|
onValueCommit: $,
|
|
1964
1961
|
step: 0.1
|
|
@@ -1986,7 +1983,7 @@ function fo() {
|
|
|
1986
1983
|
);
|
|
1987
1984
|
}
|
|
1988
1985
|
function ho() {
|
|
1989
|
-
const e =
|
|
1986
|
+
const e = A((a) => a.startDate), t = A((a) => a.setDelay), n = e ? e.getTime() : 0, o = () => t(Wt(n));
|
|
1990
1987
|
return /* @__PURE__ */ s.jsx(le, { onClick: o, children: /* @__PURE__ */ s.jsx(fo, {}) });
|
|
1991
1988
|
}
|
|
1992
1989
|
const mo = "_viewersContainer_z1ihz_1", po = "_viewersIndicator_z1ihz_16", vo = "_viewersIcon_z1ihz_24", yo = "_viewersCount_z1ihz_28", De = {
|
|
@@ -1996,7 +1993,7 @@ const mo = "_viewersContainer_z1ihz_1", po = "_viewersIndicator_z1ihz_16", vo =
|
|
|
1996
1993
|
viewersCount: yo
|
|
1997
1994
|
};
|
|
1998
1995
|
function go() {
|
|
1999
|
-
const e =
|
|
1996
|
+
const e = A((t) => t.viewerCount);
|
|
2000
1997
|
return e ? /* @__PURE__ */ s.jsxs("div", { className: De.viewersContainer, children: [
|
|
2001
1998
|
/* @__PURE__ */ s.jsx("span", { className: De.viewersIndicator }),
|
|
2002
1999
|
/* @__PURE__ */ s.jsxs(
|
|
@@ -2041,7 +2038,7 @@ function Qt() {
|
|
|
2041
2038
|
}
|
|
2042
2039
|
);
|
|
2043
2040
|
}
|
|
2044
|
-
const wo = "_playerContainer_146tx_1", xo = "_controlsTop_146tx_12", _o = "_controlsBottom_146tx_29", To = "_controlsContainer_146tx_45", Co = "_controlsRow_146tx_61", Eo = "_controlsSection_146tx_68", Ro = "_controlsSectionStart_146tx_78", bo = "_controlsSectionEnd_146tx_82",
|
|
2041
|
+
const wo = "_playerContainer_146tx_1", xo = "_controlsTop_146tx_12", _o = "_controlsBottom_146tx_29", To = "_controlsContainer_146tx_45", Co = "_controlsRow_146tx_61", Eo = "_controlsSection_146tx_68", Ro = "_controlsSectionStart_146tx_78", bo = "_controlsSectionEnd_146tx_82", z = {
|
|
2045
2042
|
playerContainer: wo,
|
|
2046
2043
|
controlsTop: xo,
|
|
2047
2044
|
controlsBottom: _o,
|
|
@@ -2074,7 +2071,7 @@ function jo() {
|
|
|
2074
2071
|
);
|
|
2075
2072
|
}
|
|
2076
2073
|
function en() {
|
|
2077
|
-
const e = f((d) => d.containerRef), t = f((d) => d.exitFullscreen), n = f((d) => d.isFullscreen), o = f((d) => d.requestFullscreen), a = f((d) => d.setIsFullscreen), l = f((d) => d.setIsFullscreenReady), u = f((d) => d.techRef), i =
|
|
2074
|
+
const e = f((d) => d.containerRef), t = f((d) => d.exitFullscreen), n = f((d) => d.isFullscreen), o = f((d) => d.requestFullscreen), a = f((d) => d.setIsFullscreen), l = f((d) => d.setIsFullscreenReady), u = f((d) => d.techRef), i = W(
|
|
2078
2075
|
(d) => {
|
|
2079
2076
|
d.stopPropagation(), a(or());
|
|
2080
2077
|
},
|
|
@@ -2082,11 +2079,11 @@ function en() {
|
|
|
2082
2079
|
), c = () => {
|
|
2083
2080
|
n ? t() : o();
|
|
2084
2081
|
};
|
|
2085
|
-
return
|
|
2082
|
+
return O(() => {
|
|
2086
2083
|
const d = Ut ? u.current : e.current;
|
|
2087
2084
|
if (d)
|
|
2088
2085
|
return ar(d, i);
|
|
2089
|
-
}, [e, i, u]),
|
|
2086
|
+
}, [e, i, u]), O(() => {
|
|
2090
2087
|
l(!0);
|
|
2091
2088
|
}, [l]), /* @__PURE__ */ s.jsx(le, { onClick: c, children: n ? /* @__PURE__ */ s.jsx(jo, {}) : /* @__PURE__ */ s.jsx(So, {}) });
|
|
2092
2089
|
}
|
|
@@ -2096,14 +2093,14 @@ const Lo = "_idleCheckContainer_crh2s_1", Po = "_idleCheckContainerIdle_crh2s_5"
|
|
|
2096
2093
|
idleCheckContainerActive: Io
|
|
2097
2094
|
}, ko = 5 * 1e3;
|
|
2098
2095
|
function tn({ children: e }) {
|
|
2099
|
-
const t =
|
|
2096
|
+
const t = V(null), n = f((g) => g.isIdle), o = f((g) => g.setIsIdle), a = V(null), u = f((g) => g.idleLocks).size, i = f((g) => g.eventEmitter), c = W(() => {
|
|
2100
2097
|
a.current !== null && (window.clearTimeout(a.current), a.current = null);
|
|
2101
|
-
}, []), d =
|
|
2098
|
+
}, []), d = W(() => {
|
|
2102
2099
|
c(), a.current = window.setTimeout(() => o(!0), ko);
|
|
2103
2100
|
}, [c]);
|
|
2104
|
-
|
|
2101
|
+
O(() => (o(!1), d(), () => {
|
|
2105
2102
|
c();
|
|
2106
|
-
}), [c, d]),
|
|
2103
|
+
}), [c, d]), O(() => {
|
|
2107
2104
|
const g = () => {
|
|
2108
2105
|
o(!1), d();
|
|
2109
2106
|
};
|
|
@@ -2121,8 +2118,8 @@ function Mo(e) {
|
|
|
2121
2118
|
return /* @__PURE__ */ s.jsx("div", j({ className: Fo.spinner }, e));
|
|
2122
2119
|
}
|
|
2123
2120
|
function No(e, t = 500) {
|
|
2124
|
-
const [n, o] =
|
|
2125
|
-
return
|
|
2121
|
+
const [n, o] = G(e);
|
|
2122
|
+
return O(() => {
|
|
2126
2123
|
const a = window.setTimeout(() => o(e), t);
|
|
2127
2124
|
return () => {
|
|
2128
2125
|
window.clearTimeout(a);
|
|
@@ -2226,7 +2223,7 @@ const on = Ne((a, o) => {
|
|
|
2226
2223
|
on.displayName = "PlayerMenuItem";
|
|
2227
2224
|
const Ct = "settings";
|
|
2228
2225
|
function sn() {
|
|
2229
|
-
const [e, t] =
|
|
2226
|
+
const [e, t] = G(!1), n = f((c) => c.containerRef), o = f((c) => c.addIdleLock), a = f((c) => c.removeIdleLock), l = f((c) => c.levels), u = f((c) => c.setLevel), i = W(
|
|
2230
2227
|
(c) => {
|
|
2231
2228
|
t(c), c ? o(Ct) : a(Ct);
|
|
2232
2229
|
},
|
|
@@ -2311,7 +2308,7 @@ function ti({ url: e, messages: t, onEvent: n }) {
|
|
|
2311
2308
|
"div",
|
|
2312
2309
|
{
|
|
2313
2310
|
ref: o,
|
|
2314
|
-
className:
|
|
2311
|
+
className: z.playerContainer,
|
|
2315
2312
|
children: [
|
|
2316
2313
|
/* @__PURE__ */ s.jsxs(
|
|
2317
2314
|
Cr,
|
|
@@ -2336,14 +2333,14 @@ function ti({ url: e, messages: t, onEvent: n }) {
|
|
|
2336
2333
|
/* @__PURE__ */ s.jsx(nn, {}),
|
|
2337
2334
|
/* @__PURE__ */ s.jsx(qr, {}),
|
|
2338
2335
|
/* @__PURE__ */ s.jsxs(tn, { children: [
|
|
2339
|
-
/* @__PURE__ */ s.jsx("div", { className:
|
|
2340
|
-
/* @__PURE__ */ s.jsx("div", { className:
|
|
2336
|
+
/* @__PURE__ */ s.jsx("div", { className: z.controlsTop, children: /* @__PURE__ */ s.jsx("div", { className: z.controlsContainer, children: /* @__PURE__ */ s.jsx("div", { className: z.controlsRow, children: /* @__PURE__ */ s.jsx(go, {}) }) }) }),
|
|
2337
|
+
/* @__PURE__ */ s.jsx("div", { className: z.controlsBottom, children: /* @__PURE__ */ s.jsxs("div", { className: z.controlsContainer, children: [
|
|
2341
2338
|
/* @__PURE__ */ s.jsx(uo, {}),
|
|
2342
|
-
/* @__PURE__ */ s.jsxs("div", { className:
|
|
2339
|
+
/* @__PURE__ */ s.jsxs("div", { className: z.controlsRow, children: [
|
|
2343
2340
|
/* @__PURE__ */ s.jsxs(
|
|
2344
2341
|
"div",
|
|
2345
2342
|
{
|
|
2346
|
-
className: `${
|
|
2343
|
+
className: `${z.controlsSection} ${z.controlsSectionStart}`,
|
|
2347
2344
|
children: [
|
|
2348
2345
|
/* @__PURE__ */ s.jsx(eo, {}),
|
|
2349
2346
|
/* @__PURE__ */ s.jsx(ho, {}),
|
|
@@ -2354,7 +2351,7 @@ function ti({ url: e, messages: t, onEvent: n }) {
|
|
|
2354
2351
|
/* @__PURE__ */ s.jsxs(
|
|
2355
2352
|
"div",
|
|
2356
2353
|
{
|
|
2357
|
-
className: `${
|
|
2354
|
+
className: `${z.controlsSection} ${z.controlsSectionEnd}`,
|
|
2358
2355
|
children: [
|
|
2359
2356
|
/* @__PURE__ */ s.jsx(Qr, { message: t == null ? void 0 : t.live }),
|
|
2360
2357
|
/* @__PURE__ */ s.jsx(sn, {}),
|
|
@@ -2404,20 +2401,20 @@ function ri() {
|
|
|
2404
2401
|
}
|
|
2405
2402
|
const bt = "vod-player-progress-bar";
|
|
2406
2403
|
function oi() {
|
|
2407
|
-
const e =
|
|
2404
|
+
const e = V(null), t = V(null), [n, o] = G(!1), [a, l] = G(-1), [u, i] = G(-1), c = f((P) => P.currentTime), d = f((P) => P.duration), v = f((P) => P.seek), y = f((P) => P.addIdleLock), g = f((P) => P.removeIdleLock), L = parseFloat(
|
|
2408
2405
|
(d ? (u !== -1 ? u : c) / d * 100 : 0).toFixed(1)
|
|
2409
2406
|
), D = (P) => {
|
|
2410
2407
|
i(d * (P[0] / 100)), y(bt);
|
|
2411
2408
|
}, _ = () => {
|
|
2412
2409
|
u !== -1 && (v(u), i(-1), g(bt));
|
|
2413
|
-
}, S = () => o(!0),
|
|
2410
|
+
}, S = () => o(!0), N = () => o(!1), R = W(
|
|
2414
2411
|
(P) => {
|
|
2415
2412
|
const x = e.current, I = t.current;
|
|
2416
2413
|
if (x && I) {
|
|
2417
|
-
const p = Me(x), $ = Me(I),
|
|
2418
|
-
if (
|
|
2419
|
-
let
|
|
2420
|
-
|
|
2414
|
+
const p = Me(x), $ = Me(I), Y = (P.pageX || P.clientX) - p.left, B = Y / p.width;
|
|
2415
|
+
if (B < 0) return;
|
|
2416
|
+
let F = Y - $.width / 2;
|
|
2417
|
+
F < 0 && (F = 0), F > p.width - $.width && (F = -1), I.style.left = F > -1 ? `${F}px` : "auto", I.style.right = F > -1 ? "auto" : "0px", l(B * d);
|
|
2421
2418
|
}
|
|
2422
2419
|
S();
|
|
2423
2420
|
},
|
|
@@ -2429,8 +2426,8 @@ function oi() {
|
|
|
2429
2426
|
{
|
|
2430
2427
|
ref: e,
|
|
2431
2428
|
value: [L],
|
|
2432
|
-
onPointerLeave:
|
|
2433
|
-
onPointerDown:
|
|
2429
|
+
onPointerLeave: N,
|
|
2430
|
+
onPointerDown: N,
|
|
2434
2431
|
onPointerMove: R,
|
|
2435
2432
|
onValueChange: D,
|
|
2436
2433
|
onValueCommit: _,
|
|
@@ -2462,7 +2459,7 @@ function li() {
|
|
|
2462
2459
|
}
|
|
2463
2460
|
function ci({ callback: e }) {
|
|
2464
2461
|
const t = f((n) => n.eventEmitter);
|
|
2465
|
-
return
|
|
2462
|
+
return O(() => {
|
|
2466
2463
|
const n = (o) => e("timeUpdate", o);
|
|
2467
2464
|
return t.on("timeUpdate", n), () => {
|
|
2468
2465
|
t.off("timeUpdate", n);
|
|
@@ -2470,7 +2467,7 @@ function ci({ callback: e }) {
|
|
|
2470
2467
|
}, [e, t]), /* @__PURE__ */ s.jsx(zt, { callback: e });
|
|
2471
2468
|
}
|
|
2472
2469
|
function ui() {
|
|
2473
|
-
const e = f((i) => i.currentTime), t = f((i) => i.duration), n = f((i) => i.isPlaying), o = f((i) => i.pause), a = f((i) => i.play), l = f((i) => i.seek), u =
|
|
2470
|
+
const e = f((i) => i.currentTime), t = f((i) => i.duration), n = f((i) => i.isPlaying), o = f((i) => i.pause), a = f((i) => i.play), l = f((i) => i.seek), u = W(
|
|
2474
2471
|
(i) => {
|
|
2475
2472
|
let c = !1;
|
|
2476
2473
|
if (!(i.target instanceof HTMLInputElement || i.ctrlKey)) {
|
|
@@ -2490,7 +2487,7 @@ function ui() {
|
|
|
2490
2487
|
},
|
|
2491
2488
|
[e, t, n, o, a, l]
|
|
2492
2489
|
);
|
|
2493
|
-
return
|
|
2490
|
+
return O(() => (document.addEventListener("keydown", u), () => {
|
|
2494
2491
|
document.removeEventListener("keydown", u);
|
|
2495
2492
|
}), [u]), /* @__PURE__ */ s.jsx(qt, {});
|
|
2496
2493
|
}
|
|
@@ -2499,25 +2496,25 @@ function gi(e) {
|
|
|
2499
2496
|
}
|
|
2500
2497
|
function di({ url: e, messages: t, onEvent: n, startTime: o }) {
|
|
2501
2498
|
const a = f((u) => u.setStartTime), l = f((u) => u.containerRef);
|
|
2502
|
-
return
|
|
2499
|
+
return O(() => {
|
|
2503
2500
|
o && a(o);
|
|
2504
2501
|
}, [o, a]), /* @__PURE__ */ s.jsxs(
|
|
2505
2502
|
"div",
|
|
2506
2503
|
{
|
|
2507
2504
|
ref: l,
|
|
2508
|
-
className:
|
|
2505
|
+
className: z.playerContainer,
|
|
2509
2506
|
children: [
|
|
2510
2507
|
/* @__PURE__ */ s.jsx(Yt, { url: e, isLive: !1, messages: t }),
|
|
2511
2508
|
/* @__PURE__ */ s.jsx(Qt, {}),
|
|
2512
2509
|
/* @__PURE__ */ s.jsx(nn, {}),
|
|
2513
2510
|
/* @__PURE__ */ s.jsx(ni, {}),
|
|
2514
|
-
/* @__PURE__ */ s.jsx(tn, { children: /* @__PURE__ */ s.jsx("div", { className:
|
|
2511
|
+
/* @__PURE__ */ s.jsx(tn, { children: /* @__PURE__ */ s.jsx("div", { className: z.controlsBottom, children: /* @__PURE__ */ s.jsxs("div", { className: z.controlsContainer, children: [
|
|
2515
2512
|
/* @__PURE__ */ s.jsx(oi, {}),
|
|
2516
|
-
/* @__PURE__ */ s.jsxs("div", { className:
|
|
2513
|
+
/* @__PURE__ */ s.jsxs("div", { className: z.controlsRow, children: [
|
|
2517
2514
|
/* @__PURE__ */ s.jsxs(
|
|
2518
2515
|
"div",
|
|
2519
2516
|
{
|
|
2520
|
-
className: `${
|
|
2517
|
+
className: `${z.controlsSection} ${z.controlsSectionStart}`,
|
|
2521
2518
|
children: [
|
|
2522
2519
|
/* @__PURE__ */ s.jsx(ri, {}),
|
|
2523
2520
|
/* @__PURE__ */ s.jsx(an, {}),
|
|
@@ -2528,7 +2525,7 @@ function di({ url: e, messages: t, onEvent: n, startTime: o }) {
|
|
|
2528
2525
|
/* @__PURE__ */ s.jsxs(
|
|
2529
2526
|
"div",
|
|
2530
2527
|
{
|
|
2531
|
-
className: `${
|
|
2528
|
+
className: `${z.controlsSection} ${z.controlsSectionEnd}`,
|
|
2532
2529
|
children: [
|
|
2533
2530
|
/* @__PURE__ */ s.jsx(sn, {}),
|
|
2534
2531
|
/* @__PURE__ */ s.jsx(en, {})
|