@vplayer/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +186 -187
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -134,31 +134,31 @@ function S(e, t, n) {
|
|
|
134
134
|
complete: (r ? e.complete : n)?.bind(i)
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
var C = [], w = 0, { link: T, unlink: ee, propagate: E, checkDirty: te, shallowPropagate:
|
|
137
|
+
var C = [], w = 0, { link: T, unlink: ee, propagate: E, checkDirty: te, shallowPropagate: ne } = /* @__PURE__ */ x({
|
|
138
138
|
update(e) {
|
|
139
139
|
return e._update();
|
|
140
140
|
},
|
|
141
141
|
notify(e) {
|
|
142
|
-
C[
|
|
142
|
+
C[ie++] = e, e.flags &= -3;
|
|
143
143
|
},
|
|
144
144
|
unwatched(e) {
|
|
145
|
-
e.depsTail !== void 0 && (e.depsTail = void 0, e.flags = 17,
|
|
145
|
+
e.depsTail !== void 0 && (e.depsTail = void 0, e.flags = 17, oe(e));
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
148
|
-
function
|
|
147
|
+
}), re = 0, ie = 0, D, ae = 0;
|
|
148
|
+
function oe(e) {
|
|
149
149
|
let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
|
|
150
150
|
for (; n !== void 0;) n = ee(n, e);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
if (!(
|
|
154
|
-
for (;
|
|
155
|
-
let e = C[
|
|
156
|
-
C[
|
|
152
|
+
function se() {
|
|
153
|
+
if (!(ae > 0)) {
|
|
154
|
+
for (; re < ie;) {
|
|
155
|
+
let e = C[re];
|
|
156
|
+
C[re++] = void 0, e.notify();
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
re = 0, ie = 0;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function ce(e, t) {
|
|
162
162
|
let n = typeof e == "function", r = e, i = {
|
|
163
163
|
_snapshot: n ? void 0 : e,
|
|
164
164
|
subs: void 0,
|
|
@@ -167,10 +167,10 @@ function se(e, t) {
|
|
|
167
167
|
depsTail: void 0,
|
|
168
168
|
flags: +!n,
|
|
169
169
|
get() {
|
|
170
|
-
return
|
|
170
|
+
return D !== void 0 && T(i, D, w), i._snapshot;
|
|
171
171
|
},
|
|
172
172
|
subscribe(e) {
|
|
173
|
-
let t = S(e), n = { current: !1 }, r =
|
|
173
|
+
let t = S(e), n = { current: !1 }, r = le(() => {
|
|
174
174
|
i.get(), n.current ? t.next?.(i._snapshot) : n.current = !0;
|
|
175
175
|
});
|
|
176
176
|
return { unsubscribe: () => {
|
|
@@ -178,15 +178,15 @@ function se(e, t) {
|
|
|
178
178
|
} };
|
|
179
179
|
},
|
|
180
180
|
_update(e) {
|
|
181
|
-
let a =
|
|
182
|
-
if (n)
|
|
181
|
+
let a = D, o = t?.compare ?? Object.is;
|
|
182
|
+
if (n) D = i, ++w, i.depsTail = void 0;
|
|
183
183
|
else if (e === void 0) return !1;
|
|
184
184
|
n && (i.flags = 5);
|
|
185
185
|
try {
|
|
186
186
|
let t = i._snapshot, a = typeof e == "function" ? e(t) : e === void 0 && n ? r(t) : e;
|
|
187
187
|
return t === void 0 || !o(t, a) ? (i._snapshot = a, !0) : !1;
|
|
188
188
|
} finally {
|
|
189
|
-
|
|
189
|
+
D = a, n && (i.flags &= -5), oe(i);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
};
|
|
@@ -195,25 +195,25 @@ function se(e, t) {
|
|
|
195
195
|
if (e & 16 || e & 32 && te(i.deps, i)) {
|
|
196
196
|
if (i._update()) {
|
|
197
197
|
let e = i.subs;
|
|
198
|
-
e !== void 0 &&
|
|
198
|
+
e !== void 0 && ne(e);
|
|
199
199
|
}
|
|
200
200
|
} else e & 32 && (i.flags = e & -33);
|
|
201
|
-
return
|
|
201
|
+
return D !== void 0 && T(i, D, w), i._snapshot;
|
|
202
202
|
}) : i.set = function(e) {
|
|
203
203
|
if (i._update(e)) {
|
|
204
204
|
let e = i.subs;
|
|
205
|
-
e !== void 0 && (E(e),
|
|
205
|
+
e !== void 0 && (E(e), ne(e), se());
|
|
206
206
|
}
|
|
207
207
|
}, i;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function le(e) {
|
|
210
210
|
let t = () => {
|
|
211
|
-
let t =
|
|
212
|
-
|
|
211
|
+
let t = D;
|
|
212
|
+
D = n, ++w, n.depsTail = void 0, n.flags = 6;
|
|
213
213
|
try {
|
|
214
214
|
return e();
|
|
215
215
|
} finally {
|
|
216
|
-
|
|
216
|
+
D = t, n.flags &= -5, oe(n);
|
|
217
217
|
}
|
|
218
218
|
}, n = {
|
|
219
219
|
deps: void 0,
|
|
@@ -226,16 +226,16 @@ function ce(e) {
|
|
|
226
226
|
e & 16 || e & 32 && te(this.deps, this) ? t() : this.flags = 2;
|
|
227
227
|
},
|
|
228
228
|
stop() {
|
|
229
|
-
this.flags = 0, this.depsTail = void 0,
|
|
229
|
+
this.flags = 0, this.depsTail = void 0, oe(this);
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
return t(), n;
|
|
233
233
|
}
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region ../../node_modules/@tanstack/store/dist/store.js
|
|
236
|
-
var
|
|
236
|
+
var ue = class {
|
|
237
237
|
constructor(e, t) {
|
|
238
|
-
this.atom =
|
|
238
|
+
this.atom = ce(e), this.get = this.get.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), t && (this.actions = t(this));
|
|
239
239
|
}
|
|
240
240
|
setState(e) {
|
|
241
241
|
this.atom.set(e);
|
|
@@ -249,10 +249,10 @@ var le = class {
|
|
|
249
249
|
subscribe(e) {
|
|
250
250
|
return this.atom.subscribe(S(e));
|
|
251
251
|
}
|
|
252
|
-
},
|
|
252
|
+
}, de = /* @__PURE__ */ b(((t, n) => {
|
|
253
253
|
n.exports = { ...e };
|
|
254
|
-
})),
|
|
255
|
-
var t =
|
|
254
|
+
})), fe = /* @__PURE__ */ b(((e) => {
|
|
255
|
+
var t = de();
|
|
256
256
|
function n(e, t) {
|
|
257
257
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
258
258
|
}
|
|
@@ -289,7 +289,7 @@ var le = class {
|
|
|
289
289
|
}
|
|
290
290
|
var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
|
|
291
291
|
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
|
|
292
|
-
})),
|
|
292
|
+
})), pe = /* @__PURE__ */ b(((e) => {
|
|
293
293
|
process.env.NODE_ENV !== "production" && (function() {
|
|
294
294
|
function t(e, t) {
|
|
295
295
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
@@ -332,13 +332,13 @@ var le = class {
|
|
|
332
332
|
return t();
|
|
333
333
|
}
|
|
334
334
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
335
|
-
var a =
|
|
335
|
+
var a = de(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
336
336
|
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
337
337
|
})();
|
|
338
|
-
})),
|
|
339
|
-
t.exports = process.env.NODE_ENV === "production" ?
|
|
338
|
+
})), O = /* @__PURE__ */ b(((e, t) => {
|
|
339
|
+
t.exports = process.env.NODE_ENV === "production" ? fe() : pe();
|
|
340
340
|
})), k = /* @__PURE__ */ b(((e) => {
|
|
341
|
-
var t =
|
|
341
|
+
var t = de(), n = O();
|
|
342
342
|
function r(e, t) {
|
|
343
343
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
344
344
|
}
|
|
@@ -388,7 +388,7 @@ var le = class {
|
|
|
388
388
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
389
389
|
}
|
|
390
390
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
391
|
-
var n =
|
|
391
|
+
var n = de(), r = O(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
|
|
392
392
|
e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
|
|
393
393
|
var d = o(null);
|
|
394
394
|
if (d.current === null) {
|
|
@@ -645,70 +645,72 @@ function Ne(e, t, n) {
|
|
|
645
645
|
} catch {}
|
|
646
646
|
}
|
|
647
647
|
function Pe() {
|
|
648
|
-
let e = null, t, n, r = !1,
|
|
649
|
-
function
|
|
650
|
-
let
|
|
651
|
-
|
|
648
|
+
let e = null, t, n, r, i, a = !1, o = NaN, s = NaN, c = NaN;
|
|
649
|
+
function l() {
|
|
650
|
+
let a = Me();
|
|
651
|
+
a && e && a.metadata === e && (a.metadata = null), e = null, t = void 0, n = void 0, r = void 0, i = void 0;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function u(e) {
|
|
654
654
|
let t = Me();
|
|
655
|
-
!t ||
|
|
655
|
+
!t || a || (Ne(t, "play", () => e.play()), Ne(t, "pause", () => e.pause()), Ne(t, "seekbackward", (t) => {
|
|
656
656
|
e.skip(-(t.seekOffset ?? ke));
|
|
657
657
|
}), Ne(t, "seekforward", (t) => {
|
|
658
658
|
e.skip(t.seekOffset ?? ke);
|
|
659
659
|
}), Ne(t, "seekto", (t) => {
|
|
660
660
|
typeof t.seekTime == "number" && e.seek(t.seekTime);
|
|
661
|
-
}),
|
|
662
|
-
}
|
|
663
|
-
function
|
|
664
|
-
let
|
|
665
|
-
if (!
|
|
666
|
-
let o =
|
|
667
|
-
if (!
|
|
668
|
-
|
|
661
|
+
}), a = !0);
|
|
662
|
+
}
|
|
663
|
+
function d(a, o, s) {
|
|
664
|
+
let c = Me();
|
|
665
|
+
if (!c || typeof MediaMetadata > "u") return;
|
|
666
|
+
let u = a?.trim() || void 0, d = o?.artwork ?? s, f = o?.artist?.trim() || void 0, p = o?.album?.trim() || void 0;
|
|
667
|
+
if (!u) {
|
|
668
|
+
l();
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
|
-
if (e &&
|
|
672
|
-
let
|
|
673
|
-
title:
|
|
674
|
-
|
|
671
|
+
if (e && c.metadata === e && t === u && n === d && r === f && i === p) return;
|
|
672
|
+
let m = new MediaMetadata({
|
|
673
|
+
title: u,
|
|
674
|
+
...f ? { artist: f } : {},
|
|
675
|
+
...p ? { album: p } : {},
|
|
676
|
+
artwork: d ? [{ src: d }] : []
|
|
675
677
|
});
|
|
676
|
-
|
|
678
|
+
c.metadata = m, e = m, t = u, n = d, r = f, i = p;
|
|
677
679
|
}
|
|
678
|
-
function
|
|
680
|
+
function f(e) {
|
|
679
681
|
let t = Me();
|
|
680
682
|
t && (t.playbackState = e);
|
|
681
683
|
}
|
|
682
|
-
function
|
|
683
|
-
let
|
|
684
|
-
if (!(!
|
|
685
|
-
|
|
684
|
+
function p(e, t, n, r = !1) {
|
|
685
|
+
let i = Me();
|
|
686
|
+
if (!(!i || typeof i.setPositionState != "function") && !(!Oe(e) || !Number.isFinite(t) || t < 0) && !(!r && Number.isFinite(o) && Math.abs(t - o) < Ae && e === s && n === c)) try {
|
|
687
|
+
i.setPositionState({
|
|
686
688
|
duration: e,
|
|
687
689
|
playbackRate: n,
|
|
688
690
|
position: Math.min(t, e)
|
|
689
|
-
}),
|
|
691
|
+
}), o = t, s = e, c = n;
|
|
690
692
|
} catch {}
|
|
691
693
|
}
|
|
692
|
-
function
|
|
694
|
+
function m() {
|
|
693
695
|
let e = Me();
|
|
694
696
|
if (e) {
|
|
695
|
-
if (
|
|
697
|
+
if (a) {
|
|
696
698
|
for (let t of je) Ne(e, t, null);
|
|
697
|
-
|
|
699
|
+
a = !1;
|
|
698
700
|
}
|
|
699
701
|
e.playbackState = "none";
|
|
700
702
|
}
|
|
701
|
-
|
|
703
|
+
l(), o = NaN, s = NaN, c = NaN;
|
|
702
704
|
}
|
|
703
705
|
return {
|
|
704
|
-
setup:
|
|
705
|
-
syncMetadata:
|
|
706
|
-
setPlaybackState:
|
|
707
|
-
syncPosition:
|
|
706
|
+
setup: u,
|
|
707
|
+
syncMetadata: d,
|
|
708
|
+
setPlaybackState: f,
|
|
709
|
+
syncPosition: p,
|
|
708
710
|
get hasMetadata() {
|
|
709
711
|
return e !== null;
|
|
710
712
|
},
|
|
711
|
-
teardown:
|
|
713
|
+
teardown: m
|
|
712
714
|
};
|
|
713
715
|
}
|
|
714
716
|
var Fe = "vplayer", Ie = class {
|
|
@@ -1202,7 +1204,7 @@ function st(e, t) {
|
|
|
1202
1204
|
return null;
|
|
1203
1205
|
}
|
|
1204
1206
|
function ct() {
|
|
1205
|
-
return new
|
|
1207
|
+
return new ue(lt());
|
|
1206
1208
|
}
|
|
1207
1209
|
function lt() {
|
|
1208
1210
|
return {
|
|
@@ -1320,7 +1322,7 @@ function bt(e) {
|
|
|
1320
1322
|
T = !1, te();
|
|
1321
1323
|
}));
|
|
1322
1324
|
}
|
|
1323
|
-
function
|
|
1325
|
+
function ne(e, t) {
|
|
1324
1326
|
let n = w.at(-1);
|
|
1325
1327
|
n?.kind === "save" && n.target.generation === e.generation ? n.progress = t : w.push({
|
|
1326
1328
|
kind: "save",
|
|
@@ -1328,28 +1330,28 @@ function bt(e) {
|
|
|
1328
1330
|
progress: t
|
|
1329
1331
|
}), te();
|
|
1330
1332
|
}
|
|
1331
|
-
function
|
|
1333
|
+
function re(e) {
|
|
1332
1334
|
w.push({
|
|
1333
1335
|
kind: "clear",
|
|
1334
1336
|
target: e
|
|
1335
1337
|
}), te();
|
|
1336
1338
|
}
|
|
1337
|
-
function
|
|
1338
|
-
!n || n.ended || t.state.resumeState.status === "prompt" || !Number.isFinite(n.currentTime) || n.currentTime <= 3 || !Oe(n.duration) || (f = Date.now(), p = n.currentTime,
|
|
1339
|
+
function ie(e = E, n = u) {
|
|
1340
|
+
!n || n.ended || t.state.resumeState.status === "prompt" || !Number.isFinite(n.currentTime) || n.currentTime <= 3 || !Oe(n.duration) || (f = Date.now(), p = n.currentTime, ne(e, {
|
|
1339
1341
|
time: n.currentTime,
|
|
1340
1342
|
duration: n.duration
|
|
1341
1343
|
}));
|
|
1342
1344
|
}
|
|
1343
|
-
function
|
|
1344
|
-
!t.state.isPlaying || Date.now() - f < dt || Number.isFinite(p) && Math.abs(e.currentTime - p) < ft ||
|
|
1345
|
+
function D(e) {
|
|
1346
|
+
!t.state.isPlaying || Date.now() - f < dt || Number.isFinite(p) && Math.abs(e.currentTime - p) < ft || ie(E, e);
|
|
1345
1347
|
}
|
|
1346
|
-
function
|
|
1348
|
+
function ae() {
|
|
1347
1349
|
x++, E = ee(n), S = !1, f = 0, p = NaN, t.setState((e) => ({
|
|
1348
1350
|
...e,
|
|
1349
1351
|
resumeState: { status: "idle" }
|
|
1350
1352
|
}));
|
|
1351
1353
|
}
|
|
1352
|
-
function
|
|
1354
|
+
function oe(e) {
|
|
1353
1355
|
if (S || !Oe(e.duration)) return;
|
|
1354
1356
|
S = !0;
|
|
1355
1357
|
let n = E, r = e.duration;
|
|
@@ -1380,7 +1382,7 @@ function bt(e) {
|
|
|
1380
1382
|
})), console.warn("[vplayer] playback progress load failed:", r);
|
|
1381
1383
|
});
|
|
1382
1384
|
}
|
|
1383
|
-
function
|
|
1385
|
+
function se(e) {
|
|
1384
1386
|
t.setState((t) => {
|
|
1385
1387
|
let n = new Map(t.subtitleTracks.map((e) => [e.id, e]));
|
|
1386
1388
|
for (let t of e) {
|
|
@@ -1393,7 +1395,7 @@ function bt(e) {
|
|
|
1393
1395
|
};
|
|
1394
1396
|
});
|
|
1395
1397
|
}
|
|
1396
|
-
function
|
|
1398
|
+
function ce(e) {
|
|
1397
1399
|
_?.abort();
|
|
1398
1400
|
let n = new AbortController();
|
|
1399
1401
|
_ = n, t.setState((t) => ({
|
|
@@ -1418,7 +1420,7 @@ function bt(e) {
|
|
|
1418
1420
|
}));
|
|
1419
1421
|
});
|
|
1420
1422
|
}
|
|
1421
|
-
function
|
|
1423
|
+
function le() {
|
|
1422
1424
|
let e = (n.subtitleProviders ?? []).map(({ id: e, label: t }) => ({
|
|
1423
1425
|
id: e,
|
|
1424
1426
|
label: t
|
|
@@ -1431,7 +1433,7 @@ function bt(e) {
|
|
|
1431
1433
|
subtitleSearchError: null
|
|
1432
1434
|
}));
|
|
1433
1435
|
}
|
|
1434
|
-
function
|
|
1436
|
+
function ue(e = {}) {
|
|
1435
1437
|
v?.abort();
|
|
1436
1438
|
let r = n.subtitleProviders ?? [], i = e.providerId ? r.filter((t) => t.id === e.providerId) : r;
|
|
1437
1439
|
if (i.length === 0) {
|
|
@@ -1471,7 +1473,7 @@ function bt(e) {
|
|
|
1471
1473
|
}));
|
|
1472
1474
|
});
|
|
1473
1475
|
}
|
|
1474
|
-
function
|
|
1476
|
+
function de(e) {
|
|
1475
1477
|
_?.abort();
|
|
1476
1478
|
let r = (n.subtitleProviders ?? []).find((t) => t.id === e.providerId);
|
|
1477
1479
|
if (!r) {
|
|
@@ -1499,7 +1501,7 @@ function bt(e) {
|
|
|
1499
1501
|
...n.content === void 0 ? { src: n.src } : { content: n.content }
|
|
1500
1502
|
}), o = await tt(a, i.signal);
|
|
1501
1503
|
if (i.signal.aborted) return;
|
|
1502
|
-
|
|
1504
|
+
se([a]), t.setState((e) => ({
|
|
1503
1505
|
...e,
|
|
1504
1506
|
activeSubtitle: a,
|
|
1505
1507
|
subtitleCues: o,
|
|
@@ -1517,64 +1519,61 @@ function bt(e) {
|
|
|
1517
1519
|
}
|
|
1518
1520
|
})();
|
|
1519
1521
|
}
|
|
1520
|
-
n.subtitles?.length &&
|
|
1521
|
-
function de() {
|
|
1522
|
-
return n.mediaSessionArtwork ?? n.poster;
|
|
1523
|
-
}
|
|
1522
|
+
n.subtitles?.length && se(n.subtitles), le();
|
|
1524
1523
|
function fe() {
|
|
1525
1524
|
o.register({
|
|
1526
1525
|
key: "Space",
|
|
1527
1526
|
description: "Toggle play/pause",
|
|
1528
1527
|
handler: (e) => {
|
|
1529
|
-
e.preventDefault(),
|
|
1528
|
+
e.preventDefault(), O.togglePlay();
|
|
1530
1529
|
}
|
|
1531
1530
|
}), o.register({
|
|
1532
1531
|
key: "KeyK",
|
|
1533
1532
|
description: "Toggle play/pause",
|
|
1534
1533
|
handler: (e) => {
|
|
1535
|
-
e.preventDefault(),
|
|
1534
|
+
e.preventDefault(), O.togglePlay();
|
|
1536
1535
|
}
|
|
1537
1536
|
}), o.register({
|
|
1538
1537
|
key: "KeyL",
|
|
1539
1538
|
description: "Toggle loop",
|
|
1540
1539
|
handler: (e) => {
|
|
1541
|
-
e.preventDefault(),
|
|
1540
|
+
e.preventDefault(), O.toggleLoop();
|
|
1542
1541
|
}
|
|
1543
1542
|
}), o.register({
|
|
1544
1543
|
key: "KeyI",
|
|
1545
1544
|
description: "Toggle info panel",
|
|
1546
1545
|
handler: (e) => {
|
|
1547
|
-
e.preventDefault(),
|
|
1546
|
+
e.preventDefault(), O.toggleInfoPanel();
|
|
1548
1547
|
}
|
|
1549
1548
|
}), o.register({
|
|
1550
1549
|
key: "KeyF",
|
|
1551
1550
|
description: "Toggle fullscreen",
|
|
1552
1551
|
handler: (e) => {
|
|
1553
|
-
e.preventDefault(),
|
|
1552
|
+
e.preventDefault(), O.toggleFullscreen();
|
|
1554
1553
|
}
|
|
1555
1554
|
}), o.register({
|
|
1556
1555
|
key: "KeyA",
|
|
1557
1556
|
description: "Cycle aspect ratio",
|
|
1558
1557
|
handler: (e) => {
|
|
1559
|
-
e.preventDefault(),
|
|
1558
|
+
e.preventDefault(), O.cycleAspectRatio();
|
|
1560
1559
|
}
|
|
1561
1560
|
}), o.register({
|
|
1562
1561
|
key: "KeyM",
|
|
1563
1562
|
description: "Toggle mute",
|
|
1564
1563
|
handler: (e) => {
|
|
1565
|
-
e.preventDefault(),
|
|
1564
|
+
e.preventDefault(), O.toggleMute();
|
|
1566
1565
|
}
|
|
1567
1566
|
}), o.register({
|
|
1568
1567
|
key: "ArrowLeft",
|
|
1569
1568
|
description: "Seek backward 5s",
|
|
1570
1569
|
handler: (e) => {
|
|
1571
|
-
e.preventDefault(),
|
|
1570
|
+
e.preventDefault(), O.skip(-5);
|
|
1572
1571
|
}
|
|
1573
1572
|
}), o.register({
|
|
1574
1573
|
key: "ArrowRight",
|
|
1575
1574
|
description: "Seek forward 5s",
|
|
1576
1575
|
handler: (e) => {
|
|
1577
|
-
e.preventDefault(),
|
|
1576
|
+
e.preventDefault(), O.skip(5);
|
|
1578
1577
|
}
|
|
1579
1578
|
}), o.register({
|
|
1580
1579
|
key: "ArrowUp",
|
|
@@ -1582,7 +1581,7 @@ function bt(e) {
|
|
|
1582
1581
|
handler: (e) => {
|
|
1583
1582
|
e.preventDefault();
|
|
1584
1583
|
let n = Math.min(1, t.state.volume + .1);
|
|
1585
|
-
|
|
1584
|
+
O.setVolume(n);
|
|
1586
1585
|
}
|
|
1587
1586
|
}), o.register({
|
|
1588
1587
|
key: "ArrowDown",
|
|
@@ -1590,7 +1589,7 @@ function bt(e) {
|
|
|
1590
1589
|
handler: (e) => {
|
|
1591
1590
|
e.preventDefault();
|
|
1592
1591
|
let n = Math.max(0, t.state.volume - .1);
|
|
1593
|
-
|
|
1592
|
+
O.setVolume(n);
|
|
1594
1593
|
}
|
|
1595
1594
|
});
|
|
1596
1595
|
}
|
|
@@ -1604,7 +1603,7 @@ function bt(e) {
|
|
|
1604
1603
|
capabilities: De(u?.element ?? void 0, l)
|
|
1605
1604
|
}));
|
|
1606
1605
|
}
|
|
1607
|
-
let
|
|
1606
|
+
let O = {
|
|
1608
1607
|
play: () => {
|
|
1609
1608
|
u?.play();
|
|
1610
1609
|
},
|
|
@@ -1625,7 +1624,7 @@ function bt(e) {
|
|
|
1625
1624
|
t.setState((e) => ({
|
|
1626
1625
|
...e,
|
|
1627
1626
|
resumeState: { status: "idle" }
|
|
1628
|
-
})), u?.seek(0),
|
|
1627
|
+
})), u?.seek(0), re(e);
|
|
1629
1628
|
},
|
|
1630
1629
|
dismissSavedProgress: () => {
|
|
1631
1630
|
t.setState((e) => ({
|
|
@@ -1686,20 +1685,20 @@ function bt(e) {
|
|
|
1686
1685
|
}));
|
|
1687
1686
|
return;
|
|
1688
1687
|
}
|
|
1689
|
-
|
|
1688
|
+
ce(e);
|
|
1690
1689
|
},
|
|
1691
1690
|
addSubtitleTrack: (e) => {
|
|
1692
1691
|
let t = yt(e);
|
|
1693
|
-
|
|
1692
|
+
se([t]), ce(t);
|
|
1694
1693
|
},
|
|
1695
1694
|
removeSubtitleTrack: (e) => {
|
|
1696
|
-
t.state.activeSubtitle?.id === e &&
|
|
1695
|
+
t.state.activeSubtitle?.id === e && O.setActiveSubtitle(null), t.setState((t) => ({
|
|
1697
1696
|
...t,
|
|
1698
1697
|
subtitleTracks: t.subtitleTracks.filter((t) => t.id !== e)
|
|
1699
1698
|
}));
|
|
1700
1699
|
},
|
|
1701
|
-
searchSubtitles:
|
|
1702
|
-
selectSubtitleResult:
|
|
1700
|
+
searchSubtitles: ue,
|
|
1701
|
+
selectSubtitleResult: de,
|
|
1703
1702
|
clearSubtitleSearch: () => {
|
|
1704
1703
|
v?.abort(), v = null, t.setState((e) => ({
|
|
1705
1704
|
...e,
|
|
@@ -1766,7 +1765,7 @@ function bt(e) {
|
|
|
1766
1765
|
},
|
|
1767
1766
|
cycleAspectRatio: () => {
|
|
1768
1767
|
let e = t.state.aspectRatio, n = ut[(ut.indexOf(e) + 1) % ut.length] ?? "default";
|
|
1769
|
-
|
|
1768
|
+
O.setAspectRatio(n);
|
|
1770
1769
|
},
|
|
1771
1770
|
toggleLoop: () => {
|
|
1772
1771
|
let e = u;
|
|
@@ -1782,10 +1781,10 @@ function bt(e) {
|
|
|
1782
1781
|
}));
|
|
1783
1782
|
}
|
|
1784
1783
|
};
|
|
1785
|
-
function
|
|
1784
|
+
function k(e) {
|
|
1786
1785
|
return [
|
|
1787
1786
|
e.on("play", () => {
|
|
1788
|
-
y.syncMetadata(n.title,
|
|
1787
|
+
y.syncMetadata(n.title, n.mediaSession, n.poster), y.setPlaybackState("playing"), t.setState((e) => ({
|
|
1789
1788
|
...e,
|
|
1790
1789
|
status: "playing",
|
|
1791
1790
|
isPlaying: !0,
|
|
@@ -1803,7 +1802,7 @@ function bt(e) {
|
|
|
1803
1802
|
isPaused: !e.isEnded,
|
|
1804
1803
|
isBuffering: !1,
|
|
1805
1804
|
controlsVisible: !0
|
|
1806
|
-
})), y.setPlaybackState("paused"), y.syncPosition(e.duration, e.currentTime, e.playbackRate, !0), e.ended ||
|
|
1805
|
+
})), y.setPlaybackState("paused"), y.syncPosition(e.duration, e.currentTime, e.playbackRate, !0), e.ended || ie(E, e);
|
|
1807
1806
|
}),
|
|
1808
1807
|
e.on("ended", () => {
|
|
1809
1808
|
f = 0, p = NaN;
|
|
@@ -1811,7 +1810,7 @@ function bt(e) {
|
|
|
1811
1810
|
let t = w[e];
|
|
1812
1811
|
t?.kind === "save" && t.target.generation === E.generation && w.splice(e, 1);
|
|
1813
1812
|
}
|
|
1814
|
-
|
|
1813
|
+
re(E), y.setPlaybackState("paused"), y.syncPosition(e.duration, e.currentTime, e.playbackRate, !0), t.setState((e) => ({
|
|
1815
1814
|
...e,
|
|
1816
1815
|
status: "ended",
|
|
1817
1816
|
isPlaying: !1,
|
|
@@ -1826,7 +1825,7 @@ function bt(e) {
|
|
|
1826
1825
|
t.setState((t) => ({
|
|
1827
1826
|
...t,
|
|
1828
1827
|
currentTime: e.currentTime
|
|
1829
|
-
})), n.onTimeUpdate?.(e.currentTime), y.syncPosition(e.duration, e.currentTime, e.playbackRate),
|
|
1828
|
+
})), n.onTimeUpdate?.(e.currentTime), y.syncPosition(e.duration, e.currentTime, e.playbackRate), D(e);
|
|
1830
1829
|
}),
|
|
1831
1830
|
e.on("loadedmetadata", () => {
|
|
1832
1831
|
m !== null && (clearTimeout(m), m = null), h = 0, t.setState((t) => ({
|
|
@@ -1838,7 +1837,7 @@ function bt(e) {
|
|
|
1838
1837
|
isMuted: e.muted,
|
|
1839
1838
|
playbackRate: e.playbackRate,
|
|
1840
1839
|
error: null
|
|
1841
|
-
})),
|
|
1840
|
+
})), oe(e);
|
|
1842
1841
|
}),
|
|
1843
1842
|
e.on("progress", () => {
|
|
1844
1843
|
let n = e.buffered;
|
|
@@ -1869,7 +1868,7 @@ function bt(e) {
|
|
|
1869
1868
|
...t,
|
|
1870
1869
|
duration: Oe(e.duration) ? e.duration : 0,
|
|
1871
1870
|
isLive: !Oe(e.duration)
|
|
1872
|
-
})),
|
|
1871
|
+
})), oe(e);
|
|
1873
1872
|
}),
|
|
1874
1873
|
e.on("seeking", () => {
|
|
1875
1874
|
t.setState((e) => ({
|
|
@@ -1881,7 +1880,7 @@ function bt(e) {
|
|
|
1881
1880
|
t.setState((e) => ({
|
|
1882
1881
|
...e,
|
|
1883
1882
|
status: e.isPlaying ? "playing" : "ready"
|
|
1884
|
-
})), y.syncPosition(e.duration, e.currentTime, e.playbackRate, !0),
|
|
1883
|
+
})), y.syncPosition(e.duration, e.currentTime, e.playbackRate, !0), ie(E, e);
|
|
1885
1884
|
}),
|
|
1886
1885
|
e.on("playing", () => {
|
|
1887
1886
|
t.setState((e) => ({
|
|
@@ -1940,8 +1939,8 @@ function bt(e) {
|
|
|
1940
1939
|
})
|
|
1941
1940
|
];
|
|
1942
1941
|
}
|
|
1943
|
-
let
|
|
1944
|
-
function
|
|
1942
|
+
let me = null;
|
|
1943
|
+
function he() {
|
|
1945
1944
|
let e = i.get(M.CAPTION_SETTINGS);
|
|
1946
1945
|
e && t.setState((t) => ({
|
|
1947
1946
|
...t,
|
|
@@ -1952,7 +1951,7 @@ function bt(e) {
|
|
|
1952
1951
|
}
|
|
1953
1952
|
}));
|
|
1954
1953
|
}
|
|
1955
|
-
function
|
|
1954
|
+
function A() {
|
|
1956
1955
|
if (!n.persistPreferences) return;
|
|
1957
1956
|
let e = i.get(M.VOLUME), r = i.get(M.MUTED), a = i.get(M.PLAYBACK_RATE), o = i.get(M.LOOP), s = i.get(M.FLIP), c = i.get(M.ASPECT_RATIO);
|
|
1958
1957
|
t.setState((t) => ({
|
|
@@ -1963,18 +1962,18 @@ function bt(e) {
|
|
|
1963
1962
|
isLooping: o ?? t.isLooping,
|
|
1964
1963
|
flip: s ?? t.flip,
|
|
1965
1964
|
aspectRatio: _t(c)
|
|
1966
|
-
})),
|
|
1965
|
+
})), he(), me = t.subscribe(() => {
|
|
1967
1966
|
let e = t.state;
|
|
1968
1967
|
e.volume !== 1 && i.set(M.VOLUME, e.volume), e.isMuted && i.set(M.MUTED, !0), e.playbackRate !== 1 && i.set(M.PLAYBACK_RATE, e.playbackRate), e.isLooping ? i.set(M.LOOP, !0) : i.remove(M.LOOP), e.flip === "normal" ? i.remove(M.FLIP) : i.set(M.FLIP, e.flip), e.aspectRatio === "default" ? i.remove(M.ASPECT_RATIO) : i.set(M.ASPECT_RATIO, e.aspectRatio), i.set(M.CAPTION_SETTINGS, e.captionSettings);
|
|
1969
1968
|
});
|
|
1970
1969
|
}
|
|
1971
|
-
function
|
|
1972
|
-
if (
|
|
1973
|
-
let e =
|
|
1974
|
-
typeof e == "function" ? e() : e.unsubscribe(),
|
|
1970
|
+
function ge() {
|
|
1971
|
+
if (me) {
|
|
1972
|
+
let e = me;
|
|
1973
|
+
typeof e == "function" ? e() : e.unsubscribe(), me = null;
|
|
1975
1974
|
}
|
|
1976
1975
|
}
|
|
1977
|
-
function
|
|
1976
|
+
function _e(e) {
|
|
1978
1977
|
if (g?.abort(), g = null, !e) {
|
|
1979
1978
|
t.setState((e) => ({
|
|
1980
1979
|
...e,
|
|
@@ -1995,11 +1994,11 @@ function bt(e) {
|
|
|
1995
1994
|
})));
|
|
1996
1995
|
});
|
|
1997
1996
|
}
|
|
1998
|
-
function
|
|
1997
|
+
function j(e) {
|
|
1999
1998
|
return {
|
|
2000
1999
|
name: e,
|
|
2001
2000
|
store: t,
|
|
2002
|
-
remote:
|
|
2001
|
+
remote: O,
|
|
2003
2002
|
events: r,
|
|
2004
2003
|
storage: i,
|
|
2005
2004
|
hotkeys: o,
|
|
@@ -2078,15 +2077,15 @@ function bt(e) {
|
|
|
2078
2077
|
}
|
|
2079
2078
|
};
|
|
2080
2079
|
}
|
|
2081
|
-
let
|
|
2082
|
-
function
|
|
2080
|
+
let be = [];
|
|
2081
|
+
function Se(e = !0) {
|
|
2083
2082
|
m !== null && (clearTimeout(m), m = null), h = 0;
|
|
2084
|
-
for (let e of
|
|
2085
|
-
|
|
2083
|
+
for (let e of be) e();
|
|
2084
|
+
be = [], u && (e && ie(E, u), u.pause(), u.destroy(), u = null, Te.engine = null);
|
|
2086
2085
|
}
|
|
2087
|
-
function
|
|
2086
|
+
function Ce(e) {
|
|
2088
2087
|
let r = We(n), i = Ge(e, n);
|
|
2089
|
-
u = i,
|
|
2088
|
+
u = i, Te.engine = i, be = k(i), e.playsInline = !0, e.autoplay = !!n.autoPlay, e.preload = e.preload || "metadata", y.setPlaybackState("paused"), t.setState((t) => ({
|
|
2090
2089
|
...t,
|
|
2091
2090
|
status: "loading",
|
|
2092
2091
|
source: r,
|
|
@@ -2101,16 +2100,16 @@ function bt(e) {
|
|
|
2101
2100
|
error: null
|
|
2102
2101
|
})), n.autoPlay && i.play();
|
|
2103
2102
|
}
|
|
2104
|
-
function
|
|
2103
|
+
function we(e = !0) {
|
|
2105
2104
|
let t = u?.element;
|
|
2106
2105
|
if (t) {
|
|
2107
|
-
for (
|
|
2108
|
-
t.load(),
|
|
2106
|
+
for (Se(e), t.pause(), t.removeAttribute("src"); t.firstChild;) t.removeChild(t.firstChild);
|
|
2107
|
+
t.load(), Ce(t);
|
|
2109
2108
|
}
|
|
2110
2109
|
}
|
|
2111
|
-
let
|
|
2110
|
+
let Te = {
|
|
2112
2111
|
store: t,
|
|
2113
|
-
remote:
|
|
2112
|
+
remote: O,
|
|
2114
2113
|
events: r,
|
|
2115
2114
|
storage: i,
|
|
2116
2115
|
i18n: a,
|
|
@@ -2121,29 +2120,29 @@ function bt(e) {
|
|
|
2121
2120
|
...n,
|
|
2122
2121
|
...e
|
|
2123
2122
|
}, l = ee(c), d = l.id !== E.id || l.store !== E.store;
|
|
2124
|
-
if ((r || d) &&
|
|
2123
|
+
if ((r || d) && ie(E, u), n = c, (r || d) && ae(), (t.state.isPlaying || y.hasMetadata) && y.syncMetadata(n.title, n.mediaSession, n.poster), t.setState((t) => {
|
|
2125
2124
|
let n = e.qualities ?? t.qualities;
|
|
2126
2125
|
return {
|
|
2127
2126
|
...t,
|
|
2128
2127
|
qualities: n,
|
|
2129
2128
|
activeQuality: e.qualities ? e.qualities.includes(t.activeQuality) ? t.activeQuality : e.qualities[0] ?? "Auto" : t.activeQuality
|
|
2130
2129
|
};
|
|
2131
|
-
}), e.subtitles && (
|
|
2130
|
+
}), e.subtitles && (se(e.subtitles), !t.state.activeSubtitle)) {
|
|
2132
2131
|
let t = e.subtitles.find((e) => e.default) ?? null;
|
|
2133
|
-
t &&
|
|
2132
|
+
t && O.setActiveSubtitle(yt(t));
|
|
2134
2133
|
}
|
|
2135
|
-
s && (v?.abort(), v = null,
|
|
2134
|
+
s && (v?.abort(), v = null, le()), (a || o) && _e(n.thumbnails), r || i ? we(!(r || d)) : d && u && Oe(u.duration) && oe(u);
|
|
2136
2135
|
},
|
|
2137
2136
|
setThumbnails(e) {
|
|
2138
2137
|
n = {
|
|
2139
2138
|
...n,
|
|
2140
2139
|
thumbnails: e
|
|
2141
|
-
},
|
|
2140
|
+
}, _e(e);
|
|
2142
2141
|
},
|
|
2143
2142
|
initPlugins(e) {
|
|
2144
2143
|
let t = [];
|
|
2145
2144
|
for (let n of e) {
|
|
2146
|
-
let e =
|
|
2145
|
+
let e = j(n.name);
|
|
2147
2146
|
try {
|
|
2148
2147
|
let r = n.setup?.(e);
|
|
2149
2148
|
typeof r == "function" && t.push(r);
|
|
@@ -2160,12 +2159,12 @@ function bt(e) {
|
|
|
2160
2159
|
};
|
|
2161
2160
|
},
|
|
2162
2161
|
mount(e, r) {
|
|
2163
|
-
u && this.unmount(), l = r,
|
|
2162
|
+
u && this.unmount(), l = r, Ce(e), d = pe, document.addEventListener("fullscreenchange", d), document.addEventListener("webkitfullscreenchange", d), C = () => ie(), window.addEventListener("pagehide", C), y.setup(O), _e(n.thumbnails);
|
|
2164
2163
|
let i = t.state.subtitleTracks.find((e) => e.default);
|
|
2165
|
-
i &&
|
|
2164
|
+
i && O.setActiveSubtitle(i), he(), A(), O.setAspectRatio(t.state.aspectRatio);
|
|
2166
2165
|
},
|
|
2167
2166
|
unmount() {
|
|
2168
|
-
|
|
2167
|
+
Se(), ae(), y.teardown(), l = null, g?.abort(), g = null, _?.abort(), _ = null, v?.abort(), v = null, ge(), m !== null && (clearTimeout(m), m = null), d &&= (document.removeEventListener("fullscreenchange", d), document.removeEventListener("webkitfullscreenchange", d), null), C &&= (window.removeEventListener("pagehide", C), null), t.setState((e) => ({
|
|
2169
2168
|
...e,
|
|
2170
2169
|
activeSubtitle: null,
|
|
2171
2170
|
subtitleTracks: e.subtitleTracks.filter((e) => !e.local),
|
|
@@ -2183,7 +2182,7 @@ function bt(e) {
|
|
|
2183
2182
|
this.unmount(), r.clear();
|
|
2184
2183
|
}
|
|
2185
2184
|
};
|
|
2186
|
-
return
|
|
2185
|
+
return Te;
|
|
2187
2186
|
}
|
|
2188
2187
|
function xt(e, t) {
|
|
2189
2188
|
let n = null, r = null, i = null, a = typeof window < "u" && "ontouchstart" in window;
|
|
@@ -2564,7 +2563,7 @@ var Nt = () => {
|
|
|
2564
2563
|
});
|
|
2565
2564
|
}, It = {
|
|
2566
2565
|
name: "@vplayer/react",
|
|
2567
|
-
version: "0.
|
|
2566
|
+
version: "0.4.0",
|
|
2568
2567
|
private: !1,
|
|
2569
2568
|
repository: {
|
|
2570
2569
|
type: "git",
|
|
@@ -2600,7 +2599,7 @@ var Nt = () => {
|
|
|
2600
2599
|
"@ark-ui/react": "5.39.1",
|
|
2601
2600
|
"@tanstack/react-store": "^0.11.1",
|
|
2602
2601
|
"@tanstack/store": "^0.11.1",
|
|
2603
|
-
"@vplayer/core": "workspace:^0.
|
|
2602
|
+
"@vplayer/core": "workspace:^0.4.0",
|
|
2604
2603
|
clsx: "^2.1.1"
|
|
2605
2604
|
},
|
|
2606
2605
|
devDependencies: {
|
|
@@ -4538,15 +4537,15 @@ var mo = 50, ho = async (e, t, n) => {
|
|
|
4538
4537
|
y: r
|
|
4539
4538
|
}, p = Za(i), m = Ya(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
|
|
4540
4539
|
(!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
|
|
4541
|
-
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, ee = Ra(d[_], T), E = Ra(d[v], T), te = C - h[m] - E,
|
|
4540
|
+
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, ee = Ra(d[_], T), E = Ra(d[v], T), te = C - h[m] - E, ne = C / 2 - h[m] / 2 + w, re = Wa(ee, ne, te), ie = !c.arrow && qa(i) != null && ne !== re && a.reference[m] / 2 - (ne < ee ? ee : E) - h[m] / 2 < 0, D = ie ? ne < ee ? ne - ee : ne - te : 0;
|
|
4542
4541
|
return {
|
|
4543
|
-
[p]: f[p] +
|
|
4542
|
+
[p]: f[p] + D,
|
|
4544
4543
|
data: {
|
|
4545
|
-
[p]:
|
|
4546
|
-
centerOffset:
|
|
4547
|
-
...
|
|
4544
|
+
[p]: re,
|
|
4545
|
+
centerOffset: ne - re - D,
|
|
4546
|
+
...ie && { alignmentOffset: D }
|
|
4548
4547
|
},
|
|
4549
|
-
reset:
|
|
4548
|
+
reset: ie
|
|
4550
4549
|
};
|
|
4551
4550
|
}
|
|
4552
4551
|
}), _o = function(e) {
|
|
@@ -6678,7 +6677,7 @@ function Vu(e, t = {}) {
|
|
|
6678
6677
|
queueMicrotask(() => {
|
|
6679
6678
|
if (E.current !== vu.Started) return;
|
|
6680
6679
|
u.current = d.current, d.current = t;
|
|
6681
|
-
let n =
|
|
6680
|
+
let n = ne(), { transitions: i, source: a } = du(e, n, t.type), o = w(i);
|
|
6682
6681
|
if (!o) return;
|
|
6683
6682
|
l.current = o;
|
|
6684
6683
|
let s = uu(e, o.target ?? n, a);
|
|
@@ -6772,13 +6771,13 @@ function Vu(e, t = {}) {
|
|
|
6772
6771
|
});
|
|
6773
6772
|
let t = c.current;
|
|
6774
6773
|
return () => {
|
|
6775
|
-
let n =
|
|
6774
|
+
let n = ne();
|
|
6776
6775
|
r("unmounting..."), ee.current = n, E.current = vu.Stopped, t.forEach((e) => e?.()), c.current = /* @__PURE__ */ new Map(), l.current = null, queueMicrotask(() => {
|
|
6777
6776
|
x(e.exit), E.current = vu.Stopped;
|
|
6778
6777
|
});
|
|
6779
6778
|
};
|
|
6780
6779
|
}, []);
|
|
6781
|
-
let
|
|
6780
|
+
let ne = () => "ref" in T ? T.ref.current : T.get();
|
|
6782
6781
|
return e.watch?.(b()), {
|
|
6783
6782
|
state: h(),
|
|
6784
6783
|
send: _,
|
|
@@ -16475,7 +16474,7 @@ function Ox(e) {
|
|
|
16475
16474
|
};
|
|
16476
16475
|
}
|
|
16477
16476
|
function kx({ className: e = "", children: t, ...n }) {
|
|
16478
|
-
let r = m(null), i = m(null), a = m(null), o = n.src, s = n.title, l = n.poster, d = n.
|
|
16477
|
+
let r = m(null), i = m(null), a = m(null), o = n.src, s = n.title, l = n.poster, d = n.mediaSession, f = n.type, g = n.autoPlay, y = n.subtitles, b = n.subtitleProviders, x = n.subtitleSearchDefaultQuery ?? "", S = n.qualities, C = n.thumbnails, w = n.transformThumbnailVTT, T = w !== void 0, ee = m(w), E = n.playbackProgress?.id, te = n.playbackProgress?.store, ne = n.playbackProgress?.normalizeUrl, re = n.playbackProgress?.resumePromptTimeout, ie = n.plugins, D = n.labels, ae = n.icons, oe = n.slots ?? {}, se = n.miniPlayer, ce = n.thumbnailPreview, le = l ? `${o}\0${l}` : null, [ue, de] = h(null), [fe, pe] = h(null), O = le !== null && ue === le, { instance: k, attach: me, detach: he } = Jt(n);
|
|
16479
16478
|
u(() => {
|
|
16480
16479
|
let e = a.current, t = i.current;
|
|
16481
16480
|
return e && t && me(t, e), () => he();
|
|
@@ -16487,7 +16486,7 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16487
16486
|
type: f,
|
|
16488
16487
|
title: s,
|
|
16489
16488
|
poster: l,
|
|
16490
|
-
|
|
16489
|
+
mediaSession: d,
|
|
16491
16490
|
subtitles: y,
|
|
16492
16491
|
subtitleProviders: b,
|
|
16493
16492
|
qualities: S,
|
|
@@ -16497,8 +16496,8 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16497
16496
|
playbackProgress: {
|
|
16498
16497
|
id: E,
|
|
16499
16498
|
store: te,
|
|
16500
|
-
normalizeUrl:
|
|
16501
|
-
resumePromptTimeout:
|
|
16499
|
+
normalizeUrl: ne,
|
|
16500
|
+
resumePromptTimeout: re
|
|
16502
16501
|
}
|
|
16503
16502
|
});
|
|
16504
16503
|
}, [
|
|
@@ -16515,13 +16514,13 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16515
16514
|
g,
|
|
16516
16515
|
E,
|
|
16517
16516
|
te,
|
|
16518
|
-
D,
|
|
16519
16517
|
ne,
|
|
16518
|
+
re,
|
|
16520
16519
|
k
|
|
16521
|
-
]), u(() => k.initPlugins(
|
|
16520
|
+
]), u(() => k.initPlugins(ie ?? []), [ie, k]);
|
|
16522
16521
|
let A = Ut(k.store), ge = _e(k.store, (e) => e.controlsVisible), ve = _e(k.store, (e) => e.isPlaying);
|
|
16523
|
-
ve &&
|
|
16524
|
-
let ye =
|
|
16522
|
+
ve && fe !== o && pe(o);
|
|
16523
|
+
let ye = fe === o, j = Gt(r, se), be = p(() => Ox(ce), [ce]);
|
|
16525
16524
|
u(() => {
|
|
16526
16525
|
j.active && (A.showControls(), A.scheduleHide(1400));
|
|
16527
16526
|
}, [A, j.active]), u(() => {
|
|
@@ -16538,7 +16537,7 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16538
16537
|
]);
|
|
16539
16538
|
let xe = c((e) => {
|
|
16540
16539
|
e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target.isContentEditable || (A.showControls(), k.hotkeys.handleKeyDown(e));
|
|
16541
|
-
}, [k.hotkeys, A]), Se = p(() => Ex(Ct,
|
|
16540
|
+
}, [k.hotkeys, A]), Se = p(() => Ex(Ct, D), [D]), Ce = p(() => Dx(hn, ae), [ae]), we = p(() => ({
|
|
16542
16541
|
ref: a,
|
|
16543
16542
|
className: "vplayer__video",
|
|
16544
16543
|
autoPlay: g,
|
|
@@ -16553,7 +16552,7 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16553
16552
|
labels: Se,
|
|
16554
16553
|
subtitleSearchDefaultQuery: x,
|
|
16555
16554
|
icons: Ce,
|
|
16556
|
-
slots:
|
|
16555
|
+
slots: oe,
|
|
16557
16556
|
mediaStore: k.store,
|
|
16558
16557
|
mediaRemote: k.remote,
|
|
16559
16558
|
events: k.events,
|
|
@@ -16570,7 +16569,7 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16570
16569
|
k,
|
|
16571
16570
|
Se,
|
|
16572
16571
|
Ce,
|
|
16573
|
-
|
|
16572
|
+
oe,
|
|
16574
16573
|
A,
|
|
16575
16574
|
j,
|
|
16576
16575
|
x,
|
|
@@ -16620,8 +16619,8 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16620
16619
|
alt: "",
|
|
16621
16620
|
"aria-hidden": "true",
|
|
16622
16621
|
"data-testid": "vplayer-poster",
|
|
16623
|
-
onLoad: () =>
|
|
16624
|
-
className: Tt("vplayer__poster",
|
|
16622
|
+
onLoad: () => de(le),
|
|
16623
|
+
className: Tt("vplayer__poster", O && "vplayer__poster--loaded", ye && "vplayer__poster--hidden")
|
|
16625
16624
|
})]
|
|
16626
16625
|
}),
|
|
16627
16626
|
t ?? /* @__PURE__ */ _(Sx, {}),
|
|
@@ -16629,7 +16628,7 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16629
16628
|
j.active && /* @__PURE__ */ _(Bt, {}),
|
|
16630
16629
|
/* @__PURE__ */ _(Nt, {}),
|
|
16631
16630
|
/* @__PURE__ */ _(Ft, {}),
|
|
16632
|
-
/* @__PURE__ */ _(At, { timeout:
|
|
16631
|
+
/* @__PURE__ */ _(At, { timeout: re }),
|
|
16633
16632
|
/* @__PURE__ */ _(Pt, {}),
|
|
16634
16633
|
/* @__PURE__ */ _(zt, {}),
|
|
16635
16634
|
/* @__PURE__ */ _("div", {
|
|
@@ -16644,7 +16643,7 @@ function kx({ className: e = "", children: t, ...n }) {
|
|
|
16644
16643
|
//#endregion
|
|
16645
16644
|
//#region src/components/player/layout/compact-video-layout.tsx
|
|
16646
16645
|
var Ax = () => /* @__PURE__ */ _(Sx, {}), jx = () => /* @__PURE__ */ _(Sx, {}), Mx = ({ options: e, labels: t, icons: n, slots: r = {}, children: i }) => {
|
|
16647
|
-
let { instance: a, attach: o, detach: s } = Jt(e), c = m(null), l = m(null), d = e.src, f = e.type, h = e.title, g = e.poster, v = e.
|
|
16646
|
+
let { instance: a, attach: o, detach: s } = Jt(e), c = m(null), l = m(null), d = e.src, f = e.type, h = e.title, g = e.poster, v = e.mediaSession, y = e.autoPlay, b = e.subtitles, x = e.subtitleProviders, S = e.subtitleSearchDefaultQuery ?? "", C = e.qualities, w = e.thumbnails, T = e.transformThumbnailVTT, ee = T !== void 0, E = m(T), te = e.playbackProgress?.id, ne = e.playbackProgress?.store, re = e.playbackProgress?.normalizeUrl, ie = e.playbackProgress?.resumePromptTimeout, D = e.plugins;
|
|
16648
16647
|
u(() => {
|
|
16649
16648
|
let e = c.current, t = l.current;
|
|
16650
16649
|
return e && t && o(e, t), () => s();
|
|
@@ -16656,7 +16655,7 @@ var Ax = () => /* @__PURE__ */ _(Sx, {}), jx = () => /* @__PURE__ */ _(Sx, {}),
|
|
|
16656
16655
|
type: f,
|
|
16657
16656
|
title: h,
|
|
16658
16657
|
poster: g,
|
|
16659
|
-
|
|
16658
|
+
mediaSession: v,
|
|
16660
16659
|
autoPlay: y,
|
|
16661
16660
|
subtitles: b,
|
|
16662
16661
|
subtitleProviders: x,
|
|
@@ -16665,9 +16664,9 @@ var Ax = () => /* @__PURE__ */ _(Sx, {}), jx = () => /* @__PURE__ */ _(Sx, {}),
|
|
|
16665
16664
|
transformThumbnailVTT: ee ? E.current : void 0,
|
|
16666
16665
|
playbackProgress: {
|
|
16667
16666
|
id: te,
|
|
16668
|
-
store:
|
|
16669
|
-
normalizeUrl:
|
|
16670
|
-
resumePromptTimeout:
|
|
16667
|
+
store: ne,
|
|
16668
|
+
normalizeUrl: re,
|
|
16669
|
+
resumePromptTimeout: ie
|
|
16671
16670
|
}
|
|
16672
16671
|
});
|
|
16673
16672
|
}, [
|
|
@@ -16683,24 +16682,24 @@ var Ax = () => /* @__PURE__ */ _(Sx, {}), jx = () => /* @__PURE__ */ _(Sx, {}),
|
|
|
16683
16682
|
w,
|
|
16684
16683
|
ee,
|
|
16685
16684
|
te,
|
|
16686
|
-
D,
|
|
16687
16685
|
ne,
|
|
16688
16686
|
re,
|
|
16687
|
+
ie,
|
|
16689
16688
|
a
|
|
16690
|
-
]), u(() => a.initPlugins(
|
|
16691
|
-
let
|
|
16689
|
+
]), u(() => a.initPlugins(D ?? []), [D, a]);
|
|
16690
|
+
let ae = Ex(Ct, t), oe = Dx(hn, n), se = p(() => Kt(), []), ce = p(() => ({
|
|
16692
16691
|
enabled: !0,
|
|
16693
16692
|
width: 180,
|
|
16694
16693
|
height: 101,
|
|
16695
16694
|
gap: 10,
|
|
16696
16695
|
showTime: !0,
|
|
16697
16696
|
fit: "cover"
|
|
16698
|
-
}), []),
|
|
16697
|
+
}), []), le = {
|
|
16699
16698
|
containerRef: c,
|
|
16700
16699
|
videoRef: l,
|
|
16701
|
-
labels:
|
|
16700
|
+
labels: ae,
|
|
16702
16701
|
subtitleSearchDefaultQuery: S,
|
|
16703
|
-
icons:
|
|
16702
|
+
icons: oe,
|
|
16704
16703
|
slots: r,
|
|
16705
16704
|
mediaStore: a.store,
|
|
16706
16705
|
mediaRemote: a.remote,
|
|
@@ -16712,11 +16711,11 @@ var Ax = () => /* @__PURE__ */ _(Sx, {}), jx = () => /* @__PURE__ */ _(Sx, {}),
|
|
|
16712
16711
|
instance: a,
|
|
16713
16712
|
createPluginAPI: Tx,
|
|
16714
16713
|
controlsVisibility: { pinControls: () => () => {} },
|
|
16715
|
-
miniPlayer:
|
|
16716
|
-
thumbnailPreview:
|
|
16714
|
+
miniPlayer: se,
|
|
16715
|
+
thumbnailPreview: ce
|
|
16717
16716
|
};
|
|
16718
16717
|
return /* @__PURE__ */ _(Et.Provider, {
|
|
16719
|
-
value:
|
|
16718
|
+
value: le,
|
|
16720
16719
|
children: i
|
|
16721
16720
|
});
|
|
16722
16721
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vplayer/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@ark-ui/react": "5.39.1",
|
|
39
39
|
"@tanstack/react-store": "^0.11.1",
|
|
40
40
|
"@tanstack/store": "^0.11.1",
|
|
41
|
-
"@vplayer/core": "^0.
|
|
41
|
+
"@vplayer/core": "^0.4.0",
|
|
42
42
|
"clsx": "^2.1.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|