@devix-technologies/react-gjirafa-vp-player 1.0.29 → 1.0.30
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/dist/config/vpPlayerConfig.d.ts +1 -1
- package/dist/constants/configs.d.ts +1 -1
- package/dist/contexts/VPPlayerContext.d.ts +1 -1
- package/dist/features/VPPlayer.d.ts +1 -1
- package/dist/features/stories/ads/Ads.stories.d.ts +2 -2
- package/dist/features/stories/context/Context.stories.d.ts +1 -1
- package/dist/features/stories/playback/Playback.stories.d.ts +2 -2
- package/dist/hooks/useVPPlayerEvents.d.ts +2 -2
- package/dist/hooks/useVPPlayerLogic.d.ts +1 -1
- package/dist/hooks/useVideoData.d.ts +1 -1
- package/dist/interfaces/props.d.ts +1 -1
- package/dist/react-gjirafa-vp-player.es.js +381 -245
- package/dist/react-gjirafa-vp-player.umd.js +5 -5
- package/dist/utils/vpPlayerConfigBuilder.d.ts +2 -2
- package/package.json +14 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as xe from "react";
|
|
2
|
-
import Nr, { forwardRef as Fr, useContext as Er, useState as de, useEffect as Se, useRef as K, useMemo as Pr, createContext as Dr, useCallback as
|
|
2
|
+
import Nr, { forwardRef as Fr, useContext as Er, useState as de, useEffect as Se, useRef as K, useMemo as Pr, createContext as Dr, useCallback as ur } from "react";
|
|
3
3
|
var Me = { exports: {} }, Oe = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
@@ -19,8 +19,8 @@ function Mr() {
|
|
|
19
19
|
var s = null;
|
|
20
20
|
if (t !== void 0 && (s = "" + t), a.key !== void 0 && (s = "" + a.key), "key" in a) {
|
|
21
21
|
t = {};
|
|
22
|
-
for (var
|
|
23
|
-
|
|
22
|
+
for (var c in a)
|
|
23
|
+
c !== "key" && (t[c] = a[c]);
|
|
24
24
|
} else t = a;
|
|
25
25
|
return a = t.ref, {
|
|
26
26
|
$$typeof: e,
|
|
@@ -79,7 +79,7 @@ function zr() {
|
|
|
79
79
|
return o = o.displayName, o || (o = l.displayName || l.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
80
80
|
case J:
|
|
81
81
|
return l = o.displayName || null, l !== null ? l : e(o.type) || "Memo";
|
|
82
|
-
case
|
|
82
|
+
case Y:
|
|
83
83
|
l = o._payload, o = o._init;
|
|
84
84
|
try {
|
|
85
85
|
return e(o(l));
|
|
@@ -110,7 +110,7 @@ function zr() {
|
|
|
110
110
|
}
|
|
111
111
|
function i(o) {
|
|
112
112
|
if (o === v) return "<>";
|
|
113
|
-
if (typeof o == "object" && o !== null && o.$$typeof ===
|
|
113
|
+
if (typeof o == "object" && o !== null && o.$$typeof === Y)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
116
116
|
var l = e(o);
|
|
@@ -120,7 +120,7 @@ function zr() {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function a() {
|
|
123
|
-
var o =
|
|
123
|
+
var o = S.A;
|
|
124
124
|
return o === null ? null : o.getOwner();
|
|
125
125
|
}
|
|
126
126
|
function t() {
|
|
@@ -133,7 +133,7 @@ function zr() {
|
|
|
133
133
|
}
|
|
134
134
|
return o.key !== void 0;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function c(o, l) {
|
|
137
137
|
function d() {
|
|
138
138
|
j || (j = !0, console.error(
|
|
139
139
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
@@ -184,11 +184,11 @@ function zr() {
|
|
|
184
184
|
value: fe
|
|
185
185
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function u(o, l, d, $, H, fe) {
|
|
188
188
|
var V = l.children;
|
|
189
189
|
if (V !== void 0)
|
|
190
190
|
if ($)
|
|
191
|
-
if (
|
|
191
|
+
if (U(V)) {
|
|
192
192
|
for ($ = 0; $ < V.length; $++)
|
|
193
193
|
p(V[$]);
|
|
194
194
|
Object.freeze && Object.freeze(V);
|
|
@@ -202,7 +202,7 @@ function zr() {
|
|
|
202
202
|
var ee = Object.keys(l).filter(function(ne) {
|
|
203
203
|
return ne !== "key";
|
|
204
204
|
});
|
|
205
|
-
$ = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
205
|
+
$ = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[V + $] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
@@ -213,14 +213,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
213
213
|
V,
|
|
214
214
|
ee,
|
|
215
215
|
V
|
|
216
|
-
),
|
|
216
|
+
), q[V + $] = !0);
|
|
217
217
|
}
|
|
218
218
|
if (V = null, d !== void 0 && (n(d), V = "" + d), s(l) && (n(l.key), V = "" + l.key), "key" in l) {
|
|
219
219
|
d = {};
|
|
220
220
|
for (var pe in l)
|
|
221
221
|
pe !== "key" && (d[pe] = l[pe]);
|
|
222
222
|
} else d = l;
|
|
223
|
-
return V &&
|
|
223
|
+
return V && c(
|
|
224
224
|
d,
|
|
225
225
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
226
226
|
), m(
|
|
@@ -233,12 +233,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
function p(o) {
|
|
236
|
-
x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof ===
|
|
236
|
+
x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === Y && (o._payload.status === "fulfilled" ? x(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
237
237
|
}
|
|
238
238
|
function x(o) {
|
|
239
239
|
return typeof o == "object" && o !== null && o.$$typeof === E;
|
|
240
240
|
}
|
|
241
|
-
var g = Nr, E = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), L = Symbol.for("react.consumer"), F = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), J = Symbol.for("react.memo"),
|
|
241
|
+
var g = Nr, E = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), L = Symbol.for("react.consumer"), F = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), J = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), S = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, U = Array.isArray, M = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
g = {
|
|
@@ -249,10 +249,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
249
249
|
var j, z = {}, O = g.react_stack_bottom_frame.bind(
|
|
250
250
|
g,
|
|
251
251
|
t
|
|
252
|
-
)(), Q = M(i(t)),
|
|
252
|
+
)(), Q = M(i(t)), q = {};
|
|
253
253
|
Ve.Fragment = v, Ve.jsx = function(o, l, d) {
|
|
254
|
-
var $ = 1e4 >
|
|
255
|
-
return
|
|
254
|
+
var $ = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return u(
|
|
256
256
|
o,
|
|
257
257
|
l,
|
|
258
258
|
d,
|
|
@@ -261,8 +261,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
261
261
|
$ ? M(i(o)) : Q
|
|
262
262
|
);
|
|
263
263
|
}, Ve.jsxs = function(o, l, d) {
|
|
264
|
-
var $ = 1e4 >
|
|
265
|
-
return
|
|
264
|
+
var $ = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return u(
|
|
266
266
|
o,
|
|
267
267
|
l,
|
|
268
268
|
d,
|
|
@@ -374,7 +374,7 @@ function Zr() {
|
|
|
374
374
|
function et() {
|
|
375
375
|
return X = le > 0 ? te(Ce, --le) : 0, Te--, X === 10 && (Te = 1, Ge--), X;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ue() {
|
|
378
378
|
return X = le < Tr ? te(Ce, le++) : 0, Te++, X === 10 && (Te = 1, Ge++), X;
|
|
379
379
|
}
|
|
380
380
|
function ye() {
|
|
@@ -435,16 +435,16 @@ function qe(e) {
|
|
|
435
435
|
}
|
|
436
436
|
function rt(e) {
|
|
437
437
|
for (; (X = ye()) && X < 33; )
|
|
438
|
-
|
|
438
|
+
ue();
|
|
439
439
|
return $e(e) > 2 || $e(X) > 3 ? "" : " ";
|
|
440
440
|
}
|
|
441
441
|
function tt(e, r) {
|
|
442
|
-
for (; --r &&
|
|
442
|
+
for (; --r && ue() && !(X < 48 || X > 102 || X > 57 && X < 65 || X > 70 && X < 97); )
|
|
443
443
|
;
|
|
444
|
-
return Fe(e, Ue() + (r < 6 && ye() == 32 &&
|
|
444
|
+
return Fe(e, Ue() + (r < 6 && ye() == 32 && ue() == 32));
|
|
445
445
|
}
|
|
446
446
|
function ir(e) {
|
|
447
|
-
for (;
|
|
447
|
+
for (; ue(); )
|
|
448
448
|
switch (X) {
|
|
449
449
|
// ] ) " '
|
|
450
450
|
case e:
|
|
@@ -460,28 +460,28 @@ function ir(e) {
|
|
|
460
460
|
break;
|
|
461
461
|
// \
|
|
462
462
|
case 92:
|
|
463
|
-
|
|
463
|
+
ue();
|
|
464
464
|
break;
|
|
465
465
|
}
|
|
466
466
|
return le;
|
|
467
467
|
}
|
|
468
468
|
function nt(e, r) {
|
|
469
|
-
for (;
|
|
469
|
+
for (; ue() && e + X !== 57; )
|
|
470
470
|
if (e + X === 84 && ye() === 47)
|
|
471
471
|
break;
|
|
472
|
-
return "/*" + Fe(r, le - 1) + "*" + He(e === 47 ? e :
|
|
472
|
+
return "/*" + Fe(r, le - 1) + "*" + He(e === 47 ? e : ue());
|
|
473
473
|
}
|
|
474
474
|
function it(e) {
|
|
475
475
|
for (; !$e(ye()); )
|
|
476
|
-
|
|
476
|
+
ue();
|
|
477
477
|
return Fe(e, le);
|
|
478
478
|
}
|
|
479
479
|
function at(e) {
|
|
480
480
|
return Cr(We("", null, null, null, [""], e = Ar(e), 0, [0], e));
|
|
481
481
|
}
|
|
482
|
-
function We(e, r, n, i, a, t, s,
|
|
483
|
-
for (var m = 0,
|
|
484
|
-
switch (E = b, b =
|
|
482
|
+
function We(e, r, n, i, a, t, s, c, f) {
|
|
483
|
+
for (var m = 0, u = 0, p = s, x = 0, g = 0, E = 0, h = 1, v = 1, w = 1, b = 0, L = "", F = a, k = t, I = i, _ = L; v; )
|
|
484
|
+
switch (E = b, b = ue()) {
|
|
485
485
|
// (
|
|
486
486
|
case 40:
|
|
487
487
|
if (E != 108 && te(_, p - 1) == 58) {
|
|
@@ -510,7 +510,7 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
510
510
|
switch (ye()) {
|
|
511
511
|
case 42:
|
|
512
512
|
case 47:
|
|
513
|
-
ze(ot(nt(
|
|
513
|
+
ze(ot(nt(ue(), Ue()), r, n), f);
|
|
514
514
|
break;
|
|
515
515
|
default:
|
|
516
516
|
_ += "/";
|
|
@@ -518,7 +518,7 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
518
518
|
break;
|
|
519
519
|
// {
|
|
520
520
|
case 123 * h:
|
|
521
|
-
|
|
521
|
+
c[m++] = he(_) * w;
|
|
522
522
|
// } ; \0
|
|
523
523
|
case 125 * h:
|
|
524
524
|
case 59:
|
|
@@ -529,7 +529,7 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
529
529
|
case 125:
|
|
530
530
|
v = 0;
|
|
531
531
|
// ;
|
|
532
|
-
case 59 +
|
|
532
|
+
case 59 + u:
|
|
533
533
|
w == -1 && (_ = C(_, /\f/g, "")), g > 0 && he(_) - p && ze(g > 32 ? mr(_ + ";", i, n, p - 1) : mr(C(_, " ", "") + ";", i, n, p - 2), f);
|
|
534
534
|
break;
|
|
535
535
|
// @ ;
|
|
@@ -537,9 +537,9 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
537
537
|
_ += ";";
|
|
538
538
|
// { rule/at-rule
|
|
539
539
|
default:
|
|
540
|
-
if (ze(I = hr(_, r, n, m,
|
|
541
|
-
if (
|
|
542
|
-
We(_, r, I, I, F, t, p,
|
|
540
|
+
if (ze(I = hr(_, r, n, m, u, a, c, L, F = [], k = [], p), t), b === 123)
|
|
541
|
+
if (u === 0)
|
|
542
|
+
We(_, r, I, I, F, t, p, c, k);
|
|
543
543
|
else
|
|
544
544
|
switch (x === 99 && te(_, 3) === 110 ? 100 : x) {
|
|
545
545
|
// d l m s
|
|
@@ -547,13 +547,13 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
547
547
|
case 108:
|
|
548
548
|
case 109:
|
|
549
549
|
case 115:
|
|
550
|
-
We(e, I, I, i && ze(hr(e, I, I, 0, 0, a,
|
|
550
|
+
We(e, I, I, i && ze(hr(e, I, I, 0, 0, a, c, L, a, F = [], p), k), a, k, p, c, i ? F : k);
|
|
551
551
|
break;
|
|
552
552
|
default:
|
|
553
|
-
We(_, I, I, I, [""], k, 0,
|
|
553
|
+
We(_, I, I, I, [""], k, 0, c, k);
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
m =
|
|
556
|
+
m = u = g = 0, h = w = 1, L = _ = "", p = s;
|
|
557
557
|
break;
|
|
558
558
|
// :
|
|
559
559
|
case 58:
|
|
@@ -568,15 +568,15 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
568
568
|
switch (_ += He(b), b * h) {
|
|
569
569
|
// &
|
|
570
570
|
case 38:
|
|
571
|
-
w =
|
|
571
|
+
w = u > 0 ? 1 : (_ += "\f", -1);
|
|
572
572
|
break;
|
|
573
573
|
// ,
|
|
574
574
|
case 44:
|
|
575
|
-
|
|
575
|
+
c[m++] = (he(_) - 1) * w, w = 1;
|
|
576
576
|
break;
|
|
577
577
|
// @
|
|
578
578
|
case 64:
|
|
579
|
-
ye() === 45 && (_ += qe(
|
|
579
|
+
ye() === 45 && (_ += qe(ue())), x = ye(), u = p = he(L = _ += it(Ue())), b++;
|
|
580
580
|
break;
|
|
581
581
|
// -
|
|
582
582
|
case 45:
|
|
@@ -585,11 +585,11 @@ function We(e, r, n, i, a, t, s, u, f) {
|
|
|
585
585
|
}
|
|
586
586
|
return t;
|
|
587
587
|
}
|
|
588
|
-
function hr(e, r, n, i, a, t, s,
|
|
588
|
+
function hr(e, r, n, i, a, t, s, c, f, m, u) {
|
|
589
589
|
for (var p = a - 1, x = a === 0 ? t : [""], g = lr(x), E = 0, h = 0, v = 0; E < i; ++E)
|
|
590
590
|
for (var w = 0, b = je(e, p + 1, p = Gr(h = s[E])), L = e; w < g; ++w)
|
|
591
591
|
(L = Rr(h > 0 ? x[w] + " " + b : C(b, /&\f/g, x[w]))) && (f[v++] = L);
|
|
592
|
-
return Xe(e, r, n, a === 0 ? or :
|
|
592
|
+
return Xe(e, r, n, a === 0 ? or : c, f, m, u);
|
|
593
593
|
}
|
|
594
594
|
function ot(e, r, n) {
|
|
595
595
|
return Xe(e, r, n, Ir, He(Zr()), je(e, 2, -2), 0);
|
|
@@ -621,12 +621,12 @@ function st(e, r, n, i) {
|
|
|
621
621
|
function lt(e) {
|
|
622
622
|
var r = lr(e);
|
|
623
623
|
return function(n, i, a, t) {
|
|
624
|
-
for (var s = "",
|
|
625
|
-
s += e[
|
|
624
|
+
for (var s = "", c = 0; c < r; c++)
|
|
625
|
+
s += e[c](n, i, a, t) || "";
|
|
626
626
|
return s;
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function ct(e) {
|
|
630
630
|
return function(r) {
|
|
631
631
|
r.root || (r = r.return) && e(r);
|
|
632
632
|
};
|
|
@@ -637,16 +637,16 @@ function kr(e) {
|
|
|
637
637
|
return r[n] === void 0 && (r[n] = e(n)), r[n];
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
|
-
var
|
|
640
|
+
var ut = function(r, n, i) {
|
|
641
641
|
for (var a = 0, t = 0; a = t, t = ye(), a === 38 && t === 12 && (n[i] = 1), !$e(t); )
|
|
642
|
-
|
|
642
|
+
ue();
|
|
643
643
|
return Fe(r, le);
|
|
644
644
|
}, dt = function(r, n) {
|
|
645
645
|
var i = -1, a = 44;
|
|
646
646
|
do
|
|
647
647
|
switch ($e(a)) {
|
|
648
648
|
case 0:
|
|
649
|
-
a === 38 && ye() === 12 && (n[i] = 1), r[i] +=
|
|
649
|
+
a === 38 && ye() === 12 && (n[i] = 1), r[i] += ut(le - 1, n, i);
|
|
650
650
|
break;
|
|
651
651
|
case 2:
|
|
652
652
|
r[i] += qe(a);
|
|
@@ -660,7 +660,7 @@ var ct = function(r, n, i) {
|
|
|
660
660
|
default:
|
|
661
661
|
r[i] += He(a);
|
|
662
662
|
}
|
|
663
|
-
while (a =
|
|
663
|
+
while (a = ue());
|
|
664
664
|
return r;
|
|
665
665
|
}, ft = function(r, n) {
|
|
666
666
|
return Cr(dt(Ar(r), n));
|
|
@@ -672,9 +672,9 @@ var ct = function(r, n, i) {
|
|
|
672
672
|
if (i = i.parent, !i) return;
|
|
673
673
|
if (!(r.props.length === 1 && n.charCodeAt(0) !== 58 && !yr.get(i)) && !a) {
|
|
674
674
|
yr.set(r, !0);
|
|
675
|
-
for (var t = [], s = ft(n, t),
|
|
676
|
-
for (var
|
|
677
|
-
r.props[m] = t[f] ? s[f].replace(/&\f/g, u
|
|
675
|
+
for (var t = [], s = ft(n, t), c = i.props, f = 0, m = 0; f < s.length; f++)
|
|
676
|
+
for (var u = 0; u < c.length; u++, m++)
|
|
677
|
+
r.props[m] = t[f] ? s[f].replace(/&\f/g, c[u]) : c[u] + " " + s[f];
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
}, ht = function(r) {
|
|
@@ -867,7 +867,7 @@ var mt = function(r, n, i, a) {
|
|
|
867
867
|
v.indexOf(" ") !== -1 && (document.head.appendChild(h), h.setAttribute("data-s", ""));
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
var a = r.stylisPlugins || yt, t = {}, s,
|
|
870
|
+
var a = r.stylisPlugins || yt, t = {}, s, c = [];
|
|
871
871
|
s = r.container || document.head, Array.prototype.forEach.call(
|
|
872
872
|
// this means we will ignore elements which don't have a space in them which
|
|
873
873
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
@@ -875,18 +875,18 @@ var mt = function(r, n, i, a) {
|
|
|
875
875
|
function(h) {
|
|
876
876
|
for (var v = h.getAttribute("data-emotion").split(" "), w = 1; w < v.length; w++)
|
|
877
877
|
t[v[w]] = !0;
|
|
878
|
-
|
|
878
|
+
c.push(h);
|
|
879
879
|
}
|
|
880
880
|
);
|
|
881
881
|
var f, m = [pt, ht];
|
|
882
882
|
{
|
|
883
|
-
var
|
|
884
|
-
|
|
883
|
+
var u, p = [st, ct(function(h) {
|
|
884
|
+
u.insert(h);
|
|
885
885
|
})], x = lt(m.concat(a, p)), g = function(v) {
|
|
886
886
|
return Re(at(v), x);
|
|
887
887
|
};
|
|
888
888
|
f = function(v, w, b, L) {
|
|
889
|
-
|
|
889
|
+
u = b, g(v ? v + "{" + w.styles + "}" : w.styles), L && (E.inserted[w.name] = !0);
|
|
890
890
|
};
|
|
891
891
|
}
|
|
892
892
|
var E = {
|
|
@@ -904,7 +904,7 @@ var mt = function(r, n, i, a) {
|
|
|
904
904
|
registered: {},
|
|
905
905
|
insert: f
|
|
906
906
|
};
|
|
907
|
-
return E.sheet.hydrate(
|
|
907
|
+
return E.sheet.hydrate(c), E;
|
|
908
908
|
}, gt = !0;
|
|
909
909
|
function xt(e, r, n) {
|
|
910
910
|
var i = "";
|
|
@@ -1050,8 +1050,8 @@ function Ne(e, r, n) {
|
|
|
1050
1050
|
styles: s.styles,
|
|
1051
1051
|
next: me
|
|
1052
1052
|
}, s = s.next;
|
|
1053
|
-
var
|
|
1054
|
-
return
|
|
1053
|
+
var c = t.styles + ";";
|
|
1054
|
+
return c;
|
|
1055
1055
|
}
|
|
1056
1056
|
return It(e, r, n);
|
|
1057
1057
|
}
|
|
@@ -1063,11 +1063,11 @@ function Ne(e, r, n) {
|
|
|
1063
1063
|
break;
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
var
|
|
1066
|
+
var u = n;
|
|
1067
1067
|
if (r == null)
|
|
1068
|
-
return
|
|
1069
|
-
var p = r[
|
|
1070
|
-
return p !== void 0 ? p :
|
|
1068
|
+
return u;
|
|
1069
|
+
var p = r[u];
|
|
1070
|
+
return p !== void 0 ? p : u;
|
|
1071
1071
|
}
|
|
1072
1072
|
function It(e, r, n) {
|
|
1073
1073
|
var i = "";
|
|
@@ -1078,8 +1078,8 @@ function It(e, r, n) {
|
|
|
1078
1078
|
for (var t in n) {
|
|
1079
1079
|
var s = n[t];
|
|
1080
1080
|
if (typeof s != "object") {
|
|
1081
|
-
var
|
|
1082
|
-
r != null && r[
|
|
1081
|
+
var c = s;
|
|
1082
|
+
r != null && r[c] !== void 0 ? i += t + "{" + r[c] + "}" : vr(c) && (i += Ke(t) + ":" + gr(t, c) + ";");
|
|
1083
1083
|
} else if (Array.isArray(s) && typeof s[0] == "string" && (r == null || r[s[0]] === void 0))
|
|
1084
1084
|
for (var f = 0; f < s.length; f++)
|
|
1085
1085
|
vr(s[f]) && (i += Ke(t) + ":" + gr(t, s[f]) + ";");
|
|
@@ -1111,14 +1111,14 @@ function St(e, r, n) {
|
|
|
1111
1111
|
var s = t;
|
|
1112
1112
|
a += s[0];
|
|
1113
1113
|
}
|
|
1114
|
-
for (var
|
|
1115
|
-
if (a += Ne(n, r, e[
|
|
1114
|
+
for (var c = 1; c < e.length; c++)
|
|
1115
|
+
if (a += Ne(n, r, e[c]), i) {
|
|
1116
1116
|
var f = t;
|
|
1117
|
-
a += f[
|
|
1117
|
+
a += f[c];
|
|
1118
1118
|
}
|
|
1119
1119
|
xr.lastIndex = 0;
|
|
1120
|
-
for (var m = "",
|
|
1121
|
-
m += "-" +
|
|
1120
|
+
for (var m = "", u; (u = xr.exec(a)) !== null; )
|
|
1121
|
+
m += "-" + u[1];
|
|
1122
1122
|
var p = bt(a) + m;
|
|
1123
1123
|
return {
|
|
1124
1124
|
name: p,
|
|
@@ -1174,16 +1174,16 @@ var Ct = function(r) {
|
|
|
1174
1174
|
}, Nt = function e(r, n) {
|
|
1175
1175
|
var i = r.__emotion_real === r, a = i && r.__emotion_base || r, t, s;
|
|
1176
1176
|
n !== void 0 && (t = n.label, s = n.target);
|
|
1177
|
-
var
|
|
1177
|
+
var c = br(r, n, i), f = c || wr(a), m = !f("as");
|
|
1178
1178
|
return function() {
|
|
1179
|
-
var
|
|
1180
|
-
if (t !== void 0 && p.push("label:" + t + ";"),
|
|
1181
|
-
p.push.apply(p,
|
|
1179
|
+
var u = arguments, p = i && r.__emotion_styles !== void 0 ? r.__emotion_styles.slice(0) : [];
|
|
1180
|
+
if (t !== void 0 && p.push("label:" + t + ";"), u[0] == null || u[0].raw === void 0)
|
|
1181
|
+
p.push.apply(p, u);
|
|
1182
1182
|
else {
|
|
1183
|
-
var x =
|
|
1183
|
+
var x = u[0];
|
|
1184
1184
|
p.push(x[0]);
|
|
1185
|
-
for (var g =
|
|
1186
|
-
p.push(
|
|
1185
|
+
for (var g = u.length, E = 1; E < g; E++)
|
|
1186
|
+
p.push(u[E], x[E]);
|
|
1187
1187
|
}
|
|
1188
1188
|
var h = Ct(function(v, w, b) {
|
|
1189
1189
|
var L = m && v.as || a, F = "", k = [], I = v;
|
|
@@ -1196,16 +1196,16 @@ var Ct = function(r) {
|
|
|
1196
1196
|
typeof v.className == "string" ? F = xt(w.registered, k, v.className) : v.className != null && (F = v.className + " ");
|
|
1197
1197
|
var J = St(p.concat(k), w.registered, I);
|
|
1198
1198
|
F += w.key + "-" + J.name, s !== void 0 && (F += " " + s);
|
|
1199
|
-
var
|
|
1199
|
+
var Y = m && c === void 0 ? wr(L) : f, P = {};
|
|
1200
1200
|
for (var y in v)
|
|
1201
|
-
m && y === "as" ||
|
|
1201
|
+
m && y === "as" || Y(y) && (P[y] = v[y]);
|
|
1202
1202
|
return P.className = F, b && (P.ref = b), /* @__PURE__ */ xe.createElement(xe.Fragment, null, /* @__PURE__ */ xe.createElement($t, {
|
|
1203
1203
|
cache: w,
|
|
1204
1204
|
serialized: J,
|
|
1205
1205
|
isStringTag: typeof L == "string"
|
|
1206
1206
|
}), /* @__PURE__ */ xe.createElement(L, P));
|
|
1207
1207
|
});
|
|
1208
|
-
return h.displayName = t !== void 0 ? t : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", h.defaultProps = r.defaultProps, h.__emotion_real = h, h.__emotion_base = a, h.__emotion_styles = p, h.__emotion_forwardProp =
|
|
1208
|
+
return h.displayName = t !== void 0 ? t : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", h.defaultProps = r.defaultProps, h.__emotion_real = h, h.__emotion_base = a, h.__emotion_styles = p, h.__emotion_forwardProp = c, Object.defineProperty(h, "toString", {
|
|
1209
1209
|
value: function() {
|
|
1210
1210
|
return "." + s;
|
|
1211
1211
|
}
|
|
@@ -1397,7 +1397,11 @@ const Dt = Ae.div`
|
|
|
1397
1397
|
return "";
|
|
1398
1398
|
}
|
|
1399
1399
|
}}
|
|
1400
|
-
`, ar = ({ type: e, children: r, className: n, icon: i, action: a }) => Z.jsxs(Dt, { type: e, className: n, children: [
|
|
1400
|
+
`, ar = ({ type: e, children: r, className: n, icon: i, action: a }) => /* @__PURE__ */ Z.jsxs(Dt, { type: e, className: n, children: [
|
|
1401
|
+
i && /* @__PURE__ */ Z.jsx("span", { children: i }),
|
|
1402
|
+
/* @__PURE__ */ Z.jsx("span", { children: r }),
|
|
1403
|
+
a && /* @__PURE__ */ Z.jsx("span", { children: a })
|
|
1404
|
+
] }), _r = Ae.div`
|
|
1401
1405
|
width: ${({ width: e }) => e || "100%"};
|
|
1402
1406
|
height: ${({ height: e }) => e || "100%"};
|
|
1403
1407
|
border-radius: 0px !important; /* Force remove rounded corners on container */
|
|
@@ -1428,46 +1432,51 @@ const Dt = Ae.div`
|
|
|
1428
1432
|
height: auto;
|
|
1429
1433
|
z-index: 1001;
|
|
1430
1434
|
max-height: 100vh;
|
|
1431
|
-
`, Bt = (e, r) => `https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${r}`, Ut = (e) => `https://host.vpplayer.tech/playlist/${e}`, qt = (e) => `https://host.vpplayer.tech/player/${e}/vpplayer.js`,
|
|
1435
|
+
`, Bt = (e, r) => `https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${r}`, Ut = (e) => `https://host.vpplayer.tech/playlist/${e}`, qt = (e) => `https://host.vpplayer.tech/player/${e}/vpplayer.js`, cr = (e, r) => `vp-player-${e || "default"}-${r || ""}`, Ze = /* @__PURE__ */ new Map(), Wt = (e, r) => {
|
|
1432
1436
|
const [n, i] = de(!1), [a, t] = de(null);
|
|
1433
1437
|
return Se(() => {
|
|
1434
|
-
let s = null,
|
|
1438
|
+
let s = null, c, f = 0;
|
|
1435
1439
|
const m = 3;
|
|
1436
|
-
let
|
|
1440
|
+
let u;
|
|
1437
1441
|
try {
|
|
1438
|
-
|
|
1442
|
+
u = r || qt(e || "latest");
|
|
1439
1443
|
} catch (g) {
|
|
1440
1444
|
const E = g instanceof Error ? g.message : String(g);
|
|
1441
1445
|
t(`Failed to resolve script URL: ${E}`), i(!1);
|
|
1442
1446
|
return;
|
|
1443
1447
|
}
|
|
1444
|
-
if (Ze.get(
|
|
1448
|
+
if (Ze.get(u)) {
|
|
1445
1449
|
i(!0), t(null);
|
|
1446
1450
|
return;
|
|
1447
1451
|
}
|
|
1448
|
-
if (document.querySelector(`script[src="${
|
|
1449
|
-
Ze.set(
|
|
1452
|
+
if (document.querySelector(`script[src="${u}"]`)) {
|
|
1453
|
+
Ze.set(u, !0), i(!0), t(null);
|
|
1450
1454
|
return;
|
|
1451
1455
|
}
|
|
1452
1456
|
const x = () => {
|
|
1453
|
-
s = document.createElement("script"), s.src =
|
|
1454
|
-
i(!1), t(`Loading script timed out: ${
|
|
1457
|
+
s = document.createElement("script"), s.src = u, s.async = !0, c = window.setTimeout(() => {
|
|
1458
|
+
i(!1), t(`Loading script timed out: ${u}`);
|
|
1455
1459
|
}, 1e4), s.onload = () => {
|
|
1456
|
-
clearTimeout(
|
|
1460
|
+
clearTimeout(c), Ze.set(u, !0), i(!0), t(null);
|
|
1457
1461
|
}, s.onerror = () => {
|
|
1458
|
-
clearTimeout(
|
|
1462
|
+
clearTimeout(c), f++, f < m ? setTimeout(x, 1e3 * f) : (i(!1), t(`Failed to load VP Player script after ${m} attempts: ${u}`));
|
|
1459
1463
|
}, document.body.appendChild(s);
|
|
1460
1464
|
};
|
|
1461
1465
|
return x(), () => {
|
|
1462
|
-
clearTimeout(
|
|
1466
|
+
clearTimeout(c), s && document.body.contains(s) && document.body.removeChild(s);
|
|
1463
1467
|
};
|
|
1464
1468
|
}, [e, r]), { isLoaded: n, error: a };
|
|
1465
|
-
}, Be = /* @__PURE__ */ new Map(), Yt = 3e4, er = 5, Ht = ({
|
|
1466
|
-
|
|
1469
|
+
}, Be = /* @__PURE__ */ new Map(), Yt = 3e4, er = 5, Ht = ({
|
|
1470
|
+
projectId: e,
|
|
1471
|
+
videoId: r,
|
|
1472
|
+
playlistId: n,
|
|
1473
|
+
videoUrl: i
|
|
1474
|
+
}) => {
|
|
1475
|
+
const [a, t] = de(null), [s, c] = de(null), [f, m] = de(!1), [u, p] = de(null);
|
|
1467
1476
|
return Se(() => {
|
|
1468
1477
|
const x = r ? `video:${r}` : n ? `playlist:${n}` : null;
|
|
1469
1478
|
if (i || !r && !n) {
|
|
1470
|
-
t(i || null),
|
|
1479
|
+
t(i || null), c(null), m(!1), p(null);
|
|
1471
1480
|
return;
|
|
1472
1481
|
}
|
|
1473
1482
|
if (r && !e) {
|
|
@@ -1476,7 +1485,7 @@ const Dt = Ae.div`
|
|
|
1476
1485
|
}
|
|
1477
1486
|
if (x && Be.has(x)) {
|
|
1478
1487
|
const b = Be.get(x);
|
|
1479
|
-
t(b.url),
|
|
1488
|
+
t(b.url), c(b.playlist), m(!1), p(null);
|
|
1480
1489
|
return;
|
|
1481
1490
|
}
|
|
1482
1491
|
let g = !0;
|
|
@@ -1498,19 +1507,18 @@ const Dt = Ae.div`
|
|
|
1498
1507
|
});
|
|
1499
1508
|
if (clearTimeout(I), !J.ok)
|
|
1500
1509
|
throw new Error(`Fetch failed with status ${J.status}`);
|
|
1501
|
-
const
|
|
1510
|
+
const Y = await J.json();
|
|
1502
1511
|
if (!g)
|
|
1503
1512
|
return;
|
|
1504
1513
|
if (r && !n) {
|
|
1505
|
-
const P = (F = (L =
|
|
1506
|
-
if (!(P != null && P.playbackUrl))
|
|
1507
|
-
|
|
1508
|
-
t(P.playbackUrl), u(null), x && Be.set(x, { url: P.playbackUrl, playlist: null });
|
|
1514
|
+
const P = (F = (L = Y.result) == null ? void 0 : L.items) == null ? void 0 : F.find((y) => y.mediaId === r);
|
|
1515
|
+
if (!(P != null && P.playbackUrl)) throw new Error("Invalid video data");
|
|
1516
|
+
t(P.playbackUrl), c(null), x && Be.set(x, { url: P.playbackUrl, playlist: null });
|
|
1509
1517
|
} else {
|
|
1510
|
-
const P =
|
|
1518
|
+
const P = Y.videos;
|
|
1511
1519
|
if (!Array.isArray(P))
|
|
1512
1520
|
throw new Error("Invalid playlist format");
|
|
1513
|
-
|
|
1521
|
+
c(P), t(null), x && Be.set(x, { url: null, playlist: P });
|
|
1514
1522
|
}
|
|
1515
1523
|
break;
|
|
1516
1524
|
} catch (k) {
|
|
@@ -1529,21 +1537,27 @@ const Dt = Ae.div`
|
|
|
1529
1537
|
return () => {
|
|
1530
1538
|
g = !1, clearTimeout(w), E.abort();
|
|
1531
1539
|
};
|
|
1532
|
-
}, [e, r, n, i]), { fetchedPlaybackUrl: a, fetchedPlaylist: s, isLoading: f, error:
|
|
1533
|
-
}, Gt = ({
|
|
1534
|
-
|
|
1540
|
+
}, [e, r, n, i]), { fetchedPlaybackUrl: a, fetchedPlaylist: s, isLoading: f, error: u };
|
|
1541
|
+
}, Gt = ({
|
|
1542
|
+
playerId: e,
|
|
1543
|
+
playerInstanceRef: r,
|
|
1544
|
+
playerRef: n,
|
|
1545
|
+
videoData: i,
|
|
1546
|
+
trackingMetadata: a,
|
|
1547
|
+
callbacks: t
|
|
1548
|
+
}) => {
|
|
1549
|
+
const s = K(!1), c = K(!1), f = K(!1), m = K(0), u = K({}), p = K(null), x = K(null), g = K(null), E = K(null), h = K(!1), v = K(!1);
|
|
1535
1550
|
Se(() => {
|
|
1536
1551
|
if (!(t && (t.onPlayerStart || t.onPlayerPlay || t.onPlayerPause || t.onPlayerResume || t.onPlayerEnd || t.onPlayerProgressEvery10Seconds || t.onPlayerProgressAt20Seconds || t.onPlayerQuartile25 || t.onPlayerQuartile50 || t.onPlayerQuartile75 || t.onPlayerNext || t.onPlayerPrevious || t.onPlayerEvent)))
|
|
1537
1552
|
return;
|
|
1538
1553
|
const b = () => {
|
|
1539
|
-
s.current = !1,
|
|
1554
|
+
s.current = !1, c.current = !1, f.current = !1, m.current = 0, u.current = {};
|
|
1540
1555
|
}, L = () => {
|
|
1541
1556
|
var B;
|
|
1542
1557
|
const y = document.getElementById(e);
|
|
1543
|
-
if (!y)
|
|
1544
|
-
return null;
|
|
1558
|
+
if (!y) return null;
|
|
1545
1559
|
if (y.querySelectorAll("video").length > 1 && r.current) {
|
|
1546
|
-
const
|
|
1560
|
+
const U = r.current, M = U.videoIndex ?? ((B = U.playlist) == null ? void 0 : B.playlistVideoIndex) ?? 0, j = y.querySelector(`video[id="${M}"]`);
|
|
1547
1561
|
if (j)
|
|
1548
1562
|
return j;
|
|
1549
1563
|
const z = y.querySelector("video.active");
|
|
@@ -1555,8 +1569,8 @@ const Dt = Ae.div`
|
|
|
1555
1569
|
const y = L();
|
|
1556
1570
|
if (!y)
|
|
1557
1571
|
return !1;
|
|
1558
|
-
const
|
|
1559
|
-
var H, fe, V, ee, pe, ne, _e, De,
|
|
1572
|
+
const S = (l, d) => {
|
|
1573
|
+
var H, fe, V, ee, pe, ne, _e, De, ce, we, ve, Je, Qe, ke;
|
|
1560
1574
|
const $ = Date.now();
|
|
1561
1575
|
if (!(l === "player_start" && s.current)) {
|
|
1562
1576
|
switch (E.current = { type: l, time: $ }, l) {
|
|
@@ -1585,7 +1599,7 @@ const Dt = Ae.div`
|
|
|
1585
1599
|
d !== void 0 && ((De = t.onPlayerQuartile25) == null || De.call(t, l, d));
|
|
1586
1600
|
break;
|
|
1587
1601
|
case "player_quartile_50":
|
|
1588
|
-
d !== void 0 && ((
|
|
1602
|
+
d !== void 0 && ((ce = t.onPlayerQuartile50) == null || ce.call(t, l, d));
|
|
1589
1603
|
break;
|
|
1590
1604
|
case "player_quartile_75":
|
|
1591
1605
|
d !== void 0 && ((we = t.onPlayerQuartile75) == null || we.call(t, l, d));
|
|
@@ -1599,10 +1613,10 @@ const Dt = Ae.div`
|
|
|
1599
1613
|
}
|
|
1600
1614
|
d !== void 0 && (l === "player_progress_every_10_seconds" || l === "player_progress_at_20_seconds" || l === "player_quartile_25" || l === "player_quartile_50" || l === "player_quartile_75") ? (Qe = t.onPlayerEvent) == null || Qe.call(t, l, d) : (ke = t.onPlayerEvent) == null || ke.call(t, l);
|
|
1601
1615
|
}
|
|
1602
|
-
}, B = () => L() === y,
|
|
1603
|
-
h.current || B() && (s.current || (
|
|
1616
|
+
}, B = () => L() === y, U = () => {
|
|
1617
|
+
h.current || B() && (s.current || (S("player_start"), s.current = !0));
|
|
1604
1618
|
}, M = () => {
|
|
1605
|
-
h.current || B() && (f.current ?
|
|
1619
|
+
h.current || B() && (s.current || (S("player_start"), s.current = !0), f.current ? S("player_resume") : c.current && v.current ? (S("player_play"), v.current = !1) : c.current || (S("player_play"), c.current = !0), f.current = !1);
|
|
1606
1620
|
}, j = () => {
|
|
1607
1621
|
y.ended || h.current || setTimeout(() => {
|
|
1608
1622
|
var l;
|
|
@@ -1612,49 +1626,47 @@ const Dt = Ae.div`
|
|
|
1612
1626
|
if ((d.videoIndex ?? ((l = d.playlist) == null ? void 0 : l.playlistVideoIndex) ?? 0) !== x.current)
|
|
1613
1627
|
return;
|
|
1614
1628
|
}
|
|
1615
|
-
|
|
1629
|
+
S("player_pause"), f.current = !0;
|
|
1616
1630
|
}
|
|
1617
1631
|
}, 200);
|
|
1618
1632
|
}, z = () => {
|
|
1619
|
-
|
|
1633
|
+
S("player_end");
|
|
1620
1634
|
}, O = () => {
|
|
1621
|
-
if (h.current)
|
|
1622
|
-
return;
|
|
1635
|
+
if (h.current) return;
|
|
1623
1636
|
const l = y.duration > 0 ? y.currentTime / y.duration * 100 : 0, d = Math.floor(y.currentTime);
|
|
1624
|
-
d - m.current >= 10 && (m.current = d,
|
|
1637
|
+
d - m.current >= 10 && (m.current = d, S("player_progress_every_10_seconds", d)), d >= 20 && !u.current[20] && (u.current[20] = !0, S("player_progress_at_20_seconds", d)), l >= 25 && !u.current[25] && (u.current[25] = !0, S("player_quartile_25", d)), l >= 50 && !u.current[50] && (u.current[50] = !0, S("player_quartile_50", d)), l >= 75 && !u.current[75] && (u.current[75] = !0, S("player_quartile_75", d));
|
|
1625
1638
|
}, Q = () => {
|
|
1626
1639
|
v.current = !0;
|
|
1627
1640
|
};
|
|
1628
1641
|
if (g.current && g.current !== y) {
|
|
1629
1642
|
const l = g.current;
|
|
1630
|
-
l.removeEventListener("loadedmetadata",
|
|
1643
|
+
l.removeEventListener("loadedmetadata", U), l.removeEventListener("play", M), l.removeEventListener("pause", j), l.removeEventListener("ended", z), l.removeEventListener("timeupdate", O), l.removeEventListener("seeking", Q);
|
|
1631
1644
|
}
|
|
1632
|
-
g.current = y, y.addEventListener("loadedmetadata",
|
|
1633
|
-
const
|
|
1645
|
+
g.current = y, y.addEventListener("loadedmetadata", U), y.addEventListener("play", M), y.addEventListener("pause", j), y.addEventListener("ended", z), y.addEventListener("timeupdate", O), y.addEventListener("seeking", Q), y.readyState >= 1 && U(), !y.paused && y.currentTime > 0 && !c.current && (s.current || U(), M());
|
|
1646
|
+
const q = document.getElementById(e), o = (l) => {
|
|
1634
1647
|
const d = l.target;
|
|
1635
|
-
(d.closest(".vp-next") || d.closest(".vrt-icon-down") || d.closest(".vrt-arrow.vrt-icon-down")) && (h.current = !0,
|
|
1648
|
+
(d.closest(".vp-next") || d.closest(".vrt-icon-down") || d.closest(".vrt-arrow.vrt-icon-down")) && (h.current = !0, S("player_next"), b(), setTimeout(() => {
|
|
1636
1649
|
h.current = !1;
|
|
1637
|
-
}, 500)), (d.closest(".vp-prev") || d.closest(".vp-previous") || d.closest(".vrt-icon-up") || d.closest(".vrt-arrow.vrt-icon-up")) && (h.current = !0,
|
|
1650
|
+
}, 500)), (d.closest(".vp-prev") || d.closest(".vp-previous") || d.closest(".vrt-icon-up") || d.closest(".vrt-arrow.vrt-icon-up")) && (h.current = !0, S("player_previous"), b(), setTimeout(() => {
|
|
1638
1651
|
h.current = !1;
|
|
1639
1652
|
}, 500));
|
|
1640
1653
|
};
|
|
1641
|
-
return
|
|
1654
|
+
return q && q.addEventListener("click", o, !0), p.current = () => {
|
|
1642
1655
|
const l = g.current || y;
|
|
1643
|
-
l.removeEventListener("loadedmetadata",
|
|
1656
|
+
l.removeEventListener("loadedmetadata", U), l.removeEventListener("play", M), l.removeEventListener("pause", j), l.removeEventListener("ended", z), l.removeEventListener("timeupdate", O), l.removeEventListener("seeking", Q), q == null || q.removeEventListener("click", o, !0), g.current = null;
|
|
1644
1657
|
}, !0;
|
|
1645
1658
|
};
|
|
1646
1659
|
let k = null, I = !1;
|
|
1647
1660
|
const _ = () => {
|
|
1648
|
-
if (!r.current)
|
|
1649
|
-
|
|
1650
|
-
const y = r.current, R = document.getElementById(e), B = R == null ? void 0 : R.querySelectorAll("video");
|
|
1661
|
+
if (!r.current) return;
|
|
1662
|
+
const y = r.current, S = document.getElementById(e), B = S == null ? void 0 : S.querySelectorAll("video");
|
|
1651
1663
|
B && B.length > 1 && y.videoIndex !== void 0 && (k = window.setInterval(() => {
|
|
1652
1664
|
var M, j, z, O;
|
|
1653
1665
|
try {
|
|
1654
1666
|
const Q = y.videoIndex ?? ((M = y.playlist) == null ? void 0 : M.playlistVideoIndex) ?? 0;
|
|
1655
1667
|
if (x.current !== null && Q !== x.current) {
|
|
1656
|
-
const
|
|
1657
|
-
t && !h.current && (
|
|
1668
|
+
const q = Q > x.current, o = q ? "player_next" : "player_previous";
|
|
1669
|
+
t && !h.current && (q ? (j = t.onPlayerNext) == null || j.call(t, o) : (z = t.onPlayerPrevious) == null || z.call(t, o), (O = t.onPlayerEvent) == null || O.call(t, o)), h.current = !0, p.current && (p.current(), p.current = null), s.current = !1, c.current = !1, f.current = !1, m.current = 0, u.current = {}, g.current = null, v.current = !1, setTimeout(() => {
|
|
1658
1670
|
F(), setTimeout(() => {
|
|
1659
1671
|
h.current = !1;
|
|
1660
1672
|
}, 200);
|
|
@@ -1666,10 +1678,10 @@ const Dt = Ae.div`
|
|
|
1666
1678
|
}, 500));
|
|
1667
1679
|
};
|
|
1668
1680
|
let J = 0;
|
|
1669
|
-
const
|
|
1681
|
+
const Y = 20, P = setInterval(() => {
|
|
1670
1682
|
J++, F() && !I ? (I = !0, clearInterval(P), setTimeout(() => {
|
|
1671
1683
|
_();
|
|
1672
|
-
}, 1e3)) : J >=
|
|
1684
|
+
}, 1e3)) : J >= Y && clearInterval(P);
|
|
1673
1685
|
}, 500);
|
|
1674
1686
|
return () => {
|
|
1675
1687
|
clearInterval(P), k !== null && (clearInterval(k), k = null), p.current && (p.current(), p.current = null);
|
|
@@ -1745,8 +1757,8 @@ const Dt = Ae.div`
|
|
|
1745
1757
|
isVerticalPlayer: t
|
|
1746
1758
|
// Distinguish between VP Player types
|
|
1747
1759
|
}) => {
|
|
1748
|
-
var
|
|
1749
|
-
const s = { ...Xt, ...a },
|
|
1760
|
+
var u, p, x, g, E, h, v, w, b, L, F, k, I, _, J, Y, P, y, S, B, U, M;
|
|
1761
|
+
const s = { ...Xt, ...a }, c = { ...s.config, ...a.config };
|
|
1750
1762
|
if (e)
|
|
1751
1763
|
return {
|
|
1752
1764
|
...s,
|
|
@@ -1756,7 +1768,7 @@ const Dt = Ae.div`
|
|
|
1756
1768
|
file: e,
|
|
1757
1769
|
playlist: void 0
|
|
1758
1770
|
},
|
|
1759
|
-
config:
|
|
1771
|
+
config: c
|
|
1760
1772
|
};
|
|
1761
1773
|
if (r)
|
|
1762
1774
|
return {
|
|
@@ -1767,10 +1779,10 @@ const Dt = Ae.div`
|
|
|
1767
1779
|
file: r,
|
|
1768
1780
|
playlist: void 0
|
|
1769
1781
|
},
|
|
1770
|
-
config:
|
|
1782
|
+
config: c
|
|
1771
1783
|
};
|
|
1772
1784
|
if (n && n.length > 0) {
|
|
1773
|
-
const j = ((p = (
|
|
1785
|
+
const j = ((p = (u = a == null ? void 0 : a.video) == null ? void 0 : u.playlist) == null ? void 0 : p.playlistVideoIndex) ?? ((x = a == null ? void 0 : a.config) == null ? void 0 : x.playlistVideoIndex) ?? 0;
|
|
1774
1786
|
return t ? {
|
|
1775
1787
|
...s,
|
|
1776
1788
|
projectId: i || Ie,
|
|
@@ -1799,7 +1811,7 @@ const Dt = Ae.div`
|
|
|
1799
1811
|
}))
|
|
1800
1812
|
}
|
|
1801
1813
|
},
|
|
1802
|
-
config:
|
|
1814
|
+
config: c
|
|
1803
1815
|
} : {
|
|
1804
1816
|
...s,
|
|
1805
1817
|
projectId: i || Ie,
|
|
@@ -1824,10 +1836,10 @@ const Dt = Ae.div`
|
|
|
1824
1836
|
}))
|
|
1825
1837
|
}
|
|
1826
1838
|
},
|
|
1827
|
-
config:
|
|
1839
|
+
config: c
|
|
1828
1840
|
};
|
|
1829
1841
|
}
|
|
1830
|
-
const f = ((J = a == null ? void 0 : a.video) == null ? void 0 : J.playlist) || s.video.playlist, m = (
|
|
1842
|
+
const f = ((J = a == null ? void 0 : a.video) == null ? void 0 : J.playlist) || s.video.playlist, m = (Y = a == null ? void 0 : a.video) == null ? void 0 : Y.file;
|
|
1831
1843
|
if (m)
|
|
1832
1844
|
return {
|
|
1833
1845
|
...s,
|
|
@@ -1838,17 +1850,17 @@ const Dt = Ae.div`
|
|
|
1838
1850
|
playlist: void 0
|
|
1839
1851
|
// No playlist, just one video
|
|
1840
1852
|
},
|
|
1841
|
-
config:
|
|
1853
|
+
config: c
|
|
1842
1854
|
};
|
|
1843
1855
|
if (f != null && f.videos && f.videos.length > 0) {
|
|
1844
|
-
const j = ((y = (P = a == null ? void 0 : a.video) == null ? void 0 : P.playlist) == null ? void 0 : y.playlistVideoIndex) ?? ((
|
|
1856
|
+
const j = ((y = (P = a == null ? void 0 : a.video) == null ? void 0 : P.playlist) == null ? void 0 : y.playlistVideoIndex) ?? ((S = a == null ? void 0 : a.config) == null ? void 0 : S.playlistVideoIndex) ?? 0;
|
|
1845
1857
|
return {
|
|
1846
1858
|
...s,
|
|
1847
1859
|
projectId: i || Ie,
|
|
1848
1860
|
video: {
|
|
1849
1861
|
...s.video,
|
|
1850
1862
|
videoId: (B = f.videos[0]) == null ? void 0 : B.videoId,
|
|
1851
|
-
file: ((
|
|
1863
|
+
file: ((U = f.videos[0]) == null ? void 0 : U.file) || "",
|
|
1852
1864
|
title: (M = f.videos[0]) == null ? void 0 : M.title,
|
|
1853
1865
|
playlist: {
|
|
1854
1866
|
state: !0,
|
|
@@ -1857,28 +1869,63 @@ const Dt = Ae.div`
|
|
|
1857
1869
|
videos: f.videos
|
|
1858
1870
|
}
|
|
1859
1871
|
},
|
|
1860
|
-
config:
|
|
1872
|
+
config: c
|
|
1861
1873
|
};
|
|
1862
1874
|
}
|
|
1863
|
-
throw new Error(
|
|
1875
|
+
throw new Error(
|
|
1876
|
+
"No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist."
|
|
1877
|
+
);
|
|
1864
1878
|
}, Qt = (e) => {
|
|
1865
|
-
if (!e)
|
|
1866
|
-
return;
|
|
1879
|
+
if (!e) return;
|
|
1867
1880
|
const r = /https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/, n = e.match(r);
|
|
1868
1881
|
return n ? n[2] : void 0;
|
|
1869
|
-
}, Kt = ({
|
|
1870
|
-
|
|
1882
|
+
}, Kt = ({
|
|
1883
|
+
playerId: e,
|
|
1884
|
+
videoId: r,
|
|
1885
|
+
version: n,
|
|
1886
|
+
videoUrl: i,
|
|
1887
|
+
projectId: a,
|
|
1888
|
+
playlistId: t,
|
|
1889
|
+
scriptUrl: s,
|
|
1890
|
+
config: c = {},
|
|
1891
|
+
isReels: f = !1,
|
|
1892
|
+
onPlaylistData: m,
|
|
1893
|
+
onVideoStarted: u,
|
|
1894
|
+
trackingMetadata: p,
|
|
1895
|
+
onPlayerStart: x,
|
|
1896
|
+
onPlayerPlay: g,
|
|
1897
|
+
onPlayerPause: E,
|
|
1898
|
+
onPlayerResume: h,
|
|
1899
|
+
onPlayerEnd: v,
|
|
1900
|
+
onPlayerProgressEvery10Seconds: w,
|
|
1901
|
+
onPlayerProgressAt20Seconds: b,
|
|
1902
|
+
onPlayerQuartile25: L,
|
|
1903
|
+
onPlayerQuartile50: F,
|
|
1904
|
+
onPlayerQuartile75: k,
|
|
1905
|
+
onPlayerNext: I,
|
|
1906
|
+
onPlayerPrevious: _,
|
|
1907
|
+
onPlayerEvent: J
|
|
1908
|
+
}) => {
|
|
1909
|
+
const Y = K(null), P = K(null), y = K(!1), S = K(""), B = K([]), U = K([]), M = K(null), { isLoaded: j, error: z } = Wt(
|
|
1910
|
+
n,
|
|
1911
|
+
s
|
|
1912
|
+
), O = r || Qt(s), [Q, q] = de(null), {
|
|
1913
|
+
fetchedPlaybackUrl: o,
|
|
1914
|
+
fetchedPlaylist: l,
|
|
1915
|
+
isLoading: d,
|
|
1916
|
+
error: $
|
|
1917
|
+
} = Ht({
|
|
1871
1918
|
projectId: a,
|
|
1872
1919
|
videoId: O,
|
|
1873
1920
|
playlistId: t,
|
|
1874
1921
|
videoUrl: i
|
|
1875
|
-
}), H =
|
|
1922
|
+
}), H = cr(e, O), [fe, V] = de(void 0);
|
|
1876
1923
|
Se(() => {
|
|
1877
1924
|
l && m && m(l);
|
|
1878
1925
|
}, [l, m]), Gt({
|
|
1879
1926
|
playerId: H,
|
|
1880
1927
|
playerInstanceRef: P,
|
|
1881
|
-
playerRef:
|
|
1928
|
+
playerRef: Y,
|
|
1882
1929
|
videoData: fe,
|
|
1883
1930
|
trackingMetadata: p,
|
|
1884
1931
|
callbacks: {
|
|
@@ -1898,27 +1945,28 @@ const Dt = Ae.div`
|
|
|
1898
1945
|
}
|
|
1899
1946
|
});
|
|
1900
1947
|
const pe = Pr(() => {
|
|
1901
|
-
const ne =
|
|
1948
|
+
const ne = c.config || {}, _e = f && !ne.size ? { sizeType: "RESPONSIVE", aspectRatio: "9:16" } : ne.size || { sizeType: "FIXED", width: "100%" };
|
|
1902
1949
|
return {
|
|
1903
|
-
...
|
|
1950
|
+
...c,
|
|
1904
1951
|
config: {
|
|
1905
1952
|
...ne,
|
|
1906
1953
|
size: _e
|
|
1907
1954
|
}
|
|
1908
1955
|
};
|
|
1909
|
-
}, [
|
|
1956
|
+
}, [c, f]);
|
|
1910
1957
|
return Se(() => {
|
|
1911
1958
|
if (z) {
|
|
1912
|
-
|
|
1959
|
+
q(z);
|
|
1913
1960
|
return;
|
|
1914
1961
|
}
|
|
1915
|
-
if (!j || d && !i)
|
|
1916
|
-
return;
|
|
1962
|
+
if (!j || d && !i) return;
|
|
1917
1963
|
let ne = !0;
|
|
1918
1964
|
const De = setTimeout(async () => {
|
|
1919
1965
|
try {
|
|
1920
|
-
B.current.forEach(
|
|
1921
|
-
|
|
1966
|
+
B.current.forEach(
|
|
1967
|
+
(oe) => clearInterval(oe)
|
|
1968
|
+
), B.current = [], U.current.forEach((oe) => clearTimeout(oe)), U.current = [], M.current = null;
|
|
1969
|
+
const ce = (l == null ? void 0 : l.length) ?? 0, we = JSON.stringify({
|
|
1922
1970
|
playerId: H,
|
|
1923
1971
|
videoId: r || O,
|
|
1924
1972
|
playlistId: t,
|
|
@@ -1927,35 +1975,39 @@ const Dt = Ae.div`
|
|
|
1927
1975
|
scriptUrl: s,
|
|
1928
1976
|
isReels: f,
|
|
1929
1977
|
projectId: a,
|
|
1930
|
-
playlistLength:
|
|
1978
|
+
playlistLength: ce
|
|
1931
1979
|
});
|
|
1932
|
-
if (y.current && P.current &&
|
|
1980
|
+
if (y.current && P.current && S.current === we)
|
|
1933
1981
|
return;
|
|
1934
|
-
|
|
1982
|
+
S.current !== we && (y.current = !1, S.current = we);
|
|
1935
1983
|
const ve = s == null ? void 0 : s.includes("vertical-player");
|
|
1936
1984
|
if (document.querySelectorAll('[id*="player"]').forEach((oe) => {
|
|
1937
1985
|
var Pe, T;
|
|
1938
1986
|
const be = oe.id;
|
|
1939
1987
|
if (be !== H)
|
|
1940
1988
|
try {
|
|
1941
|
-
const
|
|
1942
|
-
|
|
1943
|
-
} catch (
|
|
1944
|
-
console.warn(
|
|
1989
|
+
const R = ve ? (Pe = window.vpVerticalPlayer) == null ? void 0 : Pe.call(window, be) : (T = window.vpPlayer) == null ? void 0 : T.call(window, be);
|
|
1990
|
+
R != null && R.destroy && R.destroy();
|
|
1991
|
+
} catch (R) {
|
|
1992
|
+
console.warn(
|
|
1993
|
+
`Failed to destroy existing player ${be}:`,
|
|
1994
|
+
R
|
|
1995
|
+
);
|
|
1945
1996
|
}
|
|
1946
|
-
}), await new Promise((oe) => setTimeout(oe, 100)), !ne || !
|
|
1947
|
-
return;
|
|
1997
|
+
}), await new Promise((oe) => setTimeout(oe, 100)), !ne || !Y.current) return;
|
|
1948
1998
|
if (!document.getElementById(H)) {
|
|
1949
|
-
|
|
1999
|
+
q("DOM element not found after cleanup.");
|
|
1950
2000
|
return;
|
|
1951
2001
|
}
|
|
1952
2002
|
if (!window.vpPlayer && !window.vpVerticalPlayer) {
|
|
1953
|
-
|
|
2003
|
+
q("VP Player script not loaded.");
|
|
1954
2004
|
return;
|
|
1955
2005
|
}
|
|
1956
2006
|
const ke = ve ? window.vpVerticalPlayer : window.vpPlayer;
|
|
1957
2007
|
if (!ke) {
|
|
1958
|
-
|
|
2008
|
+
q(
|
|
2009
|
+
`VP ${ve ? "Vertical " : ""}Player script not loaded.`
|
|
2010
|
+
);
|
|
1959
2011
|
return;
|
|
1960
2012
|
}
|
|
1961
2013
|
const ge = Jt({
|
|
@@ -1968,16 +2020,18 @@ const Dt = Ae.div`
|
|
|
1968
2020
|
// Pass player type to config builder
|
|
1969
2021
|
}), G = ke(H);
|
|
1970
2022
|
if (!G) {
|
|
1971
|
-
|
|
2023
|
+
q(
|
|
2024
|
+
`Failed to create VP ${ve ? "Vertical " : ""}Player instance.`
|
|
2025
|
+
);
|
|
1972
2026
|
return;
|
|
1973
2027
|
}
|
|
1974
|
-
if (ne &&
|
|
2028
|
+
if (ne && Y.current && (G.setup(ge), P.current = G, y.current = !0, q(null), u && G.on)) {
|
|
1975
2029
|
const oe = () => {
|
|
1976
|
-
var
|
|
2030
|
+
var R, N, ae;
|
|
1977
2031
|
const T = {};
|
|
1978
|
-
if ((N = (
|
|
1979
|
-
const D = G.videoIndex ?? ((ae = G.playlist) == null ? void 0 : ae.playlistVideoIndex) ?? 0,
|
|
1980
|
-
|
|
2032
|
+
if ((N = (R = ge.video) == null ? void 0 : R.playlist) != null && N.videos && ge.video.playlist.videos.length > 0) {
|
|
2033
|
+
const D = G.videoIndex ?? ((ae = G.playlist) == null ? void 0 : ae.playlistVideoIndex) ?? 0, W = ge.video.playlist.videos[D];
|
|
2034
|
+
W && (T.title = W.title, T.file = W.file || W.hlsUrl, T.hlsUrl = W.file || W.hlsUrl, T.thumbnailUrl = W.thumbnailUrl, T.duration = W.duration, T.videoIndex = D, T.playlistVideoIndex = D, T.videoId = W.videoId || W.mediaId, T.mediaId = W.mediaId || W.videoId);
|
|
1981
2035
|
} else ge.video && (T.title = ge.video.title, T.file = ge.video.file, T.hlsUrl = ge.video.file, T.thumbnailUrl = ge.video.thumbnail, T.videoId = r || O, T.videoIndex = 0, T.playlistVideoIndex = 0, G.getDuration && (T.duration = G.getDuration()));
|
|
1982
2036
|
return T;
|
|
1983
2037
|
};
|
|
@@ -1986,23 +2040,23 @@ const Dt = Ae.div`
|
|
|
1986
2040
|
var T;
|
|
1987
2041
|
try {
|
|
1988
2042
|
be && clearTimeout(be), await new Promise((D) => setTimeout(D, 100));
|
|
1989
|
-
let
|
|
1990
|
-
const N =
|
|
2043
|
+
let R = oe();
|
|
2044
|
+
const N = R.videoId || R.mediaId;
|
|
1991
2045
|
if (N && N === M.current)
|
|
1992
2046
|
return;
|
|
1993
2047
|
if (be = window.setTimeout(() => {
|
|
1994
2048
|
M.current = null;
|
|
1995
2049
|
}, 500), (s == null ? void 0 : s.includes("vertical-player")) && N)
|
|
1996
2050
|
try {
|
|
1997
|
-
const Ee = `https://host.vpplayer.tech/player/ptkzurnx/${N}.json`,
|
|
1998
|
-
if (
|
|
1999
|
-
const re = await
|
|
2000
|
-
re != null && re.video && (
|
|
2001
|
-
...
|
|
2002
|
-
title: re.video.title ||
|
|
2051
|
+
const Ee = `https://host.vpplayer.tech/player/ptkzurnx/${N}.json`, W = await fetch(Ee);
|
|
2052
|
+
if (W.ok) {
|
|
2053
|
+
const re = await W.json();
|
|
2054
|
+
re != null && re.video && (R = {
|
|
2055
|
+
...R,
|
|
2056
|
+
title: re.video.title || R.title,
|
|
2003
2057
|
description: re.video.description,
|
|
2004
2058
|
publishDate: re.video.publishDate,
|
|
2005
|
-
projectId: re.projectId ||
|
|
2059
|
+
projectId: re.projectId || R.projectId,
|
|
2006
2060
|
premium: ((T = re.video.videoLocking) == null ? void 0 : T.isEnabled) || !1,
|
|
2007
2061
|
author: re.video.author,
|
|
2008
2062
|
tags: re.video.tags || []
|
|
@@ -2010,34 +2064,34 @@ const Dt = Ae.div`
|
|
|
2010
2064
|
}
|
|
2011
2065
|
} catch {
|
|
2012
2066
|
}
|
|
2013
|
-
M.current = N || null, V(
|
|
2014
|
-
} catch (
|
|
2015
|
-
console.warn("Error in video-started handler:",
|
|
2067
|
+
M.current = N || null, V(R), u(R);
|
|
2068
|
+
} catch (R) {
|
|
2069
|
+
console.warn("Error in video-started handler:", R);
|
|
2016
2070
|
}
|
|
2017
2071
|
};
|
|
2018
2072
|
if (ve) {
|
|
2019
|
-
let T = !1,
|
|
2073
|
+
let T = !1, R = -1;
|
|
2020
2074
|
const N = () => {
|
|
2021
2075
|
if (!T) {
|
|
2022
2076
|
T = !0;
|
|
2023
2077
|
try {
|
|
2024
2078
|
G.on && G.on("vp-video-started", Pe), setTimeout(() => {
|
|
2025
|
-
Pe(),
|
|
2079
|
+
Pe(), R = G.videoIndex ?? 0;
|
|
2026
2080
|
}, 500);
|
|
2027
|
-
} catch (
|
|
2028
|
-
console.error("Error setting up event listeners:",
|
|
2081
|
+
} catch (W) {
|
|
2082
|
+
console.error("Error setting up event listeners:", W);
|
|
2029
2083
|
}
|
|
2030
2084
|
}
|
|
2031
2085
|
};
|
|
2032
2086
|
let ae = 0;
|
|
2033
2087
|
const D = 15, Ee = setInterval(() => {
|
|
2034
2088
|
try {
|
|
2035
|
-
const
|
|
2089
|
+
const W = G.videoIndex !== void 0 || G.playlist;
|
|
2036
2090
|
if (!T)
|
|
2037
|
-
ae++, (
|
|
2091
|
+
ae++, (W || ae >= D) && N();
|
|
2038
2092
|
else {
|
|
2039
2093
|
const re = G.videoIndex ?? 0;
|
|
2040
|
-
re !==
|
|
2094
|
+
re !== R && R !== -1 && (R = re, Pe());
|
|
2041
2095
|
}
|
|
2042
2096
|
} catch {
|
|
2043
2097
|
}
|
|
@@ -2048,18 +2102,21 @@ const Dt = Ae.div`
|
|
|
2048
2102
|
} catch {
|
|
2049
2103
|
}
|
|
2050
2104
|
} else {
|
|
2051
|
-
const T = async (
|
|
2105
|
+
const T = async (R) => {
|
|
2052
2106
|
var N, ae;
|
|
2053
2107
|
try {
|
|
2054
2108
|
const D = s == null ? void 0 : s.match(/player\/([^/.]+)/), Ee = D == null ? void 0 : D[1];
|
|
2055
|
-
if (!Ee || !
|
|
2109
|
+
if (!Ee || !R)
|
|
2056
2110
|
return oe();
|
|
2057
|
-
const
|
|
2111
|
+
const W = `https://host.vpplayer.tech/player/${Ee}/${R}.json`, re = await fetch(W);
|
|
2058
2112
|
if (!re.ok)
|
|
2059
|
-
return console.warn(
|
|
2113
|
+
return console.warn(
|
|
2114
|
+
"Failed to fetch full video config:",
|
|
2115
|
+
re.status
|
|
2116
|
+
), oe();
|
|
2060
2117
|
const se = await re.json();
|
|
2061
2118
|
return se != null && se.video ? {
|
|
2062
|
-
videoId:
|
|
2119
|
+
videoId: R,
|
|
2063
2120
|
title: se.video.title,
|
|
2064
2121
|
description: se.video.description,
|
|
2065
2122
|
file: se.video.file,
|
|
@@ -2078,25 +2135,25 @@ const Dt = Ae.div`
|
|
|
2078
2135
|
return console.warn("Error fetching full video data:", D), oe();
|
|
2079
2136
|
}
|
|
2080
2137
|
};
|
|
2081
|
-
G.on("ready", async (
|
|
2138
|
+
G.on("ready", async (R) => {
|
|
2082
2139
|
try {
|
|
2083
|
-
const N =
|
|
2140
|
+
const N = R, ae = (N == null ? void 0 : N.id) || r || O;
|
|
2084
2141
|
if (ae) {
|
|
2085
2142
|
const D = await T(ae);
|
|
2086
|
-
V(D),
|
|
2143
|
+
V(D), u(D);
|
|
2087
2144
|
} else {
|
|
2088
2145
|
const D = oe();
|
|
2089
|
-
(D.title || D.file) && (V(D),
|
|
2146
|
+
(D.title || D.file) && (V(D), u(D));
|
|
2090
2147
|
}
|
|
2091
2148
|
} catch (N) {
|
|
2092
2149
|
console.warn("Error in ready handler:", N);
|
|
2093
2150
|
}
|
|
2094
|
-
}), G.on("playlistItem", async (
|
|
2151
|
+
}), G.on("playlistItem", async (R) => {
|
|
2095
2152
|
try {
|
|
2096
|
-
const N =
|
|
2153
|
+
const N = R, ae = N == null ? void 0 : N.id;
|
|
2097
2154
|
if (ae) {
|
|
2098
2155
|
const D = await T(ae);
|
|
2099
|
-
V(D),
|
|
2156
|
+
V(D), u(D);
|
|
2100
2157
|
}
|
|
2101
2158
|
} catch (N) {
|
|
2102
2159
|
console.warn("Error in playlistItem handler:", N);
|
|
@@ -2104,15 +2161,15 @@ const Dt = Ae.div`
|
|
|
2104
2161
|
});
|
|
2105
2162
|
}
|
|
2106
2163
|
}
|
|
2107
|
-
} catch (
|
|
2164
|
+
} catch (ce) {
|
|
2108
2165
|
if (ne) {
|
|
2109
|
-
const we =
|
|
2110
|
-
|
|
2166
|
+
const we = ce instanceof Error ? ce.message : String(ce);
|
|
2167
|
+
q(we), console.error("VP Player initialization error:", ce);
|
|
2111
2168
|
}
|
|
2112
2169
|
}
|
|
2113
2170
|
}, 150);
|
|
2114
2171
|
return () => {
|
|
2115
|
-
ne = !1, clearTimeout(De), B.current.forEach((
|
|
2172
|
+
ne = !1, clearTimeout(De), B.current.forEach((ce) => clearInterval(ce)), B.current = [], U.current.forEach((ce) => clearTimeout(ce)), U.current = [], y.current = !1;
|
|
2116
2173
|
};
|
|
2117
2174
|
}, [j, d, H, z, s]), Se(() => () => {
|
|
2118
2175
|
if (P.current) {
|
|
@@ -2127,15 +2184,44 @@ const Dt = Ae.div`
|
|
|
2127
2184
|
const ne = document.getElementById(H);
|
|
2128
2185
|
ne && (ne.innerHTML = "");
|
|
2129
2186
|
}, [H]), {
|
|
2130
|
-
playerRef:
|
|
2187
|
+
playerRef: Y,
|
|
2131
2188
|
playerInstanceRef: P,
|
|
2132
2189
|
isScriptLoaded: j,
|
|
2133
2190
|
isLoading: d,
|
|
2134
2191
|
error: $ || Q || z
|
|
2135
2192
|
};
|
|
2136
|
-
}, Zt = ({
|
|
2193
|
+
}, Zt = ({
|
|
2194
|
+
playerId: e,
|
|
2195
|
+
videoId: r,
|
|
2196
|
+
version: n,
|
|
2197
|
+
videoUrl: i,
|
|
2198
|
+
projectId: a,
|
|
2199
|
+
playlistId: t,
|
|
2200
|
+
scriptUrl: s,
|
|
2201
|
+
config: c = {},
|
|
2202
|
+
isReels: f = !1,
|
|
2203
|
+
hiddenClasses: m = [],
|
|
2204
|
+
onClose: u,
|
|
2205
|
+
className: p,
|
|
2206
|
+
onPlaylistData: x,
|
|
2207
|
+
onVideoStarted: g,
|
|
2208
|
+
trackingMetadata: E,
|
|
2209
|
+
onPlayerStart: h,
|
|
2210
|
+
onPlayerPlay: v,
|
|
2211
|
+
onPlayerPause: w,
|
|
2212
|
+
onPlayerResume: b,
|
|
2213
|
+
onPlayerEnd: L,
|
|
2214
|
+
onPlayerProgressEvery10Seconds: F,
|
|
2215
|
+
onPlayerProgressAt20Seconds: k,
|
|
2216
|
+
onPlayerQuartile25: I,
|
|
2217
|
+
onPlayerQuartile50: _,
|
|
2218
|
+
onPlayerQuartile75: J,
|
|
2219
|
+
onPlayerNext: Y,
|
|
2220
|
+
onPlayerPrevious: P,
|
|
2221
|
+
onPlayerEvent: y
|
|
2222
|
+
}) => {
|
|
2137
2223
|
var $, H, fe, V;
|
|
2138
|
-
const { playerRef:
|
|
2224
|
+
const { playerRef: S, playerInstanceRef: B, isScriptLoaded: U, isLoading: M, error: j } = Kt({
|
|
2139
2225
|
playerId: e,
|
|
2140
2226
|
videoId: r,
|
|
2141
2227
|
version: n,
|
|
@@ -2143,7 +2229,7 @@ const Dt = Ae.div`
|
|
|
2143
2229
|
projectId: a,
|
|
2144
2230
|
playlistId: t,
|
|
2145
2231
|
scriptUrl: s,
|
|
2146
|
-
config:
|
|
2232
|
+
config: c,
|
|
2147
2233
|
isReels: f,
|
|
2148
2234
|
onPlaylistData: x,
|
|
2149
2235
|
onVideoStarted: g,
|
|
@@ -2158,35 +2244,85 @@ const Dt = Ae.div`
|
|
|
2158
2244
|
onPlayerQuartile25: I,
|
|
2159
2245
|
onPlayerQuartile50: _,
|
|
2160
2246
|
onPlayerQuartile75: J,
|
|
2161
|
-
onPlayerNext:
|
|
2247
|
+
onPlayerNext: Y,
|
|
2162
2248
|
onPlayerPrevious: P,
|
|
2163
2249
|
onPlayerEvent: y
|
|
2164
|
-
}), [z, O] = de(!0), Q = () => f && O(!0),
|
|
2250
|
+
}), [z, O] = de(!0), Q = () => f && O(!0), q = () => {
|
|
2165
2251
|
var ee, pe;
|
|
2166
|
-
O(!1), (pe = (ee = B.current) == null ? void 0 : ee.play) == null || pe.call(ee),
|
|
2167
|
-
}, o = (H = ($ =
|
|
2168
|
-
return j ?
|
|
2252
|
+
O(!1), (pe = (ee = B.current) == null ? void 0 : ee.play) == null || pe.call(ee), u == null || u();
|
|
2253
|
+
}, o = (H = ($ = c == null ? void 0 : c.config) == null ? void 0 : $.size) != null && H.width ? typeof c.config.size.width == "number" ? `${c.config.size.width}px` : c.config.size.width : void 0, l = (V = (fe = c == null ? void 0 : c.config) == null ? void 0 : fe.size) != null && V.height ? typeof c.config.size.height == "number" ? `${c.config.size.height}px` : c.config.size.height : void 0, d = cr(e, r);
|
|
2254
|
+
return j ? /* @__PURE__ */ Z.jsxs(ar, { type: "error", children: [
|
|
2255
|
+
"An error occurred: ",
|
|
2256
|
+
j
|
|
2257
|
+
] }) : M || !U ? /* @__PURE__ */ Z.jsx(ar, { type: "loading", children: "Loading..." }) : /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
2258
|
+
f && !z ? /* @__PURE__ */ Z.jsx("div", { onClick: Q }) : null,
|
|
2259
|
+
!f && /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsx(
|
|
2260
|
+
_r,
|
|
2261
|
+
{
|
|
2262
|
+
id: d,
|
|
2263
|
+
ref: S,
|
|
2264
|
+
width: o || "100%",
|
|
2265
|
+
height: l || "auto",
|
|
2266
|
+
$hiddenClasses: m,
|
|
2267
|
+
className: p
|
|
2268
|
+
}
|
|
2269
|
+
) }, d),
|
|
2270
|
+
f && z && /* @__PURE__ */ Z.jsx(Mt, { onClick: q, className: p, children: /* @__PURE__ */ Z.jsx(zt, { className: p, onClick: (ee) => ee.stopPropagation(), children: /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsx(
|
|
2271
|
+
_r,
|
|
2272
|
+
{
|
|
2273
|
+
id: d,
|
|
2274
|
+
ref: S,
|
|
2275
|
+
width: "100%",
|
|
2276
|
+
height: "auto",
|
|
2277
|
+
$hiddenClasses: m,
|
|
2278
|
+
className: p
|
|
2279
|
+
}
|
|
2280
|
+
) }, d) }) })
|
|
2281
|
+
] });
|
|
2169
2282
|
}, $r = Dr(void 0), rn = ({ children: e }) => {
|
|
2170
|
-
const [r, n] = de(!1), [i, a] = de(null), [t, s] = de(null),
|
|
2283
|
+
const [r, n] = de(!1), [i, a] = de(null), [t, s] = de(null), c = ur((u) => {
|
|
2171
2284
|
try {
|
|
2172
|
-
const p =
|
|
2173
|
-
a({ ...
|
|
2285
|
+
const p = cr(u.playerId, u.videoId);
|
|
2286
|
+
a({ ...u, playerId: p }), n(!0), s(null);
|
|
2174
2287
|
} catch {
|
|
2175
2288
|
s("Failed to show player.");
|
|
2176
2289
|
}
|
|
2177
|
-
}, []), f =
|
|
2290
|
+
}, []), f = ur(() => {
|
|
2178
2291
|
n(!1), a(null), s(null);
|
|
2179
|
-
}, []), m = Pr(
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2292
|
+
}, []), m = Pr(
|
|
2293
|
+
() => ({
|
|
2294
|
+
showPlayer: c,
|
|
2295
|
+
hidePlayer: f,
|
|
2296
|
+
isPlayerVisible: r,
|
|
2297
|
+
playerParams: i
|
|
2298
|
+
}),
|
|
2299
|
+
[c, f, r, i]
|
|
2300
|
+
);
|
|
2301
|
+
return /* @__PURE__ */ Z.jsxs($r.Provider, { value: m, children: [
|
|
2302
|
+
e,
|
|
2303
|
+
t && /* @__PURE__ */ Z.jsx(ar, { type: "error", children: t }),
|
|
2304
|
+
r && (i == null ? void 0 : i.playerId) && /* @__PURE__ */ Z.jsx(
|
|
2305
|
+
Zt,
|
|
2306
|
+
{
|
|
2307
|
+
playerId: i.playerId,
|
|
2308
|
+
videoId: i.videoId,
|
|
2309
|
+
projectId: i.projectId,
|
|
2310
|
+
videoUrl: i.videoUrl,
|
|
2311
|
+
version: i.version,
|
|
2312
|
+
playlistId: i.playlistId,
|
|
2313
|
+
scriptUrl: i.scriptUrl,
|
|
2314
|
+
config: i.config,
|
|
2315
|
+
isReels: i.isReels,
|
|
2316
|
+
thumbnailUrl: i.thumbnailUrl,
|
|
2317
|
+
onClose: f,
|
|
2318
|
+
hiddenClasses: i.hiddenClasses || [],
|
|
2319
|
+
className: i.className
|
|
2320
|
+
}
|
|
2321
|
+
)
|
|
2322
|
+
] });
|
|
2186
2323
|
}, tn = () => {
|
|
2187
2324
|
const e = Er($r);
|
|
2188
|
-
if (!e)
|
|
2189
|
-
throw new Error("useVPPlayer must be used within a VPPlayerProvider");
|
|
2325
|
+
if (!e) throw new Error("useVPPlayer must be used within a VPPlayerProvider");
|
|
2190
2326
|
return e;
|
|
2191
2327
|
}, nn = {
|
|
2192
2328
|
projectId: "vp-player-projectId",
|
|
@@ -2261,15 +2397,15 @@ const Dt = Ae.div`
|
|
|
2261
2397
|
}
|
|
2262
2398
|
}
|
|
2263
2399
|
};
|
|
2264
|
-
}, ln = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
|
|
2400
|
+
}, ln = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", cn = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", un = "https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4", dn = "https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600", fn = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=", pn = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";
|
|
2265
2401
|
export {
|
|
2266
2402
|
fn as AD_TAG_LINEAR_URL,
|
|
2267
2403
|
pn as AD_TAG_SKIPPABLE_LINEAR_URL,
|
|
2268
2404
|
ln as BIG_BUCK_BUNNY_URL,
|
|
2269
|
-
|
|
2405
|
+
cn as ELEPHANTS_DREAM_URL,
|
|
2270
2406
|
Mt as Overlay,
|
|
2271
2407
|
dn as PEXELS_THUMBNAIL_URL,
|
|
2272
|
-
|
|
2408
|
+
un as PEXELS_VERTICAL_VIDEO_URL,
|
|
2273
2409
|
_r as PlayerContainer,
|
|
2274
2410
|
zt as PlayerWrapper,
|
|
2275
2411
|
Zt as VPPlayer,
|