@netless/window-manager 1.0.0-canary.64 → 1.0.0-canary.66
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 +248 -222
- package/dist/index.mjs +248 -222
- package/dist/index.umd.js +248 -222
- package/dist/src/View/CameraSynchronizer.d.ts +1 -0
- package/dist/src/View/MainView.d.ts +6 -0
- package/dist/src/index.d.ts +2 -6
- package/dist/src/typings.d.ts +4 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/View/CameraSynchronizer.ts +1 -0
- package/src/View/MainView.ts +44 -2
- package/src/View/ScrollMode.ts +1 -0
- package/src/index.ts +6 -21
- package/src/typings.ts +3 -0
package/dist/index.mjs
CHANGED
@@ -1266,6 +1266,7 @@ class CameraSynchronizer {
|
|
1266
1266
|
constructor(saveCamera) {
|
1267
1267
|
this.saveCamera = saveCamera;
|
1268
1268
|
this.scale = 1;
|
1269
|
+
this.cameraUpdating = false;
|
1269
1270
|
this.setRect = (rect, updateCamera = true) => {
|
1270
1271
|
this.rect = rect;
|
1271
1272
|
if (this.remoteCamera && this.remoteSize && updateCamera) {
|
@@ -2466,6 +2467,39 @@ class MainViewProxy {
|
|
2466
2467
|
})
|
2467
2468
|
);
|
2468
2469
|
};
|
2470
|
+
this.moveCamera = (camera) => {
|
2471
|
+
this.debouncedStoreCamera();
|
2472
|
+
this.moveCameraToPromise(camera);
|
2473
|
+
};
|
2474
|
+
this.moveCameraToPromise = (camera) => {
|
2475
|
+
const promise = new Promise((resolve) => {
|
2476
|
+
const cameraListener = debounce(() => {
|
2477
|
+
this.mainView.callbacks.off("onCameraUpdated", cameraListener);
|
2478
|
+
this.cameraUpdatePromise = void 0;
|
2479
|
+
resolve(true);
|
2480
|
+
}, 50);
|
2481
|
+
this.mainView.callbacks.on("onCameraUpdated", cameraListener);
|
2482
|
+
this.mainView.moveCamera(camera);
|
2483
|
+
});
|
2484
|
+
this.cameraUpdatePromise = promise;
|
2485
|
+
return promise;
|
2486
|
+
};
|
2487
|
+
this.debouncedStoreCamera = () => {
|
2488
|
+
this.storeCurrentSize();
|
2489
|
+
const cameraListener = debounce(() => {
|
2490
|
+
this.saveToCamera$();
|
2491
|
+
this.storeCurrentCameraSize();
|
2492
|
+
this.mainView.callbacks.off("onCameraUpdated", cameraListener);
|
2493
|
+
}, 50);
|
2494
|
+
this.mainView.callbacks.on("onCameraUpdated", cameraListener);
|
2495
|
+
};
|
2496
|
+
this.storeCurrentCameraSize = debounce(() => __async$4(this, null, function* () {
|
2497
|
+
if (this.cameraUpdatePromise) {
|
2498
|
+
yield this.cameraUpdatePromise;
|
2499
|
+
}
|
2500
|
+
this.storeCurrentCamera();
|
2501
|
+
this.storeCurrentSize();
|
2502
|
+
}), 500);
|
2469
2503
|
this.addCameraReaction = () => {
|
2470
2504
|
this.manager.refresher.add(Fields.MainViewCamera, this.cameraReaction);
|
2471
2505
|
this.manager.refresher.add(Fields.MainViewSize, this.sizeReaction);
|
@@ -2484,11 +2518,14 @@ class MainViewProxy {
|
|
2484
2518
|
var _a2;
|
2485
2519
|
const rect = (_a2 = this.manager.boxManager) == null ? void 0 : _a2.stageRect;
|
2486
2520
|
if (rect) {
|
2487
|
-
|
2521
|
+
const size = {
|
2488
2522
|
id: this.manager.uid,
|
2489
2523
|
width: rect.width,
|
2490
2524
|
height: rect.height
|
2491
|
-
}
|
2525
|
+
};
|
2526
|
+
if (!isEqual(size, this.mainViewSize)) {
|
2527
|
+
this.storeSize(size);
|
2528
|
+
}
|
2492
2529
|
}
|
2493
2530
|
};
|
2494
2531
|
this.storeCamera = (camera) => {
|
@@ -2879,6 +2916,8 @@ class ScrollMode {
|
|
2879
2916
|
});
|
2880
2917
|
this.sideEffect.add(() => {
|
2881
2918
|
const onCameraUpdated = (camera) => {
|
2919
|
+
if (!this.manager.canOperate)
|
2920
|
+
return;
|
2882
2921
|
const halfWbHeight = size$.value.height / 2 / scale$.value;
|
2883
2922
|
const scrollTop = camera.centerY;
|
2884
2923
|
this.scrollStorage.setState({
|
@@ -9005,30 +9044,30 @@ class G$1 {
|
|
9005
9044
|
if (w2.thumbnail)
|
9006
9045
|
return w2;
|
9007
9046
|
try {
|
9008
|
-
const
|
9009
|
-
return
|
9010
|
-
} catch (
|
9011
|
-
return console.error(
|
9047
|
+
const f2 = new URL(w2.src);
|
9048
|
+
return f2.searchParams.set("x-oss-process", "image/resize,l_50"), { ...w2, thumbnail: f2.toString() };
|
9049
|
+
} catch (f2) {
|
9050
|
+
return console.error(f2), w2;
|
9012
9051
|
}
|
9013
9052
|
})
|
9014
9053
|
);
|
9015
9054
|
const o2 = derive(s, (d) => {
|
9016
9055
|
const w2 = Array(d.length);
|
9017
|
-
for (let
|
9018
|
-
w2[
|
9056
|
+
for (let f2 = 0; f2 < d.length; f2++)
|
9057
|
+
w2[f2] = f2 > 0 ? w2[f2 - 1] + d[f2 - 1].height : 0;
|
9019
9058
|
return w2;
|
9020
9059
|
}), l = derive(s, (d) => {
|
9021
9060
|
let w2 = 1 / 0;
|
9022
|
-
for (let
|
9023
|
-
d[
|
9061
|
+
for (let f2 = d.length - 1; f2 >= 0; f2--)
|
9062
|
+
d[f2].height <= w2 && (w2 = d[f2].height);
|
9024
9063
|
return w2;
|
9025
9064
|
}), c = combine(
|
9026
9065
|
[e, o2, s],
|
9027
|
-
([d, w2,
|
9028
|
-
if (w2.length !==
|
9066
|
+
([d, w2, f2]) => {
|
9067
|
+
if (w2.length !== f2.length)
|
9029
9068
|
return c.value;
|
9030
9069
|
for (let v = 0; v < w2.length; v++)
|
9031
|
-
if (w2[v] +
|
9070
|
+
if (w2[v] + f2[v].height - d >= 1e-3)
|
9032
9071
|
return v;
|
9033
9072
|
return w2.length - 1;
|
9034
9073
|
}
|
@@ -9037,7 +9076,7 @@ class G$1 {
|
|
9037
9076
|
([d, w2]) => d.width / w2.width || 1
|
9038
9077
|
), a = combine(
|
9039
9078
|
[s, t, l, h2],
|
9040
|
-
([d, w2,
|
9079
|
+
([d, w2, f2, v]) => S$1(Math.ceil(w2.height / v / f2 / 2), 1, d.length)
|
9041
9080
|
);
|
9042
9081
|
withReadonlyValueEnhancer(this, {
|
9043
9082
|
pagesScrollTop: e,
|
@@ -9057,9 +9096,9 @@ class G$1 {
|
|
9057
9096
|
this.sideEffect.setTimeout(g2, 1e3, "turn-off-hwa"), p.setValue(true);
|
9058
9097
|
};
|
9059
9098
|
this.sideEffect.addDisposer(
|
9060
|
-
combine([c, a, s]).subscribe(([d, w2,
|
9099
|
+
combine([c, a, s]).subscribe(([d, w2, f2]) => {
|
9061
9100
|
u();
|
9062
|
-
const v = Math.max(d - w2, 0), C = Math.min(d + w2,
|
9101
|
+
const v = Math.max(d - w2, 0), C = Math.min(d + w2, f2.length - 1);
|
9063
9102
|
for (let $ = 0; $ < this.$pages.children.length; $++) {
|
9064
9103
|
const x = this.$pages.children[$], k2 = Number(x.dataset.index);
|
9065
9104
|
k2 >= v && k2 <= C || (x.remove(), $--);
|
@@ -9581,10 +9620,10 @@ function ee$1(n, e, t, s, r) {
|
|
9581
9620
|
const h2 = n.add(() => {
|
9582
9621
|
const a = ({ width: p, height: g2 }) => {
|
9583
9622
|
if (s.length > 0 && t.state !== "maximized") {
|
9584
|
-
const { width: u, height: d } = s[0],
|
9585
|
-
|
9623
|
+
const { width: u, height: d } = s[0], f2 = d / u * p - g2;
|
9624
|
+
f2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9586
9625
|
width: t.intrinsicWidth,
|
9587
|
-
height: t.intrinsicHeight +
|
9626
|
+
height: t.intrinsicHeight + f2 / t.rootRect.height
|
9588
9627
|
});
|
9589
9628
|
}
|
9590
9629
|
n.remove(h2);
|
@@ -9641,7 +9680,7 @@ function Ge(e) {
|
|
9641
9680
|
function di() {
|
9642
9681
|
return Ge(" ");
|
9643
9682
|
}
|
9644
|
-
function
|
9683
|
+
function g(e, i2, t) {
|
9645
9684
|
t == null ? e.removeAttribute(i2) : e.getAttribute(i2) !== t && e.setAttribute(i2, t);
|
9646
9685
|
}
|
9647
9686
|
function pi(e) {
|
@@ -9759,13 +9798,13 @@ function Lt(e, i2, t, r, s, n, a, l = [-1]) {
|
|
9759
9798
|
};
|
9760
9799
|
a && a(c.root);
|
9761
9800
|
let u = false;
|
9762
|
-
if (c.ctx = t ? t(e, i2.props || {}, (
|
9801
|
+
if (c.ctx = t ? t(e, i2.props || {}, (m, p, ...v) => {
|
9763
9802
|
const b = v.length ? v[0] : p;
|
9764
|
-
return c.ctx && s(c.ctx[
|
9803
|
+
return c.ctx && s(c.ctx[m], c.ctx[m] = b) && (!c.skip_bound && c.bound[m] && c.bound[m](b), u && xi(e, m)), p;
|
9765
9804
|
}) : [], c.update(), u = true, $e(c.before_update), c.fragment = r ? r(c.ctx) : false, i2.target) {
|
9766
9805
|
if (i2.hydrate) {
|
9767
|
-
const
|
9768
|
-
c.fragment && c.fragment.l(
|
9806
|
+
const m = pi(i2.target);
|
9807
|
+
c.fragment && c.fragment.l(m), m.forEach(G);
|
9769
9808
|
} else
|
9770
9809
|
c.fragment && c.fragment.c();
|
9771
9810
|
i2.intro && Pt(e.$$.fragment), Mt(e, i2.target, i2.anchor, i2.customElement), Et();
|
@@ -9949,13 +9988,13 @@ function Ni(e) {
|
|
9949
9988
|
return Array.isArray(e) ? e[0] : e;
|
9950
9989
|
}
|
9951
9990
|
function Li(e) {
|
9952
|
-
let i2, t, r, s, n, a, l, d, c, u,
|
9991
|
+
let i2, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N2, x, y, C, L2, $, D2, V2, re, F2, ce, Ve, de, qe, pe, De, ue, Re, he, Fe, se, Be, Ue;
|
9953
9992
|
return {
|
9954
9993
|
c() {
|
9955
|
-
i2 = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"),
|
9994
|
+
i2 = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), m = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N2 = S("path"), x = S("symbol"), y = S("path"), C = S("symbol"), L2 = S("path"), $ = S("symbol"), D2 = S("path"), V2 = S("symbol"), re = S("path"), F2 = S("symbol"), ce = S("path"), Ve = S("path"), de = S("symbol"), qe = S("path"), pe = S("symbol"), De = S("path"), ue = S("symbol"), Re = S("path"), he = S("symbol"), Fe = S("path"), se = S("symbol"), Be = S("path"), Ue = S("path"), g(r, "d", "M16 1H2a1 1 0 00-1 1v10a1 1 0 001 1h3v-2H3V3h12v8h-2v2h3a1 1 0 001-1V2a1 1 0 00-1-1z"), g(s, "d", "M4 17h10l-5-6z"), g(t, "id", "plyr-airplay"), g(t, "viewBox", "0 0 18 18"), g(a, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(a, "fill-rule", "evenodd"), g(a, "fill-opacity", ".5"), g(n, "id", "plyr-captions-off"), g(n, "viewBox", "0 0 18 18"), g(d, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(d, "fill-rule", "evenodd"), g(l, "id", "plyr-captions-on"), g(l, "viewBox", "0 0 18 18"), g(u, "d", "M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z"), g(c, "id", "plyr-download"), g(c, "viewBox", "0 0 18 18"), g(p, "d", "M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"), g(m, "id", "plyr-enter-fullscreen"), g(m, "viewBox", "0 0 18 18"), g(b, "d", "M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"), g(v, "id", "plyr-exit-fullscreen"), g(v, "viewBox", "0 0 18 18"), g(N2, "d", "M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"), g(T2, "id", "plyr-fast-forward"), g(T2, "viewBox", "0 0 18 18"), g(y, "d", "M17 5.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C5 10.9 4.4 6 3 6c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"), g(x, "id", "plyr-logo-vimeo"), g(x, "viewBox", "0 0 18 18"), g(L2, "d", "M16.8 5.8c-.2-1.3-.8-2.2-2.2-2.4C12.4 3 9 3 9 3s-3.4 0-5.6.4C2 3.6 1.3 4.5 1.2 5.8 1 7.1 1 9 1 9s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C5.6 15 9 15 9 15s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4.2-1.3.2-3.2.2-3.2s0-1.9-.2-3.2zM7 12V6l5 3-5 3z"), g(C, "id", "plyr-logo-youtube"), g(C, "viewBox", "0 0 18 18"), g(D2, "d", "M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g($, "id", "plyr-muted"), g($, "viewBox", "0 0 18 18"), g(re, "d", "M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zm6 0c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"), g(V2, "id", "plyr-pause"), g(V2, "viewBox", "0 0 18 18"), g(ce, "d", "M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"), g(Ve, "d", "M13 15H3V5h5V3H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1v-6h-2v5z"), g(F2, "id", "plyr-pip"), g(F2, "viewBox", "0 0 18 18"), g(qe, "d", "M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"), g(de, "id", "plyr-play"), g(de, "viewBox", "0 0 18 18"), g(De, "d", "M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"), g(pe, "id", "plyr-restart"), g(pe, "viewBox", "0 0 18 18"), g(Re, "d", "M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"), g(ue, "id", "plyr-rewind"), g(ue, "viewBox", "0 0 18 18"), g(Fe, "d", "M16.135 7.784a2 2 0 01-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 01-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 01-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 01-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 011.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 012.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 012.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 011.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 110-6 3 3 0 010 6z"), g(he, "id", "plyr-settings"), g(he, "viewBox", "0 0 18 18"), g(Be, "d", "M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"), g(Ue, "d", "M11.282 5.282a.909.909 0 000 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 000 1.316c.145.145.636.262 1.018.156a.725.725 0 00.298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 00-1.316 0zm-7.496.726H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g(se, "id", "plyr-volume"), g(se, "viewBox", "0 0 18 18"), g(i2, "xmlns", "http://www.w3.org/2000/svg"), g(i2, "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
9956
9995
|
},
|
9957
9996
|
m(We, ni) {
|
9958
|
-
te(We, i2, ni), k(i2, t), k(t, r), k(t, s), k(i2, n), k(n, a), k(i2, l), k(l, d), k(i2, c), k(c, u), k(i2,
|
9997
|
+
te(We, i2, ni), k(i2, t), k(t, r), k(t, s), k(i2, n), k(n, a), k(i2, l), k(l, d), k(i2, c), k(c, u), k(i2, m), k(m, p), k(i2, v), k(v, b), k(i2, T2), k(T2, N2), k(i2, x), k(x, y), k(i2, C), k(C, L2), k(i2, $), k($, D2), k(i2, V2), k(V2, re), k(i2, F2), k(F2, ce), k(F2, Ve), k(i2, de), k(de, qe), k(i2, pe), k(pe, De), k(i2, ue), k(ue, Re), k(i2, he), k(he, Fe), k(i2, se), k(se, Be), k(se, Ue);
|
9959
9998
|
},
|
9960
9999
|
p: X,
|
9961
10000
|
i: X,
|
@@ -9970,7 +10009,7 @@ class Ii extends It {
|
|
9970
10009
|
super(), Lt(this, i2, null, Li, Ct, {});
|
9971
10010
|
}
|
9972
10011
|
}
|
9973
|
-
function
|
10012
|
+
function f(e, i2, t) {
|
9974
10013
|
return i2 in e ? Object.defineProperty(e, i2, { value: t, enumerable: true, configurable: true, writable: true }) : e[i2] = t, e;
|
9975
10014
|
}
|
9976
10015
|
function zi(e, i2) {
|
@@ -10431,7 +10470,7 @@ const xt = { pip: "PIP", airplay: "AirPlay", html5: "HTML5", vimeo: "Vimeo", you
|
|
10431
10470
|
} };
|
10432
10471
|
class we {
|
10433
10472
|
constructor(i2) {
|
10434
|
-
|
10473
|
+
f(this, "get", (t) => {
|
10435
10474
|
if (!we.supported || !this.enabled)
|
10436
10475
|
return null;
|
10437
10476
|
const r = window.localStorage.getItem(this.key);
|
@@ -10439,7 +10478,7 @@ class we {
|
|
10439
10478
|
return null;
|
10440
10479
|
const s = JSON.parse(r);
|
10441
10480
|
return o.string(t) && t.length ? s[t] : s;
|
10442
|
-
}),
|
10481
|
+
}), f(this, "set", (t) => {
|
10443
10482
|
if (!we.supported || !this.enabled || !o.object(t))
|
10444
10483
|
return;
|
10445
10484
|
let r = this.get();
|
@@ -10819,8 +10858,8 @@ const h = { getIconUrl() {
|
|
10819
10858
|
const c = _("div", B(this.config.selectors.controls.wrapper));
|
10820
10859
|
this.elements.controls = c;
|
10821
10860
|
const u = { class: "plyr__controls__item" };
|
10822
|
-
return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((
|
10823
|
-
if (
|
10861
|
+
return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((m) => {
|
10862
|
+
if (m === "restart" && c.appendChild(t.call(this, "restart", u)), m === "rewind" && c.appendChild(t.call(this, "rewind", u)), m === "play" && c.appendChild(t.call(this, "play", u)), m === "fast-forward" && c.appendChild(t.call(this, "fast-forward", u)), m === "progress") {
|
10824
10863
|
const p = _("div", { class: `${u.class} plyr__progress__container` }), v = _("div", B(this.config.selectors.progress));
|
10825
10864
|
if (v.appendChild(s.call(this, "seek", { id: `plyr-seek-${e.id}` })), v.appendChild(r.call(this, "buffer")), this.config.tooltips.seek) {
|
10826
10865
|
const b = _("span", { class: this.config.classNames.tooltip }, "00:00");
|
@@ -10828,39 +10867,39 @@ const h = { getIconUrl() {
|
|
10828
10867
|
}
|
10829
10868
|
this.elements.progress = v, p.appendChild(this.elements.progress), c.appendChild(p);
|
10830
10869
|
}
|
10831
|
-
if (
|
10870
|
+
if (m === "current-time" && c.appendChild(n.call(this, "currentTime", u)), m === "duration" && c.appendChild(n.call(this, "duration", u)), m === "mute" || m === "volume") {
|
10832
10871
|
let { volume: p } = this.elements;
|
10833
|
-
if (o.element(p) && c.contains(p) || (p = _("div", z({}, u, { class: `${u.class} plyr__volume`.trim() })), this.elements.volume = p, c.appendChild(p)),
|
10872
|
+
if (o.element(p) && c.contains(p) || (p = _("div", z({}, u, { class: `${u.class} plyr__volume`.trim() })), this.elements.volume = p, c.appendChild(p)), m === "mute" && p.appendChild(t.call(this, "mute")), m === "volume" && !H.isIos) {
|
10834
10873
|
const v = { max: 1, step: 0.05, value: this.config.volume };
|
10835
10874
|
p.appendChild(s.call(this, "volume", z(v, { id: `plyr-volume-${e.id}` })));
|
10836
10875
|
}
|
10837
10876
|
}
|
10838
|
-
if (
|
10877
|
+
if (m === "captions" && c.appendChild(t.call(this, "captions", u)), m === "settings" && !o.empty(this.config.settings)) {
|
10839
10878
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10840
10879
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10841
10880
|
const v = _("div", { class: "plyr__menu__container", id: `plyr-settings-${e.id}`, hidden: "" }), b = _("div"), T2 = _("div", { id: `plyr-settings-${e.id}-home` }), N2 = _("div", { role: "menu" });
|
10842
10881
|
T2.appendChild(N2), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10843
|
-
const
|
10844
|
-
i2.call(this,
|
10882
|
+
const y = _("button", z(B(this.config.selectors.buttons.settings), { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`, role: "menuitem", "aria-haspopup": true, hidden: "" }));
|
10883
|
+
i2.call(this, y, x), E.call(this, y, "click", () => {
|
10845
10884
|
d.call(this, x, false);
|
10846
10885
|
});
|
10847
10886
|
const C = _("span", null, j.get(x, this.config)), L2 = _("span", { class: this.config.classNames.menu.value });
|
10848
|
-
L2.innerHTML = e[x], C.appendChild(L2),
|
10887
|
+
L2.innerHTML = e[x], C.appendChild(L2), y.appendChild(C), N2.appendChild(y);
|
10849
10888
|
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10850
10889
|
D2.appendChild(_("span", { "aria-hidden": true }, j.get(x, this.config))), D2.appendChild(_("span", { class: this.config.classNames.hidden }, j.get("menuBack", this.config))), E.call(this, $, "keydown", (V2) => {
|
10851
10890
|
V2.key === "ArrowLeft" && (V2.preventDefault(), V2.stopPropagation(), d.call(this, "home", true));
|
10852
10891
|
}, false), E.call(this, D2, "click", () => {
|
10853
10892
|
d.call(this, "home", false);
|
10854
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] =
|
10893
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10855
10894
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10856
10895
|
}
|
10857
|
-
if (
|
10896
|
+
if (m === "pip" && I.pip && c.appendChild(t.call(this, "pip", u)), m === "airplay" && I.airplay && c.appendChild(t.call(this, "airplay", u)), m === "download") {
|
10858
10897
|
const p = z({}, u, { element: "a", href: this.download, target: "_blank" });
|
10859
10898
|
this.isHTML5 && (p.download = "");
|
10860
10899
|
const { download: v } = this.config.urls;
|
10861
10900
|
!o.url(v) && this.isEmbed && z(p, { icon: `logo-${this.provider}`, label: this.provider }), c.appendChild(t.call(this, "download", p));
|
10862
10901
|
}
|
10863
|
-
|
10902
|
+
m === "fullscreen" && c.appendChild(t.call(this, "fullscreen", u));
|
10864
10903
|
}), this.isHTML5 && a.call(this, Q.getQualityOptions.call(this)), l.call(this), c;
|
10865
10904
|
}, inject() {
|
10866
10905
|
if (this.config.loadSprite) {
|
@@ -11060,14 +11099,14 @@ class _r {
|
|
11060
11099
|
}
|
11061
11100
|
class U {
|
11062
11101
|
constructor(i2) {
|
11063
|
-
|
11102
|
+
f(this, "onChange", () => {
|
11064
11103
|
if (!this.enabled)
|
11065
11104
|
return;
|
11066
11105
|
const t = this.player.elements.buttons.fullscreen;
|
11067
11106
|
o.element(t) && (t.pressed = this.active);
|
11068
11107
|
const r = this.target === this.player.media ? this.target : this.player.elements.container;
|
11069
11108
|
w.call(this.player, r, this.active ? "enterfullscreen" : "exitfullscreen", true);
|
11070
|
-
}),
|
11109
|
+
}), f(this, "toggleFallback", (t = false) => {
|
11071
11110
|
if (t ? this.scrollPosition = { x: window.scrollX || 0, y: window.scrollY || 0 } : window.scrollTo(this.scrollPosition.x, this.scrollPosition.y), document.body.style.overflow = t ? "hidden" : "", A(this.target, this.player.config.classNames.fullscreen.fallback, t), H.isIos) {
|
11072
11111
|
let r = document.head.querySelector('meta[name="viewport"]');
|
11073
11112
|
const s = "viewport-fit=cover";
|
@@ -11076,21 +11115,21 @@ class U {
|
|
11076
11115
|
t ? (this.cleanupViewport = !n, n || (r.content += `,${s}`)) : this.cleanupViewport && (r.content = r.content.split(",").filter((a) => a.trim() !== s).join(","));
|
11077
11116
|
}
|
11078
11117
|
this.onChange();
|
11079
|
-
}),
|
11118
|
+
}), f(this, "trapFocus", (t) => {
|
11080
11119
|
if (H.isIos || !this.active || t.key !== "Tab")
|
11081
11120
|
return;
|
11082
11121
|
const r = document.activeElement, s = ne.call(this.player, "a[href], button:not(:disabled), input:not(:disabled), [tabindex]"), [n] = s, a = s[s.length - 1];
|
11083
11122
|
r !== a || t.shiftKey ? r === n && t.shiftKey && (a.focus(), t.preventDefault()) : (n.focus(), t.preventDefault());
|
11084
|
-
}),
|
11123
|
+
}), f(this, "update", () => {
|
11085
11124
|
if (this.enabled) {
|
11086
11125
|
let t;
|
11087
11126
|
t = this.forceFallback ? "Fallback (forced)" : U.native ? "Native" : "Fallback", this.player.debug.log(`${t} fullscreen enabled`);
|
11088
11127
|
} else
|
11089
11128
|
this.player.debug.log("Fullscreen not supported and fallback disabled");
|
11090
11129
|
A(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);
|
11091
|
-
}),
|
11130
|
+
}), f(this, "enter", () => {
|
11092
11131
|
this.enabled && (H.isIos && this.player.config.fullscreen.iosNative ? this.player.isVimeo ? this.player.embed.requestFullscreen() : this.target.webkitEnterFullscreen() : !U.native || this.forceFallback ? this.toggleFallback(true) : this.prefix ? o.empty(this.prefix) || this.target[`${this.prefix}Request${this.property}`]() : this.target.requestFullscreen({ navigationUI: "hide" }));
|
11093
|
-
}),
|
11132
|
+
}), f(this, "exit", () => {
|
11094
11133
|
if (this.enabled)
|
11095
11134
|
if (H.isIos && this.player.config.fullscreen.iosNative)
|
11096
11135
|
this.target.webkitExitFullscreen(), W(this.player.play());
|
@@ -11103,7 +11142,7 @@ class U {
|
|
11103
11142
|
}
|
11104
11143
|
} else
|
11105
11144
|
(document.cancelFullScreen || document.exitFullscreen).call(document);
|
11106
|
-
}),
|
11145
|
+
}), f(this, "toggle", () => {
|
11107
11146
|
this.active ? this.exit() : this.enter();
|
11108
11147
|
}), this.player = i2, this.prefix = U.prefix, this.property = U.property, this.scrollPosition = { x: 0, y: 0 }, this.forceFallback = i2.config.fullscreen.fallback === "force", this.player.elements.fullscreen = i2.config.fullscreen.container && or(this.player.elements.container, i2.config.fullscreen.container), E.call(this.player, document, this.prefix === "ms" ? "MSFullscreenChange" : `${this.prefix}fullscreenchange`, () => {
|
11109
11148
|
this.onChange();
|
@@ -11201,10 +11240,10 @@ const M = { addStyleHook() {
|
|
11201
11240
|
} };
|
11202
11241
|
class wr {
|
11203
11242
|
constructor(i2) {
|
11204
|
-
|
11243
|
+
f(this, "firstTouch", () => {
|
11205
11244
|
const { player: t } = this, { elements: r } = t;
|
11206
11245
|
t.touch = true, A(r.container, t.config.classNames.isTouch, true);
|
11207
|
-
}),
|
11246
|
+
}), f(this, "setTabFocus", (t) => {
|
11208
11247
|
const { player: r } = this, { elements: s } = r, { key: n, type: a, timeStamp: l } = t;
|
11209
11248
|
if (clearTimeout(this.focusTimer), a === "keydown" && n !== "Tab")
|
11210
11249
|
return;
|
@@ -11217,10 +11256,10 @@ class wr {
|
|
11217
11256
|
const c = document.activeElement;
|
11218
11257
|
s.container.contains(c) && A(document.activeElement, r.config.classNames.tabFocus, true);
|
11219
11258
|
}, 10)));
|
11220
|
-
}),
|
11259
|
+
}), f(this, "global", (t = true) => {
|
11221
11260
|
const { player: r } = this;
|
11222
11261
|
r.config.keyboard.global && ae.call(r, window, "keydown keyup", this.handleKey, t, false), ae.call(r, document.body, "click", this.toggleMenu, t), dt.call(r, document.body, "touchstart", this.firstTouch), ae.call(r, document.body, "keydown focus blur focusout", this.setTabFocus, t, false, true);
|
11223
|
-
}),
|
11262
|
+
}), f(this, "container", () => {
|
11224
11263
|
const { player: t } = this, { config: r, elements: s, timers: n } = t;
|
11225
11264
|
!r.keyboard.global && r.keyboard.focused && E.call(t, s.container, "keydown keyup", this.handleKey, false), E.call(t, s.container, "mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen", (d) => {
|
11226
11265
|
const { controls: c } = s;
|
@@ -11231,11 +11270,11 @@ class wr {
|
|
11231
11270
|
const a = () => {
|
11232
11271
|
if (!t.isVimeo || t.config.vimeo.premium)
|
11233
11272
|
return;
|
11234
|
-
const d = s.wrapper, { active: c } = t.fullscreen, [u,
|
11273
|
+
const d = s.wrapper, { active: c } = t.fullscreen, [u, m] = pt.call(t), p = Kt(`aspect-ratio: ${u} / ${m}`);
|
11235
11274
|
if (!c)
|
11236
11275
|
return void (p ? (d.style.width = null, d.style.height = null) : (d.style.maxWidth = null, d.style.margin = null));
|
11237
|
-
const [v, b] = pr(), T2 = v / b > u /
|
11238
|
-
p ? (d.style.width = T2 ? "auto" : "100%", d.style.height = T2 ? "100%" : "auto") : (d.style.maxWidth = T2 ? b /
|
11276
|
+
const [v, b] = pr(), T2 = v / b > u / m;
|
11277
|
+
p ? (d.style.width = T2 ? "auto" : "100%", d.style.height = T2 ? "100%" : "auto") : (d.style.maxWidth = T2 ? b / m * u + "px" : null, d.style.margin = T2 ? "0 auto" : null);
|
11239
11278
|
}, l = () => {
|
11240
11279
|
clearTimeout(n.resized), n.resized = setTimeout(a, 50);
|
11241
11280
|
};
|
@@ -11243,7 +11282,7 @@ class wr {
|
|
11243
11282
|
const { target: c } = t.fullscreen;
|
11244
11283
|
c === s.container && (!t.isEmbed && o.empty(t.config.ratio) || (a(), (d.type === "enterfullscreen" ? E : je).call(t, window, "resize", l)));
|
11245
11284
|
});
|
11246
|
-
}),
|
11285
|
+
}), f(this, "media", () => {
|
11247
11286
|
const { player: t } = this, { elements: r } = t;
|
11248
11287
|
if (E.call(t, t.media, "timeupdate seeking seeked", (n) => h.timeUpdate.call(t, n)), E.call(t, t.media, "durationchange loadeddata loadedmetadata", (n) => h.durationUpdate.call(t, n)), E.call(t, t.media, "ended", () => {
|
11249
11288
|
t.isHTML5 && t.isVideo && t.config.resetOnEnd && (t.restart(), t.pause());
|
@@ -11275,14 +11314,14 @@ class wr {
|
|
11275
11314
|
let { detail: a = {} } = n;
|
11276
11315
|
n.type === "error" && (a = t.media.error), w.call(t, r.container, n.type, true, a);
|
11277
11316
|
});
|
11278
|
-
}),
|
11317
|
+
}), f(this, "proxy", (t, r, s) => {
|
11279
11318
|
const { player: n } = this, a = n.config.listeners[s];
|
11280
11319
|
let l = true;
|
11281
11320
|
o.function(a) && (l = a.call(n, t)), l !== false && o.function(r) && r.call(n, t);
|
11282
|
-
}),
|
11321
|
+
}), f(this, "bind", (t, r, s, n, a = true) => {
|
11283
11322
|
const { player: l } = this, d = l.config.listeners[n], c = o.function(d);
|
11284
11323
|
E.call(l, t, r, (u) => this.proxy(u, s, n), a && !c);
|
11285
|
-
}),
|
11324
|
+
}), f(this, "controls", () => {
|
11286
11325
|
const { player: t } = this, { elements: r } = t, s = H.isIE ? "change" : "input";
|
11287
11326
|
if (r.buttons.play && Array.from(r.buttons.play).forEach((n) => {
|
11288
11327
|
this.bind(n, "click", () => {
|
@@ -11358,7 +11397,7 @@ class wr {
|
|
11358
11397
|
const l = this.touch ? 3e3 : 4e3;
|
11359
11398
|
clearTimeout(a.controls), a.controls = setTimeout(() => M.toggleControls.call(t, false), l);
|
11360
11399
|
}), this.bind(r.inputs.volume, "wheel", (n) => {
|
11361
|
-
const a = n.webkitDirectionInvertedFromDevice, [l, d] = [n.deltaX, -n.deltaY].map((
|
11400
|
+
const a = n.webkitDirectionInvertedFromDevice, [l, d] = [n.deltaX, -n.deltaY].map((m) => a ? -m : m), c = Math.sign(Math.abs(l) > Math.abs(d) ? l : d);
|
11362
11401
|
t.increaseVolume(c / 50);
|
11363
11402
|
const { volume: u } = t.media;
|
11364
11403
|
(c === 1 && u < 1 || c === -1 && u > 0) && n.preventDefault();
|
@@ -11366,7 +11405,7 @@ class wr {
|
|
11366
11405
|
}), this.player = i2, this.lastKey = null, this.focusTimer = null, this.lastKeyDown = null, this.handleKey = this.handleKey.bind(this), this.toggleMenu = this.toggleMenu.bind(this), this.setTabFocus = this.setTabFocus.bind(this), this.firstTouch = this.firstTouch.bind(this);
|
11367
11406
|
}
|
11368
11407
|
handleKey(i2) {
|
11369
|
-
const { player: t } = this, { elements: r } = t, { key: s, type: n, altKey: a, ctrlKey: l, metaKey: d, shiftKey: c } = i2, u = n === "keydown",
|
11408
|
+
const { player: t } = this, { elements: r } = t, { key: s, type: n, altKey: a, ctrlKey: l, metaKey: d, shiftKey: c } = i2, u = n === "keydown", m = u && s === this.lastKey;
|
11370
11409
|
if (!(a || l || d || c) && !!s) {
|
11371
11410
|
if (u) {
|
11372
11411
|
const v = document.activeElement;
|
@@ -11386,11 +11425,11 @@ class wr {
|
|
11386
11425
|
case "7":
|
11387
11426
|
case "8":
|
11388
11427
|
case "9":
|
11389
|
-
|
11428
|
+
m || (p = parseInt(s, 10), t.currentTime = t.duration / 10 * p);
|
11390
11429
|
break;
|
11391
11430
|
case "Space":
|
11392
11431
|
case "k":
|
11393
|
-
|
11432
|
+
m || W(t.togglePlay());
|
11394
11433
|
break;
|
11395
11434
|
case "ArrowUp":
|
11396
11435
|
t.increaseVolume(0.1);
|
@@ -11399,7 +11438,7 @@ class wr {
|
|
11399
11438
|
t.decreaseVolume(0.1);
|
11400
11439
|
break;
|
11401
11440
|
case "m":
|
11402
|
-
|
11441
|
+
m || (t.muted = !t.muted);
|
11403
11442
|
break;
|
11404
11443
|
case "ArrowRight":
|
11405
11444
|
t.forward();
|
@@ -11411,7 +11450,7 @@ class wr {
|
|
11411
11450
|
t.fullscreen.toggle();
|
11412
11451
|
break;
|
11413
11452
|
case "c":
|
11414
|
-
|
11453
|
+
m || t.toggleCaptions();
|
11415
11454
|
break;
|
11416
11455
|
case "l":
|
11417
11456
|
t.loop = !t.loop;
|
@@ -11435,11 +11474,11 @@ var kr = xr(function(e, i2) {
|
|
11435
11474
|
}, r = {}, s = {}, n = {};
|
11436
11475
|
function a(p, v) {
|
11437
11476
|
p = p.push ? p : [p];
|
11438
|
-
var b, T2, N2, x = [],
|
11477
|
+
var b, T2, N2, x = [], y = p.length, C = y;
|
11439
11478
|
for (b = function(L2, $) {
|
11440
11479
|
$.length && x.push(L2), --C || v(x);
|
11441
|
-
};
|
11442
|
-
T2 = p[
|
11480
|
+
}; y--; )
|
11481
|
+
T2 = p[y], (N2 = s[T2]) ? b(T2, N2) : (n[T2] = n[T2] || []).push(b);
|
11443
11482
|
}
|
11444
11483
|
function l(p, v) {
|
11445
11484
|
if (p) {
|
@@ -11453,8 +11492,8 @@ var kr = xr(function(e, i2) {
|
|
11453
11492
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11454
11493
|
}
|
11455
11494
|
function c(p, v, b, T2) {
|
11456
|
-
var N2, x,
|
11457
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x =
|
11495
|
+
var N2, x, y = document, C = b.async, L2 = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V2 = p.replace(/^(css|img)!/, "");
|
11496
|
+
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x = y.createElement("link")).rel = "stylesheet", x.href = V2, (N2 = "hideFocus" in x) && x.relList && (N2 = 0, x.rel = "preload", x.as = "style")) : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(D2) ? (x = y.createElement("img")).src = V2 : ((x = y.createElement("script")).src = p, x.async = C === void 0 || C), x.onload = x.onerror = x.onbeforeload = function(re) {
|
11458
11497
|
var F2 = re.type[0];
|
11459
11498
|
if (N2)
|
11460
11499
|
try {
|
@@ -11468,10 +11507,10 @@ var kr = xr(function(e, i2) {
|
|
11468
11507
|
} else if (x.rel == "preload" && x.as == "style")
|
11469
11508
|
return x.rel = "stylesheet";
|
11470
11509
|
v(p, F2, re.defaultPrevented);
|
11471
|
-
}, $(p, x) !== false &&
|
11510
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11472
11511
|
}
|
11473
11512
|
function u(p, v, b) {
|
11474
|
-
var T2, N2, x = (p = p.push ? p : [p]).length,
|
11513
|
+
var T2, N2, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11475
11514
|
for (T2 = function(L2, $, D2) {
|
11476
11515
|
if ($ == "e" && C.push(L2), $ == "b") {
|
11477
11516
|
if (!D2)
|
@@ -11479,36 +11518,36 @@ var kr = xr(function(e, i2) {
|
|
11479
11518
|
C.push(L2);
|
11480
11519
|
}
|
11481
11520
|
--x || v(C);
|
11482
|
-
}, N2 = 0; N2 <
|
11521
|
+
}, N2 = 0; N2 < y; N2++)
|
11483
11522
|
c(p[N2], T2, b);
|
11484
11523
|
}
|
11485
|
-
function
|
11524
|
+
function m(p, v, b) {
|
11486
11525
|
var T2, N2;
|
11487
11526
|
if (v && v.trim && (T2 = v), N2 = (T2 ? b : v) || {}, T2) {
|
11488
11527
|
if (T2 in r)
|
11489
11528
|
throw "LoadJS";
|
11490
11529
|
r[T2] = true;
|
11491
11530
|
}
|
11492
|
-
function x(
|
11531
|
+
function x(y, C) {
|
11493
11532
|
u(p, function(L2) {
|
11494
|
-
d(N2, L2),
|
11533
|
+
d(N2, L2), y && d({ success: y, error: C }, L2), l(T2, L2);
|
11495
11534
|
}, N2);
|
11496
11535
|
}
|
11497
11536
|
if (N2.returnPromise)
|
11498
11537
|
return new Promise(x);
|
11499
11538
|
x();
|
11500
11539
|
}
|
11501
|
-
return
|
11540
|
+
return m.ready = function(p, v) {
|
11502
11541
|
return a(p, function(b) {
|
11503
11542
|
d(v, b);
|
11504
|
-
}),
|
11505
|
-
},
|
11543
|
+
}), m;
|
11544
|
+
}, m.done = function(p) {
|
11506
11545
|
l(p, []);
|
11507
|
-
},
|
11546
|
+
}, m.reset = function() {
|
11508
11547
|
r = {}, s = {}, n = {};
|
11509
|
-
},
|
11548
|
+
}, m.isDefined = function(p) {
|
11510
11549
|
return p in r;
|
11511
|
-
},
|
11550
|
+
}, m;
|
11512
11551
|
}();
|
11513
11552
|
});
|
11514
11553
|
function ut(e) {
|
@@ -11539,75 +11578,75 @@ const nt = { setup() {
|
|
11539
11578
|
o.empty(n) ? (n = e.media.getAttribute(e.config.attributes.embed.id), a = e.media.getAttribute(e.config.attributes.embed.hash)) : a = Cr(n);
|
11540
11579
|
const l = a ? { h: a } : {};
|
11541
11580
|
t && Object.assign(s, { controls: false, sidedock: false });
|
11542
|
-
const d = ti({ loop: e.config.loop.active, autoplay: e.autoplay, muted: e.muted, gesture: "media", playsinline: !this.config.fullscreen.iosNative, ...l, ...s }), c = Tr(n), u = _("iframe"),
|
11543
|
-
if (u.setAttribute("src",
|
11581
|
+
const d = ti({ loop: e.config.loop.active, autoplay: e.autoplay, muted: e.muted, gesture: "media", playsinline: !this.config.fullscreen.iosNative, ...l, ...s }), c = Tr(n), u = _("iframe"), m = st(e.config.urls.vimeo.iframe, c, d);
|
11582
|
+
if (u.setAttribute("src", m), u.setAttribute("allowfullscreen", ""), u.setAttribute("allow", ["autoplay", "fullscreen", "picture-in-picture", "encrypted-media", "accelerometer", "gyroscope"].join("; ")), o.empty(r) || u.setAttribute("referrerPolicy", r), t || !i2.customControls)
|
11544
11583
|
u.setAttribute("data-poster", e.poster), e.media = Le(u, e.media);
|
11545
11584
|
else {
|
11546
|
-
const
|
11547
|
-
|
11585
|
+
const y = _("div", { class: e.config.classNames.embedContainer, "data-poster": e.poster });
|
11586
|
+
y.appendChild(u), e.media = Le(y, e.media);
|
11548
11587
|
}
|
11549
|
-
i2.customControls || Te(st(e.config.urls.vimeo.api,
|
11550
|
-
!o.empty(
|
11588
|
+
i2.customControls || Te(st(e.config.urls.vimeo.api, m)).then((y) => {
|
11589
|
+
!o.empty(y) && y.thumbnail_url && M.setPoster.call(e, y.thumbnail_url).catch(() => {
|
11551
11590
|
});
|
11552
11591
|
}), e.embed = new window.Vimeo.Player(u, { autopause: e.config.autopause, muted: e.muted }), e.media.paused = true, e.media.currentTime = 0, e.supported.ui && e.embed.disableTextTrack(), e.media.play = () => (me.call(e, true), e.embed.play()), e.media.pause = () => (me.call(e, false), e.embed.pause()), e.media.stop = () => {
|
11553
11592
|
e.pause(), e.currentTime = 0;
|
11554
11593
|
};
|
11555
11594
|
let { currentTime: p } = e.media;
|
11556
|
-
Object.defineProperty(e.media, "currentTime", { get: () => p, set(
|
11595
|
+
Object.defineProperty(e.media, "currentTime", { get: () => p, set(y) {
|
11557
11596
|
const { embed: C, media: L2, paused: $, volume: D2 } = e, V2 = $ && !C.hasPlayed;
|
11558
|
-
L2.seeking = true, w.call(e, L2, "seeking"), Promise.resolve(V2 && C.setVolume(0)).then(() => C.setCurrentTime(
|
11597
|
+
L2.seeking = true, w.call(e, L2, "seeking"), Promise.resolve(V2 && C.setVolume(0)).then(() => C.setCurrentTime(y)).then(() => V2 && C.pause()).then(() => V2 && C.setVolume(D2)).catch(() => {
|
11559
11598
|
});
|
11560
11599
|
} });
|
11561
11600
|
let v = e.config.speed.selected;
|
11562
|
-
Object.defineProperty(e.media, "playbackRate", { get: () => v, set(
|
11563
|
-
e.embed.setPlaybackRate(
|
11564
|
-
v =
|
11601
|
+
Object.defineProperty(e.media, "playbackRate", { get: () => v, set(y) {
|
11602
|
+
e.embed.setPlaybackRate(y).then(() => {
|
11603
|
+
v = y, w.call(e, e.media, "ratechange");
|
11565
11604
|
}).catch(() => {
|
11566
11605
|
e.options.speed = [1];
|
11567
11606
|
});
|
11568
11607
|
} });
|
11569
11608
|
let { volume: b } = e.config;
|
11570
|
-
Object.defineProperty(e.media, "volume", { get: () => b, set(
|
11571
|
-
e.embed.setVolume(
|
11572
|
-
b =
|
11609
|
+
Object.defineProperty(e.media, "volume", { get: () => b, set(y) {
|
11610
|
+
e.embed.setVolume(y).then(() => {
|
11611
|
+
b = y, w.call(e, e.media, "volumechange");
|
11573
11612
|
});
|
11574
11613
|
} });
|
11575
11614
|
let { muted: T2 } = e.config;
|
11576
|
-
Object.defineProperty(e.media, "muted", { get: () => T2, set(
|
11577
|
-
const C = !!o.boolean(
|
11615
|
+
Object.defineProperty(e.media, "muted", { get: () => T2, set(y) {
|
11616
|
+
const C = !!o.boolean(y) && y;
|
11578
11617
|
e.embed.setVolume(C ? 0 : e.config.volume).then(() => {
|
11579
11618
|
T2 = C, w.call(e, e.media, "volumechange");
|
11580
11619
|
});
|
11581
11620
|
} });
|
11582
11621
|
let N2, { loop: x } = e.config;
|
11583
|
-
Object.defineProperty(e.media, "loop", { get: () => x, set(
|
11584
|
-
const C = o.boolean(
|
11622
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11623
|
+
const C = o.boolean(y) ? y : e.config.loop.active;
|
11585
11624
|
e.embed.setLoop(C).then(() => {
|
11586
11625
|
x = C;
|
11587
11626
|
});
|
11588
|
-
} }), e.embed.getVideoUrl().then((
|
11589
|
-
N2 =
|
11590
|
-
}).catch((
|
11591
|
-
this.debug.warn(
|
11592
|
-
}), Object.defineProperty(e.media, "currentSrc", { get: () => N2 }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration }), Promise.all([e.embed.getVideoWidth(), e.embed.getVideoHeight()]).then((
|
11593
|
-
const [C, L2] =
|
11627
|
+
} }), e.embed.getVideoUrl().then((y) => {
|
11628
|
+
N2 = y, h.setDownloadUrl.call(e);
|
11629
|
+
}).catch((y) => {
|
11630
|
+
this.debug.warn(y);
|
11631
|
+
}), Object.defineProperty(e.media, "currentSrc", { get: () => N2 }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration }), Promise.all([e.embed.getVideoWidth(), e.embed.getVideoHeight()]).then((y) => {
|
11632
|
+
const [C, L2] = y;
|
11594
11633
|
e.embed.ratio = Qt(C, L2), oe.call(this);
|
11595
|
-
}), e.embed.setAutopause(e.config.autopause).then((
|
11596
|
-
e.config.autopause =
|
11597
|
-
}), e.embed.getVideoTitle().then((
|
11598
|
-
e.config.title =
|
11599
|
-
}), e.embed.getCurrentTime().then((
|
11600
|
-
p =
|
11601
|
-
}), e.embed.getDuration().then((
|
11602
|
-
e.media.duration =
|
11603
|
-
}), e.embed.getTextTracks().then((
|
11604
|
-
e.media.textTracks =
|
11605
|
-
}), e.embed.on("cuechange", ({ cues:
|
11606
|
-
const C =
|
11634
|
+
}), e.embed.setAutopause(e.config.autopause).then((y) => {
|
11635
|
+
e.config.autopause = y;
|
11636
|
+
}), e.embed.getVideoTitle().then((y) => {
|
11637
|
+
e.config.title = y, M.setTitle.call(this);
|
11638
|
+
}), e.embed.getCurrentTime().then((y) => {
|
11639
|
+
p = y, w.call(e, e.media, "timeupdate");
|
11640
|
+
}), e.embed.getDuration().then((y) => {
|
11641
|
+
e.media.duration = y, w.call(e, e.media, "durationchange");
|
11642
|
+
}), e.embed.getTextTracks().then((y) => {
|
11643
|
+
e.media.textTracks = y, P.setup.call(e);
|
11644
|
+
}), e.embed.on("cuechange", ({ cues: y = [] }) => {
|
11645
|
+
const C = y.map((L2) => fr(L2.text));
|
11607
11646
|
P.updateCues.call(e, C);
|
11608
11647
|
}), e.embed.on("loaded", () => {
|
11609
|
-
e.embed.getPaused().then((
|
11610
|
-
me.call(e, !
|
11648
|
+
e.embed.getPaused().then((y) => {
|
11649
|
+
me.call(e, !y), y || w.call(e, e.media, "playing");
|
11611
11650
|
}), o.element(e.embed.element) && e.supported.ui && e.embed.element.setAttribute("tabindex", -1);
|
11612
11651
|
}), e.embed.on("bufferstart", () => {
|
11613
11652
|
w.call(e, e.media, "waiting");
|
@@ -11617,18 +11656,18 @@ const nt = { setup() {
|
|
11617
11656
|
me.call(e, true), w.call(e, e.media, "playing");
|
11618
11657
|
}), e.embed.on("pause", () => {
|
11619
11658
|
me.call(e, false);
|
11620
|
-
}), e.embed.on("timeupdate", (
|
11621
|
-
e.media.seeking = false, p =
|
11622
|
-
}), e.embed.on("progress", (
|
11623
|
-
e.media.buffered =
|
11659
|
+
}), e.embed.on("timeupdate", (y) => {
|
11660
|
+
e.media.seeking = false, p = y.seconds, w.call(e, e.media, "timeupdate");
|
11661
|
+
}), e.embed.on("progress", (y) => {
|
11662
|
+
e.media.buffered = y.percent, w.call(e, e.media, "progress"), parseInt(y.percent, 10) === 1 && w.call(e, e.media, "canplaythrough"), e.embed.getDuration().then((C) => {
|
11624
11663
|
C !== e.media.duration && (e.media.duration = C, w.call(e, e.media, "durationchange"));
|
11625
11664
|
});
|
11626
11665
|
}), e.embed.on("seeked", () => {
|
11627
11666
|
e.media.seeking = false, w.call(e, e.media, "seeked");
|
11628
11667
|
}), e.embed.on("ended", () => {
|
11629
11668
|
e.media.paused = true, w.call(e, e.media, "ended");
|
11630
|
-
}), e.embed.on("error", (
|
11631
|
-
e.media.error =
|
11669
|
+
}), e.embed.on("error", (y) => {
|
11670
|
+
e.media.error = y, w.call(e, e.media, "error");
|
11632
11671
|
}), i2.customControls && setTimeout(() => M.build.call(e), 0);
|
11633
11672
|
} };
|
11634
11673
|
function Sr(e) {
|
@@ -11693,22 +11732,22 @@ const Ne = { setup() {
|
|
11693
11732
|
ge.call(e, false), l.pauseVideo();
|
11694
11733
|
}, e.media.stop = () => {
|
11695
11734
|
l.stopVideo();
|
11696
|
-
}, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(
|
11697
|
-
e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(
|
11698
|
-
} }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(
|
11699
|
-
l.setPlaybackRate(
|
11735
|
+
}, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(m) {
|
11736
|
+
e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(m);
|
11737
|
+
} }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(m) {
|
11738
|
+
l.setPlaybackRate(m);
|
11700
11739
|
} });
|
11701
11740
|
let { volume: d } = e.config;
|
11702
|
-
Object.defineProperty(e.media, "volume", { get: () => d, set(
|
11703
|
-
d =
|
11741
|
+
Object.defineProperty(e.media, "volume", { get: () => d, set(m) {
|
11742
|
+
d = m, l.setVolume(100 * d), w.call(e, e.media, "volumechange");
|
11704
11743
|
} });
|
11705
11744
|
let { muted: c } = e.config;
|
11706
|
-
Object.defineProperty(e.media, "muted", { get: () => c, set(
|
11707
|
-
const p = o.boolean(
|
11745
|
+
Object.defineProperty(e.media, "muted", { get: () => c, set(m) {
|
11746
|
+
const p = o.boolean(m) ? m : c;
|
11708
11747
|
c = p, l[p ? "mute" : "unMute"](), l.setVolume(100 * d), w.call(e, e.media, "volumechange");
|
11709
11748
|
} }), Object.defineProperty(e.media, "currentSrc", { get: () => l.getVideoUrl() }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration });
|
11710
11749
|
const u = l.getAvailablePlaybackRates();
|
11711
|
-
e.options.speed = u.filter((
|
11750
|
+
e.options.speed = u.filter((m) => e.config.speed.options.includes(m)), e.supported.ui && i2.customControls && e.media.setAttribute("tabindex", -1), w.call(e, e.media, "timeupdate"), w.call(e, e.media, "durationchange"), clearInterval(e.timers.buffering), e.timers.buffering = setInterval(() => {
|
11712
11751
|
e.media.buffered = l.getVideoLoadedFraction(), (e.media.lastBuffered === null || e.media.lastBuffered < e.media.buffered) && w.call(e, e.media, "progress"), e.media.lastBuffered = e.media.buffered, e.media.buffered === 1 && (clearInterval(e.timers.buffering), w.call(e, e.media, "canplaythrough"));
|
11713
11752
|
}, 200), i2.customControls && setTimeout(() => M.build.call(e), 50);
|
11714
11753
|
}, onStateChange(a) {
|
@@ -11738,20 +11777,20 @@ const Ne = { setup() {
|
|
11738
11777
|
} };
|
11739
11778
|
class Er {
|
11740
11779
|
constructor(i2) {
|
11741
|
-
|
11780
|
+
f(this, "load", () => {
|
11742
11781
|
this.enabled && (o.object(window.google) && o.object(window.google.ima) ? this.ready() : ut(this.player.config.urls.googleIMA.sdk).then(() => {
|
11743
11782
|
this.ready();
|
11744
11783
|
}).catch(() => {
|
11745
11784
|
this.trigger("error", new Error("Google IMA SDK failed to load"));
|
11746
11785
|
}));
|
11747
|
-
}),
|
11786
|
+
}), f(this, "ready", () => {
|
11748
11787
|
var t;
|
11749
11788
|
this.enabled || ((t = this).manager && t.manager.destroy(), t.elements.displayContainer && t.elements.displayContainer.destroy(), t.elements.container.remove()), this.startSafetyTimer(12e3, "ready()"), this.managerPromise.then(() => {
|
11750
11789
|
this.clearSafetyTimer("onAdsManagerLoaded()");
|
11751
11790
|
}), this.listeners(), this.setupIMA();
|
11752
|
-
}),
|
11791
|
+
}), f(this, "setupIMA", () => {
|
11753
11792
|
this.elements.container = _("div", { class: this.player.config.classNames.ads }), this.player.elements.container.appendChild(this.elements.container), google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED), google.ima.settings.setLocale(this.player.config.ads.language), google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline), this.elements.displayContainer = new google.ima.AdDisplayContainer(this.elements.container, this.player.media), this.loader = new google.ima.AdsLoader(this.elements.displayContainer), this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, (t) => this.onAdsManagerLoaded(t), false), this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, (t) => this.onAdError(t), false), this.requestAds();
|
11754
|
-
}),
|
11793
|
+
}), f(this, "requestAds", () => {
|
11755
11794
|
const { container: t } = this.player.elements;
|
11756
11795
|
try {
|
11757
11796
|
const r = new google.ima.AdsRequest();
|
@@ -11759,21 +11798,21 @@ class Er {
|
|
11759
11798
|
} catch (r) {
|
11760
11799
|
this.onAdError(r);
|
11761
11800
|
}
|
11762
|
-
}),
|
11801
|
+
}), f(this, "pollCountdown", (t = false) => {
|
11763
11802
|
if (!t)
|
11764
11803
|
return clearInterval(this.countdownTimer), void this.elements.container.removeAttribute("data-badge-text");
|
11765
11804
|
this.countdownTimer = setInterval(() => {
|
11766
11805
|
const r = He(Math.max(this.manager.getRemainingTime(), 0)), s = `${j.get("advertisement", this.player.config)} - ${r}`;
|
11767
11806
|
this.elements.container.setAttribute("data-badge-text", s);
|
11768
11807
|
}, 100);
|
11769
|
-
}),
|
11808
|
+
}), f(this, "onAdsManagerLoaded", (t) => {
|
11770
11809
|
if (!this.enabled)
|
11771
11810
|
return;
|
11772
11811
|
const r = new google.ima.AdsRenderingSettings();
|
11773
11812
|
r.restoreCustomPlaybackStateOnAdBreakComplete = true, r.enablePreloading = true, this.manager = t.getAdsManager(this.player, r), this.cuePoints = this.manager.getCuePoints(), this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, (s) => this.onAdError(s)), Object.keys(google.ima.AdEvent.Type).forEach((s) => {
|
11774
11813
|
this.manager.addEventListener(google.ima.AdEvent.Type[s], (n) => this.onAdEvent(n));
|
11775
11814
|
}), this.trigger("loaded");
|
11776
|
-
}),
|
11815
|
+
}), f(this, "addCuePoints", () => {
|
11777
11816
|
o.empty(this.cuePoints) || this.cuePoints.forEach((t) => {
|
11778
11817
|
if (t !== 0 && t !== -1 && t < this.player.duration) {
|
11779
11818
|
const r = this.player.elements.progress;
|
@@ -11783,7 +11822,7 @@ class Er {
|
|
11783
11822
|
}
|
11784
11823
|
}
|
11785
11824
|
});
|
11786
|
-
}),
|
11825
|
+
}), f(this, "onAdEvent", (t) => {
|
11787
11826
|
const { container: r } = this.player.elements, s = t.getAd(), n = t.getAdData();
|
11788
11827
|
switch (((a) => {
|
11789
11828
|
w.call(this.player, this.player.media, `ads${a.replace(/_/g, "").toLowerCase()}`);
|
@@ -11806,9 +11845,9 @@ class Er {
|
|
11806
11845
|
case google.ima.AdEvent.Type.LOG:
|
11807
11846
|
n.adError && this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`);
|
11808
11847
|
}
|
11809
|
-
}),
|
11848
|
+
}), f(this, "onAdError", (t) => {
|
11810
11849
|
this.cancel(), this.player.debug.warn("Ads error", t);
|
11811
|
-
}),
|
11850
|
+
}), f(this, "listeners", () => {
|
11812
11851
|
const { container: t } = this.player.elements;
|
11813
11852
|
let r;
|
11814
11853
|
this.player.on("canplay", () => {
|
@@ -11825,7 +11864,7 @@ class Er {
|
|
11825
11864
|
}), window.addEventListener("resize", () => {
|
11826
11865
|
this.manager && this.manager.resize(t.offsetWidth, t.offsetHeight, google.ima.ViewMode.NORMAL);
|
11827
11866
|
});
|
11828
|
-
}),
|
11867
|
+
}), f(this, "play", () => {
|
11829
11868
|
const { container: t } = this.player.elements;
|
11830
11869
|
this.managerPromise || this.resumeContent(), this.managerPromise.then(() => {
|
11831
11870
|
this.manager.setVolume(this.player.volume), this.elements.displayContainer.initialize();
|
@@ -11836,29 +11875,29 @@ class Er {
|
|
11836
11875
|
}
|
11837
11876
|
}).catch(() => {
|
11838
11877
|
});
|
11839
|
-
}),
|
11878
|
+
}), f(this, "resumeContent", () => {
|
11840
11879
|
this.elements.container.style.zIndex = "", this.playing = false, W(this.player.media.play());
|
11841
|
-
}),
|
11880
|
+
}), f(this, "pauseContent", () => {
|
11842
11881
|
this.elements.container.style.zIndex = 3, this.playing = true, this.player.media.pause();
|
11843
|
-
}),
|
11882
|
+
}), f(this, "cancel", () => {
|
11844
11883
|
this.initialized && this.resumeContent(), this.trigger("error"), this.loadAds();
|
11845
|
-
}),
|
11884
|
+
}), f(this, "loadAds", () => {
|
11846
11885
|
this.managerPromise.then(() => {
|
11847
11886
|
this.manager && this.manager.destroy(), this.managerPromise = new Promise((t) => {
|
11848
11887
|
this.on("loaded", t), this.player.debug.log(this.manager);
|
11849
11888
|
}), this.initialized = false, this.requestAds();
|
11850
11889
|
}).catch(() => {
|
11851
11890
|
});
|
11852
|
-
}),
|
11891
|
+
}), f(this, "trigger", (t, ...r) => {
|
11853
11892
|
const s = this.events[t];
|
11854
11893
|
o.array(s) && s.forEach((n) => {
|
11855
11894
|
o.function(n) && n.apply(this, r);
|
11856
11895
|
});
|
11857
|
-
}),
|
11896
|
+
}), f(this, "on", (t, r) => (o.array(this.events[t]) || (this.events[t] = []), this.events[t].push(r), this)), f(this, "startSafetyTimer", (t, r) => {
|
11858
11897
|
this.player.debug.log(`Safety timer invoked from: ${r}`), this.safetyTimer = setTimeout(() => {
|
11859
11898
|
this.cancel(), this.clearSafetyTimer("startSafetyTimer()");
|
11860
11899
|
}, t);
|
11861
|
-
}),
|
11900
|
+
}), f(this, "clearSafetyTimer", (t) => {
|
11862
11901
|
o.nullOrUndefined(this.safetyTimer) || (this.player.debug.log(`Safety timer cleared from: ${t}`), clearTimeout(this.safetyTimer), this.safetyTimer = null);
|
11863
11902
|
}), this.player = i2, this.config = i2.config.ads, this.playing = false, this.initialized = false, this.elements = { container: null, displayContainer: null }, this.manager = null, this.loader = null, this.cuePoints = null, this.events = {}, this.safetyTimer = null, this.countdownTimer = null, this.managerPromise = new Promise((t, r) => {
|
11864
11903
|
this.on("loaded", t), this.on("error", r);
|
@@ -11898,11 +11937,11 @@ const Pr = (e) => {
|
|
11898
11937
|
};
|
11899
11938
|
class at {
|
11900
11939
|
constructor(i2) {
|
11901
|
-
|
11940
|
+
f(this, "load", () => {
|
11902
11941
|
this.player.elements.display.seekTooltip && (this.player.elements.display.seekTooltip.hidden = this.enabled), this.enabled && this.getThumbnails().then(() => {
|
11903
11942
|
this.enabled && (this.render(), this.determineContainerAutoSizing(), this.loaded = true);
|
11904
11943
|
});
|
11905
|
-
}),
|
11944
|
+
}), f(this, "getThumbnails", () => new Promise((t) => {
|
11906
11945
|
const { src: r } = this.player.config.previewThumbnails;
|
11907
11946
|
if (o.empty(r))
|
11908
11947
|
throw new Error("Missing previewThumbnails.src config attribute");
|
@@ -11917,7 +11956,7 @@ class at {
|
|
11917
11956
|
const n = (o.string(r) ? [r] : r).map((a) => this.getThumbnail(a));
|
11918
11957
|
Promise.all(n).then(s);
|
11919
11958
|
}
|
11920
|
-
})),
|
11959
|
+
})), f(this, "getThumbnail", (t) => new Promise((r) => {
|
11921
11960
|
Te(t).then((s) => {
|
11922
11961
|
const n = { frames: Pr(s), height: null, urlPrefix: "" };
|
11923
11962
|
n.frames[0].text.startsWith("/") || n.frames[0].text.startsWith("http://") || n.frames[0].text.startsWith("https://") || (n.urlPrefix = t.substring(0, t.lastIndexOf("/") + 1));
|
@@ -11926,7 +11965,7 @@ class at {
|
|
11926
11965
|
n.height = a.naturalHeight, n.width = a.naturalWidth, this.thumbnails.push(n), r();
|
11927
11966
|
}, a.src = n.urlPrefix + n.frames[0].text;
|
11928
11967
|
});
|
11929
|
-
})),
|
11968
|
+
})), f(this, "startMove", (t) => {
|
11930
11969
|
if (this.loaded && o.event(t) && ["touchmove", "mousemove"].includes(t.type) && this.player.media.duration) {
|
11931
11970
|
if (t.type === "touchmove")
|
11932
11971
|
this.seekTime = this.player.media.duration * (this.player.elements.inputs.seek.value / 100);
|
@@ -11939,15 +11978,15 @@ class at {
|
|
11939
11978
|
}
|
11940
11979
|
this.showImageAtCurrentTime();
|
11941
11980
|
}
|
11942
|
-
}),
|
11981
|
+
}), f(this, "endMove", () => {
|
11943
11982
|
this.toggleThumbContainer(false, true);
|
11944
|
-
}),
|
11983
|
+
}), f(this, "startScrubbing", (t) => {
|
11945
11984
|
(o.nullOrUndefined(t.button) || t.button === false || t.button === 0) && (this.mouseDown = true, this.player.media.duration && (this.toggleScrubbingContainer(true), this.toggleThumbContainer(false, true), this.showImageAtCurrentTime()));
|
11946
|
-
}),
|
11985
|
+
}), f(this, "endScrubbing", () => {
|
11947
11986
|
this.mouseDown = false, Math.ceil(this.lastTime) === Math.ceil(this.player.media.currentTime) ? this.toggleScrubbingContainer(false) : dt.call(this.player, this.player.media, "timeupdate", () => {
|
11948
11987
|
this.mouseDown || this.toggleScrubbingContainer(false);
|
11949
11988
|
});
|
11950
|
-
}),
|
11989
|
+
}), f(this, "listeners", () => {
|
11951
11990
|
this.player.on("play", () => {
|
11952
11991
|
this.toggleThumbContainer(false, true);
|
11953
11992
|
}), this.player.on("seeked", () => {
|
@@ -11955,20 +11994,20 @@ class at {
|
|
11955
11994
|
}), this.player.on("timeupdate", () => {
|
11956
11995
|
this.lastTime = this.player.media.currentTime;
|
11957
11996
|
});
|
11958
|
-
}),
|
11997
|
+
}), f(this, "render", () => {
|
11959
11998
|
this.elements.thumb.container = _("div", { class: this.player.config.classNames.previewThumbnails.thumbContainer }), this.elements.thumb.imageContainer = _("div", { class: this.player.config.classNames.previewThumbnails.imageContainer }), this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);
|
11960
11999
|
const t = _("div", { class: this.player.config.classNames.previewThumbnails.timeContainer });
|
11961
12000
|
this.elements.thumb.time = _("span", {}, "00:00"), t.appendChild(this.elements.thumb.time), this.elements.thumb.imageContainer.appendChild(t), o.element(this.player.elements.progress) && this.player.elements.progress.appendChild(this.elements.thumb.container), this.elements.scrubbing.container = _("div", { class: this.player.config.classNames.previewThumbnails.scrubbingContainer }), this.player.elements.wrapper.appendChild(this.elements.scrubbing.container);
|
11962
|
-
}),
|
12001
|
+
}), f(this, "destroy", () => {
|
11963
12002
|
this.elements.thumb.container && this.elements.thumb.container.remove(), this.elements.scrubbing.container && this.elements.scrubbing.container.remove();
|
11964
|
-
}),
|
12003
|
+
}), f(this, "showImageAtCurrentTime", () => {
|
11965
12004
|
this.mouseDown ? this.setScrubbingContainerSize() : this.setThumbContainerSizeAndPos();
|
11966
12005
|
const t = this.thumbnails[0].frames.findIndex((n) => this.seekTime >= n.startTime && this.seekTime <= n.endTime), r = t >= 0;
|
11967
12006
|
let s = 0;
|
11968
12007
|
this.mouseDown || this.toggleThumbContainer(r), r && (this.thumbnails.forEach((n, a) => {
|
11969
12008
|
this.loadedImages.includes(n.frames[t].text) && (s = a);
|
11970
12009
|
}), t !== this.showingThumb && (this.showingThumb = t, this.loadImage(s)));
|
11971
|
-
}),
|
12010
|
+
}), f(this, "loadImage", (t = 0) => {
|
11972
12011
|
const r = this.showingThumb, s = this.thumbnails[t], { urlPrefix: n } = s, a = s.frames[r], l = s.frames[r].text, d = n + l;
|
11973
12012
|
if (this.currentImageElement && this.currentImageElement.dataset.filename === l)
|
11974
12013
|
this.showImage(this.currentImageElement, a, t, r, l, false), this.currentImageElement.dataset.index = r, this.removeOldImages(this.currentImageElement);
|
@@ -11977,9 +12016,9 @@ class at {
|
|
11977
12016
|
const c = new Image();
|
11978
12017
|
c.src = d, c.dataset.index = r, c.dataset.filename = l, this.showingThumbFilename = l, this.player.debug.log(`Loading image: ${d}`), c.onload = () => this.showImage(c, a, t, r, l, true), this.loadingImage = c, this.removeOldImages(c);
|
11979
12018
|
}
|
11980
|
-
}),
|
12019
|
+
}), f(this, "showImage", (t, r, s, n, a, l = true) => {
|
11981
12020
|
this.player.debug.log(`Showing thumb: ${a}. num: ${n}. qual: ${s}. newimg: ${l}`), this.setImageSizeAndOffset(t, r), l && (this.currentImageContainer.appendChild(t), this.currentImageElement = t, this.loadedImages.includes(a) || this.loadedImages.push(a)), this.preloadNearby(n, true).then(this.preloadNearby(n, false)).then(this.getHigherQuality(s, t, r, a));
|
11982
|
-
}),
|
12021
|
+
}), f(this, "removeOldImages", (t) => {
|
11983
12022
|
Array.from(this.currentImageContainer.children).forEach((r) => {
|
11984
12023
|
if (r.tagName.toLowerCase() !== "img")
|
11985
12024
|
return;
|
@@ -11992,7 +12031,7 @@ class at {
|
|
11992
12031
|
}, s);
|
11993
12032
|
}
|
11994
12033
|
});
|
11995
|
-
}),
|
12034
|
+
}), f(this, "preloadNearby", (t, r = true) => new Promise((s) => {
|
11996
12035
|
setTimeout(() => {
|
11997
12036
|
const n = this.thumbnails[0].frames[t].text;
|
11998
12037
|
if (this.showingThumbFilename === n) {
|
@@ -12003,30 +12042,30 @@ class at {
|
|
12003
12042
|
const c = d.text;
|
12004
12043
|
if (c !== n && !this.loadedImages.includes(c)) {
|
12005
12044
|
l = true, this.player.debug.log(`Preloading thumb filename: ${c}`);
|
12006
|
-
const { urlPrefix: u } = this.thumbnails[0],
|
12007
|
-
p.src =
|
12045
|
+
const { urlPrefix: u } = this.thumbnails[0], m = u + c, p = new Image();
|
12046
|
+
p.src = m, p.onload = () => {
|
12008
12047
|
this.player.debug.log(`Preloaded thumb filename: ${c}`), this.loadedImages.includes(c) || this.loadedImages.push(c), s();
|
12009
12048
|
};
|
12010
12049
|
}
|
12011
12050
|
}), l || s();
|
12012
12051
|
}
|
12013
12052
|
}, 300);
|
12014
|
-
})),
|
12053
|
+
})), f(this, "getHigherQuality", (t, r, s, n) => {
|
12015
12054
|
if (t < this.thumbnails.length - 1) {
|
12016
12055
|
let a = r.naturalHeight;
|
12017
12056
|
this.usingSprites && (a = s.h), a < this.thumbContainerHeight && setTimeout(() => {
|
12018
12057
|
this.showingThumbFilename === n && (this.player.debug.log(`Showing higher quality thumb for: ${n}`), this.loadImage(t + 1));
|
12019
12058
|
}, 300);
|
12020
12059
|
}
|
12021
|
-
}),
|
12060
|
+
}), f(this, "toggleThumbContainer", (t = false, r = false) => {
|
12022
12061
|
const s = this.player.config.classNames.previewThumbnails.thumbContainerShown;
|
12023
12062
|
this.elements.thumb.container.classList.toggle(s, t), !t && r && (this.showingThumb = null, this.showingThumbFilename = null);
|
12024
|
-
}),
|
12063
|
+
}), f(this, "toggleScrubbingContainer", (t = false) => {
|
12025
12064
|
const r = this.player.config.classNames.previewThumbnails.scrubbingContainerShown;
|
12026
12065
|
this.elements.scrubbing.container.classList.toggle(r, t), t || (this.showingThumb = null, this.showingThumbFilename = null);
|
12027
|
-
}),
|
12066
|
+
}), f(this, "determineContainerAutoSizing", () => {
|
12028
12067
|
(this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) && (this.sizeSpecifiedInCSS = true);
|
12029
|
-
}),
|
12068
|
+
}), f(this, "setThumbContainerSizeAndPos", () => {
|
12030
12069
|
const { imageContainer: t } = this.elements.thumb;
|
12031
12070
|
if (this.sizeSpecifiedInCSS) {
|
12032
12071
|
if (t.clientHeight > 20 && t.clientWidth < 20) {
|
@@ -12041,13 +12080,13 @@ class at {
|
|
12041
12080
|
t.style.height = `${this.thumbContainerHeight}px`, t.style.width = `${r}px`;
|
12042
12081
|
}
|
12043
12082
|
this.setThumbContainerPos();
|
12044
|
-
}),
|
12083
|
+
}), f(this, "setThumbContainerPos", () => {
|
12045
12084
|
const t = this.player.elements.progress.getBoundingClientRect(), r = this.player.elements.container.getBoundingClientRect(), { container: s } = this.elements.thumb, n = r.left - t.left + 10, a = r.right - t.left - s.clientWidth - 10, l = this.mousePosX - t.left - s.clientWidth / 2, d = si(l, n, a);
|
12046
12085
|
s.style.left = `${d}px`, s.style.setProperty("--preview-arrow-offset", l - d + "px");
|
12047
|
-
}),
|
12086
|
+
}), f(this, "setScrubbingContainerSize", () => {
|
12048
12087
|
const { width: t, height: r } = kt(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight });
|
12049
12088
|
this.elements.scrubbing.container.style.width = `${t}px`, this.elements.scrubbing.container.style.height = `${r}px`;
|
12050
|
-
}),
|
12089
|
+
}), f(this, "setImageSizeAndOffset", (t, r) => {
|
12051
12090
|
if (!this.usingSprites)
|
12052
12091
|
return;
|
12053
12092
|
const s = this.thumbContainerHeight / r.h;
|
@@ -12093,38 +12132,38 @@ const ot = { insertElements(e, i2) {
|
|
12093
12132
|
} };
|
12094
12133
|
class xe {
|
12095
12134
|
constructor(i2, t) {
|
12096
|
-
if (
|
12135
|
+
if (f(this, "play", () => o.function(this.media.play) ? (this.ads && this.ads.enabled && this.ads.managerPromise.then(() => this.ads.play()).catch(() => W(this.media.play())), this.media.play()) : null), f(this, "pause", () => this.playing && o.function(this.media.pause) ? this.media.pause() : null), f(this, "togglePlay", (l) => (o.boolean(l) ? l : !this.playing) ? this.play() : this.pause()), f(this, "stop", () => {
|
12097
12136
|
this.isHTML5 ? (this.pause(), this.restart()) : o.function(this.media.stop) && this.media.stop();
|
12098
|
-
}),
|
12137
|
+
}), f(this, "restart", () => {
|
12099
12138
|
this.currentTime = 0;
|
12100
|
-
}),
|
12139
|
+
}), f(this, "rewind", (l) => {
|
12101
12140
|
this.currentTime -= o.number(l) ? l : this.config.seekTime;
|
12102
|
-
}),
|
12141
|
+
}), f(this, "forward", (l) => {
|
12103
12142
|
this.currentTime += o.number(l) ? l : this.config.seekTime;
|
12104
|
-
}),
|
12143
|
+
}), f(this, "increaseVolume", (l) => {
|
12105
12144
|
const d = this.media.muted ? 0 : this.volume;
|
12106
12145
|
this.volume = d + (o.number(l) ? l : 0);
|
12107
|
-
}),
|
12146
|
+
}), f(this, "decreaseVolume", (l) => {
|
12108
12147
|
this.increaseVolume(-l);
|
12109
|
-
}),
|
12148
|
+
}), f(this, "airplay", () => {
|
12110
12149
|
I.airplay && this.media.webkitShowPlaybackTargetPicker();
|
12111
|
-
}),
|
12150
|
+
}), f(this, "toggleControls", (l) => {
|
12112
12151
|
if (this.supported.ui && !this.isAudio) {
|
12113
12152
|
const d = Ie(this.elements.container, this.config.classNames.hideControls), c = l === void 0 ? void 0 : !l, u = A(this.elements.container, this.config.classNames.hideControls, c);
|
12114
12153
|
if (u && o.array(this.config.controls) && this.config.controls.includes("settings") && !o.empty(this.config.settings) && h.toggleMenu.call(this, false), u !== d) {
|
12115
|
-
const
|
12116
|
-
w.call(this, this.media,
|
12154
|
+
const m = u ? "controlshidden" : "controlsshown";
|
12155
|
+
w.call(this, this.media, m);
|
12117
12156
|
}
|
12118
12157
|
return !u;
|
12119
12158
|
}
|
12120
12159
|
return false;
|
12121
|
-
}),
|
12160
|
+
}), f(this, "on", (l, d) => {
|
12122
12161
|
E.call(this, this.elements.container, l, d);
|
12123
|
-
}),
|
12162
|
+
}), f(this, "once", (l, d) => {
|
12124
12163
|
dt.call(this, this.elements.container, l, d);
|
12125
|
-
}),
|
12164
|
+
}), f(this, "off", (l, d) => {
|
12126
12165
|
je(this.elements.container, l, d);
|
12127
|
-
}),
|
12166
|
+
}), f(this, "destroy", (l, d = false) => {
|
12128
12167
|
if (!this.ready)
|
12129
12168
|
return;
|
12130
12169
|
const c = () => {
|
@@ -12133,7 +12172,7 @@ class xe {
|
|
12133
12172
|
}, 200));
|
12134
12173
|
};
|
12135
12174
|
this.stop(), clearTimeout(this.timers.loading), clearTimeout(this.timers.controls), clearTimeout(this.timers.resized), this.isHTML5 ? (M.toggleNativeControls.call(this, true), c()) : this.isYouTube ? (clearInterval(this.timers.buffering), clearInterval(this.timers.playing), this.embed !== null && o.function(this.embed.destroy) && this.embed.destroy(), c()) : this.isVimeo && (this.embed !== null && this.embed.unload().then(c), setTimeout(c, 200));
|
12136
|
-
}),
|
12175
|
+
}), f(this, "supports", (l) => I.mime.call(this, l)), this.timers = {}, this.ready = false, this.loading = false, this.failed = false, this.touch = I.touch, this.media = i2, o.string(this.media) && (this.media = document.querySelectorAll(this.media)), (window.jQuery && this.media instanceof jQuery || o.nodeList(this.media) || o.array(this.media)) && (this.media = this.media[0]), this.config = z({}, ii, xe.defaults, t || {}, (() => {
|
12137
12176
|
try {
|
12138
12177
|
return JSON.parse(this.media.getAttribute("data-plyr-config"));
|
12139
12178
|
} catch {
|
@@ -12359,7 +12398,7 @@ function Mr(e) {
|
|
12359
12398
|
let i2, t, r;
|
12360
12399
|
return {
|
12361
12400
|
c() {
|
12362
|
-
i2 = ie("video"), t = ie("source"), St(t.src, r = e[3]) ||
|
12401
|
+
i2 = ie("video"), t = ie("source"), St(t.src, r = e[3]) || g(t, "src", r), g(t, "type", e[2]), g(i2, "data-app-kind", "Plyr"), g(i2, "crossorigin", "anonymous"), i2.playsInline = true, g(i2, "data-poster", e[4]);
|
12363
12402
|
},
|
12364
12403
|
m(s, n) {
|
12365
12404
|
te(s, i2, n), k(i2, t), e[8](i2);
|
@@ -12374,7 +12413,7 @@ function Nr(e) {
|
|
12374
12413
|
let i2, t, r;
|
12375
12414
|
return {
|
12376
12415
|
c() {
|
12377
|
-
i2 = ie("audio"), t = ie("source"), St(t.src, r = e[3]) ||
|
12416
|
+
i2 = ie("audio"), t = ie("source"), St(t.src, r = e[3]) || g(t, "src", r), g(t, "type", e[2]), g(i2, "data-app-kind", "Plyr"), g(i2, "crossorigin", "anonymous"), g(i2, "data-poster", e[4]);
|
12378
12417
|
},
|
12379
12418
|
m(s, n) {
|
12380
12419
|
te(s, i2, n), k(i2, t), e[7](i2);
|
@@ -12393,7 +12432,7 @@ function Lr(e) {
|
|
12393
12432
|
return {
|
12394
12433
|
c() {
|
12395
12434
|
i2 = ie("div"), t = Ge(`Invalid "src" or "type".
|
12396
|
-
`), s = Ge(r),
|
12435
|
+
`), s = Ge(r), g(i2, "data-app-kind", "Plyr"), g(i2, "class", "plyr--audio");
|
12397
12436
|
},
|
12398
12437
|
m(n, a) {
|
12399
12438
|
te(n, i2, a), k(i2, t), k(i2, s);
|
@@ -12413,7 +12452,7 @@ function Ir(e) {
|
|
12413
12452
|
let i2;
|
12414
12453
|
return {
|
12415
12454
|
c() {
|
12416
|
-
i2 = ie("div"),
|
12455
|
+
i2 = ie("div"), g(i2, "data-app-kind", "Plyr"), g(i2, "class", "plyr__video-embed"), g(i2, "data-plyr-provider", "youtube"), g(i2, "data-plyr-embed-id", e[3]), g(i2, "data-poster", e[4]);
|
12417
12456
|
},
|
12418
12457
|
m(t, r) {
|
12419
12458
|
te(t, i2, r), e[6](i2);
|
@@ -12479,7 +12518,7 @@ function $r(e, i2, t) {
|
|
12479
12518
|
console.warn("[Plyr] destroy plyr error", b);
|
12480
12519
|
}
|
12481
12520
|
});
|
12482
|
-
function
|
12521
|
+
function m(b) {
|
12483
12522
|
be[b ? "unshift" : "push"](() => {
|
12484
12523
|
c = b, t(1, c);
|
12485
12524
|
});
|
@@ -12503,7 +12542,7 @@ function $r(e, i2, t) {
|
|
12503
12542
|
a,
|
12504
12543
|
l,
|
12505
12544
|
s,
|
12506
|
-
|
12545
|
+
m,
|
12507
12546
|
p,
|
12508
12547
|
v
|
12509
12548
|
];
|
@@ -12552,7 +12591,10 @@ class jr {
|
|
12552
12591
|
if (!t)
|
12553
12592
|
return;
|
12554
12593
|
const { currentTime: n, hostTime: a, muted: l, paused: d, volume: c, owner: u } = s.state;
|
12555
|
-
i2 === "owner" && u === this.uid && r.isWritable
|
12594
|
+
if (i2 === "owner" && u === this.uid && r.isWritable)
|
12595
|
+
return;
|
12596
|
+
let m = d;
|
12597
|
+
!m && r.isReplay && ["pause", "ended", "stop"].includes(r.displayer.phase) && (m = true), m !== t.paused && !this._skip_next_play_pause && (m ? t.pause() : Si(t)), l !== t.muted && (t.muted = l), c !== t.volume && (t.volume = c), !this._buffering && (d ? Math.abs(t.currentTime - n) > 0.5 && (t.currentTime = n) : this.syncCurrentTime(a, n, t));
|
12556
12598
|
}
|
12557
12599
|
watchUserInputs(i2) {
|
12558
12600
|
const t = i2.elements.controls, r = Ni(i2.elements.buttons.play), s = t == null ? void 0 : t.querySelector('input[data-plyr="seek"]'), n = t == null ? void 0 : t.querySelector('button[data-plyr="mute"]'), a = t == null ? void 0 : t.querySelector('input[data-plyr="volume"]');
|
@@ -12746,39 +12788,24 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12746
12788
|
const _WindowManager = class extends InvisiblePlugin {
|
12747
12789
|
constructor(context) {
|
12748
12790
|
super(context);
|
12749
|
-
this.version = "1.0.0-canary.
|
12750
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.
|
12791
|
+
this.version = "1.0.0-canary.66";
|
12792
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.3", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
|
12751
12793
|
this.emitter = callbacks;
|
12752
12794
|
this.viewMode$ = new Val(ViewMode.Broadcaster);
|
12753
12795
|
this.playground$ = new Val(void 0);
|
12754
12796
|
this.isReplay = isPlayer(this.displayer);
|
12755
12797
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
12756
12798
|
this.moveCamera = (camera) => {
|
12757
|
-
var _a2;
|
12799
|
+
var _a2, _b;
|
12758
12800
|
const pureCamera = omit(camera, ["animationMode"]);
|
12759
12801
|
const mainViewCamera = __spreadValues({}, this.mainView.camera);
|
12760
12802
|
if (isEqual(__spreadValues(__spreadValues({}, mainViewCamera), pureCamera), mainViewCamera))
|
12761
12803
|
return;
|
12762
|
-
this.
|
12763
|
-
this.
|
12764
|
-
(_a2 = this.appManager) == null ? void 0 : _a2.dispatchInternalEvent(Events.MoveCamera, camera);
|
12804
|
+
(_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.moveCamera(camera);
|
12805
|
+
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12765
12806
|
};
|
12766
|
-
this.debouncedStoreCamera = () => {
|
12767
|
-
const cameraListener = debounce(() => {
|
12768
|
-
var _a2;
|
12769
|
-
(_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.saveToCamera$();
|
12770
|
-
this.storeCamera();
|
12771
|
-
this.mainView.callbacks.off("onCameraUpdated", cameraListener);
|
12772
|
-
}, 50);
|
12773
|
-
this.mainView.callbacks.on("onCameraUpdated", cameraListener);
|
12774
|
-
};
|
12775
|
-
this.storeCamera = debounce(() => {
|
12776
|
-
var _a2, _b;
|
12777
|
-
(_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.storeCurrentCamera();
|
12778
|
-
(_b = this.appManager) == null ? void 0 : _b.mainViewProxy.storeCurrentSize();
|
12779
|
-
}, 300);
|
12780
12807
|
_WindowManager.displayer = context.displayer;
|
12781
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.
|
12808
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.3", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
|
12782
12809
|
}
|
12783
12810
|
static mount(params) {
|
12784
12811
|
return __async(this, null, function* () {
|
@@ -13344,7 +13371,6 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13344
13371
|
}
|
13345
13372
|
moveCameraToContain(rectangle) {
|
13346
13373
|
var _a2;
|
13347
|
-
this.debouncedStoreCamera();
|
13348
13374
|
this.mainView.moveCameraToContain(rectangle);
|
13349
13375
|
(_a2 = this.appManager) == null ? void 0 : _a2.dispatchInternalEvent(Events.MoveCameraToContain, rectangle);
|
13350
13376
|
}
|