@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.umd.js
CHANGED
@@ -1264,6 +1264,7 @@
|
|
1264
1264
|
constructor(saveCamera) {
|
1265
1265
|
this.saveCamera = saveCamera;
|
1266
1266
|
this.scale = 1;
|
1267
|
+
this.cameraUpdating = false;
|
1267
1268
|
this.setRect = (rect, updateCamera = true) => {
|
1268
1269
|
this.rect = rect;
|
1269
1270
|
if (this.remoteCamera && this.remoteSize && updateCamera) {
|
@@ -2464,6 +2465,39 @@
|
|
2464
2465
|
})
|
2465
2466
|
);
|
2466
2467
|
};
|
2468
|
+
this.moveCamera = (camera) => {
|
2469
|
+
this.debouncedStoreCamera();
|
2470
|
+
this.moveCameraToPromise(camera);
|
2471
|
+
};
|
2472
|
+
this.moveCameraToPromise = (camera) => {
|
2473
|
+
const promise = new Promise((resolve) => {
|
2474
|
+
const cameraListener = lodash.debounce(() => {
|
2475
|
+
this.mainView.callbacks.off("onCameraUpdated", cameraListener);
|
2476
|
+
this.cameraUpdatePromise = void 0;
|
2477
|
+
resolve(true);
|
2478
|
+
}, 50);
|
2479
|
+
this.mainView.callbacks.on("onCameraUpdated", cameraListener);
|
2480
|
+
this.mainView.moveCamera(camera);
|
2481
|
+
});
|
2482
|
+
this.cameraUpdatePromise = promise;
|
2483
|
+
return promise;
|
2484
|
+
};
|
2485
|
+
this.debouncedStoreCamera = () => {
|
2486
|
+
this.storeCurrentSize();
|
2487
|
+
const cameraListener = lodash.debounce(() => {
|
2488
|
+
this.saveToCamera$();
|
2489
|
+
this.storeCurrentCameraSize();
|
2490
|
+
this.mainView.callbacks.off("onCameraUpdated", cameraListener);
|
2491
|
+
}, 50);
|
2492
|
+
this.mainView.callbacks.on("onCameraUpdated", cameraListener);
|
2493
|
+
};
|
2494
|
+
this.storeCurrentCameraSize = lodash.debounce(() => __async$4(this, null, function* () {
|
2495
|
+
if (this.cameraUpdatePromise) {
|
2496
|
+
yield this.cameraUpdatePromise;
|
2497
|
+
}
|
2498
|
+
this.storeCurrentCamera();
|
2499
|
+
this.storeCurrentSize();
|
2500
|
+
}), 500);
|
2467
2501
|
this.addCameraReaction = () => {
|
2468
2502
|
this.manager.refresher.add(Fields.MainViewCamera, this.cameraReaction);
|
2469
2503
|
this.manager.refresher.add(Fields.MainViewSize, this.sizeReaction);
|
@@ -2482,11 +2516,14 @@
|
|
2482
2516
|
var _a2;
|
2483
2517
|
const rect = (_a2 = this.manager.boxManager) == null ? void 0 : _a2.stageRect;
|
2484
2518
|
if (rect) {
|
2485
|
-
|
2519
|
+
const size = {
|
2486
2520
|
id: this.manager.uid,
|
2487
2521
|
width: rect.width,
|
2488
2522
|
height: rect.height
|
2489
|
-
}
|
2523
|
+
};
|
2524
|
+
if (!lodash.isEqual(size, this.mainViewSize)) {
|
2525
|
+
this.storeSize(size);
|
2526
|
+
}
|
2490
2527
|
}
|
2491
2528
|
};
|
2492
2529
|
this.storeCamera = (camera) => {
|
@@ -2877,6 +2914,8 @@
|
|
2877
2914
|
});
|
2878
2915
|
this.sideEffect.add(() => {
|
2879
2916
|
const onCameraUpdated = (camera) => {
|
2917
|
+
if (!this.manager.canOperate)
|
2918
|
+
return;
|
2880
2919
|
const halfWbHeight = size$.value.height / 2 / scale$.value;
|
2881
2920
|
const scrollTop = camera.centerY;
|
2882
2921
|
this.scrollStorage.setState({
|
@@ -9003,30 +9042,30 @@
|
|
9003
9042
|
if (w2.thumbnail)
|
9004
9043
|
return w2;
|
9005
9044
|
try {
|
9006
|
-
const
|
9007
|
-
return
|
9008
|
-
} catch (
|
9009
|
-
return console.error(
|
9045
|
+
const f2 = new URL(w2.src);
|
9046
|
+
return f2.searchParams.set("x-oss-process", "image/resize,l_50"), { ...w2, thumbnail: f2.toString() };
|
9047
|
+
} catch (f2) {
|
9048
|
+
return console.error(f2), w2;
|
9010
9049
|
}
|
9011
9050
|
})
|
9012
9051
|
);
|
9013
9052
|
const o2 = valueEnhancer.derive(s, (d) => {
|
9014
9053
|
const w2 = Array(d.length);
|
9015
|
-
for (let
|
9016
|
-
w2[
|
9054
|
+
for (let f2 = 0; f2 < d.length; f2++)
|
9055
|
+
w2[f2] = f2 > 0 ? w2[f2 - 1] + d[f2 - 1].height : 0;
|
9017
9056
|
return w2;
|
9018
9057
|
}), l = valueEnhancer.derive(s, (d) => {
|
9019
9058
|
let w2 = 1 / 0;
|
9020
|
-
for (let
|
9021
|
-
d[
|
9059
|
+
for (let f2 = d.length - 1; f2 >= 0; f2--)
|
9060
|
+
d[f2].height <= w2 && (w2 = d[f2].height);
|
9022
9061
|
return w2;
|
9023
9062
|
}), c = valueEnhancer.combine(
|
9024
9063
|
[e, o2, s],
|
9025
|
-
([d, w2,
|
9026
|
-
if (w2.length !==
|
9064
|
+
([d, w2, f2]) => {
|
9065
|
+
if (w2.length !== f2.length)
|
9027
9066
|
return c.value;
|
9028
9067
|
for (let v = 0; v < w2.length; v++)
|
9029
|
-
if (w2[v] +
|
9068
|
+
if (w2[v] + f2[v].height - d >= 1e-3)
|
9030
9069
|
return v;
|
9031
9070
|
return w2.length - 1;
|
9032
9071
|
}
|
@@ -9035,7 +9074,7 @@
|
|
9035
9074
|
([d, w2]) => d.width / w2.width || 1
|
9036
9075
|
), a = valueEnhancer.combine(
|
9037
9076
|
[s, t, l, h2],
|
9038
|
-
([d, w2,
|
9077
|
+
([d, w2, f2, v]) => S$1(Math.ceil(w2.height / v / f2 / 2), 1, d.length)
|
9039
9078
|
);
|
9040
9079
|
valueEnhancer.withReadonlyValueEnhancer(this, {
|
9041
9080
|
pagesScrollTop: e,
|
@@ -9055,9 +9094,9 @@
|
|
9055
9094
|
this.sideEffect.setTimeout(g2, 1e3, "turn-off-hwa"), p.setValue(true);
|
9056
9095
|
};
|
9057
9096
|
this.sideEffect.addDisposer(
|
9058
|
-
valueEnhancer.combine([c, a, s]).subscribe(([d, w2,
|
9097
|
+
valueEnhancer.combine([c, a, s]).subscribe(([d, w2, f2]) => {
|
9059
9098
|
u();
|
9060
|
-
const v = Math.max(d - w2, 0), C = Math.min(d + w2,
|
9099
|
+
const v = Math.max(d - w2, 0), C = Math.min(d + w2, f2.length - 1);
|
9061
9100
|
for (let $ = 0; $ < this.$pages.children.length; $++) {
|
9062
9101
|
const x = this.$pages.children[$], k2 = Number(x.dataset.index);
|
9063
9102
|
k2 >= v && k2 <= C || (x.remove(), $--);
|
@@ -9579,10 +9618,10 @@
|
|
9579
9618
|
const h2 = n.add(() => {
|
9580
9619
|
const a = ({ width: p, height: g2 }) => {
|
9581
9620
|
if (s.length > 0 && t.state !== "maximized") {
|
9582
|
-
const { width: u, height: d } = s[0],
|
9583
|
-
|
9621
|
+
const { width: u, height: d } = s[0], f2 = d / u * p - g2;
|
9622
|
+
f2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9584
9623
|
width: t.intrinsicWidth,
|
9585
|
-
height: t.intrinsicHeight +
|
9624
|
+
height: t.intrinsicHeight + f2 / t.rootRect.height
|
9586
9625
|
});
|
9587
9626
|
}
|
9588
9627
|
n.remove(h2);
|
@@ -9639,7 +9678,7 @@
|
|
9639
9678
|
function di() {
|
9640
9679
|
return Ge(" ");
|
9641
9680
|
}
|
9642
|
-
function
|
9681
|
+
function g(e, i2, t) {
|
9643
9682
|
t == null ? e.removeAttribute(i2) : e.getAttribute(i2) !== t && e.setAttribute(i2, t);
|
9644
9683
|
}
|
9645
9684
|
function pi(e) {
|
@@ -9757,13 +9796,13 @@
|
|
9757
9796
|
};
|
9758
9797
|
a && a(c.root);
|
9759
9798
|
let u = false;
|
9760
|
-
if (c.ctx = t ? t(e, i2.props || {}, (
|
9799
|
+
if (c.ctx = t ? t(e, i2.props || {}, (m, p, ...v) => {
|
9761
9800
|
const b = v.length ? v[0] : p;
|
9762
|
-
return c.ctx && s(c.ctx[
|
9801
|
+
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;
|
9763
9802
|
}) : [], c.update(), u = true, $e(c.before_update), c.fragment = r ? r(c.ctx) : false, i2.target) {
|
9764
9803
|
if (i2.hydrate) {
|
9765
|
-
const
|
9766
|
-
c.fragment && c.fragment.l(
|
9804
|
+
const m = pi(i2.target);
|
9805
|
+
c.fragment && c.fragment.l(m), m.forEach(G);
|
9767
9806
|
} else
|
9768
9807
|
c.fragment && c.fragment.c();
|
9769
9808
|
i2.intro && Pt(e.$$.fragment), Mt(e, i2.target, i2.anchor, i2.customElement), Et();
|
@@ -9947,13 +9986,13 @@
|
|
9947
9986
|
return Array.isArray(e) ? e[0] : e;
|
9948
9987
|
}
|
9949
9988
|
function Li(e) {
|
9950
|
-
let i2, t, r, s, n, a, l, d, c, u,
|
9989
|
+
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;
|
9951
9990
|
return {
|
9952
9991
|
c() {
|
9953
|
-
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"),
|
9992
|
+
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");
|
9954
9993
|
},
|
9955
9994
|
m(We, ni) {
|
9956
|
-
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,
|
9995
|
+
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);
|
9957
9996
|
},
|
9958
9997
|
p: X,
|
9959
9998
|
i: X,
|
@@ -9968,7 +10007,7 @@
|
|
9968
10007
|
super(), Lt(this, i2, null, Li, Ct, {});
|
9969
10008
|
}
|
9970
10009
|
}
|
9971
|
-
function
|
10010
|
+
function f(e, i2, t) {
|
9972
10011
|
return i2 in e ? Object.defineProperty(e, i2, { value: t, enumerable: true, configurable: true, writable: true }) : e[i2] = t, e;
|
9973
10012
|
}
|
9974
10013
|
function zi(e, i2) {
|
@@ -10429,7 +10468,7 @@
|
|
10429
10468
|
} };
|
10430
10469
|
class we {
|
10431
10470
|
constructor(i2) {
|
10432
|
-
|
10471
|
+
f(this, "get", (t) => {
|
10433
10472
|
if (!we.supported || !this.enabled)
|
10434
10473
|
return null;
|
10435
10474
|
const r = window.localStorage.getItem(this.key);
|
@@ -10437,7 +10476,7 @@
|
|
10437
10476
|
return null;
|
10438
10477
|
const s = JSON.parse(r);
|
10439
10478
|
return o.string(t) && t.length ? s[t] : s;
|
10440
|
-
}),
|
10479
|
+
}), f(this, "set", (t) => {
|
10441
10480
|
if (!we.supported || !this.enabled || !o.object(t))
|
10442
10481
|
return;
|
10443
10482
|
let r = this.get();
|
@@ -10817,8 +10856,8 @@
|
|
10817
10856
|
const c = _("div", B(this.config.selectors.controls.wrapper));
|
10818
10857
|
this.elements.controls = c;
|
10819
10858
|
const u = { class: "plyr__controls__item" };
|
10820
|
-
return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((
|
10821
|
-
if (
|
10859
|
+
return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((m) => {
|
10860
|
+
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") {
|
10822
10861
|
const p = _("div", { class: `${u.class} plyr__progress__container` }), v = _("div", B(this.config.selectors.progress));
|
10823
10862
|
if (v.appendChild(s.call(this, "seek", { id: `plyr-seek-${e.id}` })), v.appendChild(r.call(this, "buffer")), this.config.tooltips.seek) {
|
10824
10863
|
const b = _("span", { class: this.config.classNames.tooltip }, "00:00");
|
@@ -10826,39 +10865,39 @@
|
|
10826
10865
|
}
|
10827
10866
|
this.elements.progress = v, p.appendChild(this.elements.progress), c.appendChild(p);
|
10828
10867
|
}
|
10829
|
-
if (
|
10868
|
+
if (m === "current-time" && c.appendChild(n.call(this, "currentTime", u)), m === "duration" && c.appendChild(n.call(this, "duration", u)), m === "mute" || m === "volume") {
|
10830
10869
|
let { volume: p } = this.elements;
|
10831
|
-
if (o.element(p) && c.contains(p) || (p = _("div", z({}, u, { class: `${u.class} plyr__volume`.trim() })), this.elements.volume = p, c.appendChild(p)),
|
10870
|
+
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) {
|
10832
10871
|
const v = { max: 1, step: 0.05, value: this.config.volume };
|
10833
10872
|
p.appendChild(s.call(this, "volume", z(v, { id: `plyr-volume-${e.id}` })));
|
10834
10873
|
}
|
10835
10874
|
}
|
10836
|
-
if (
|
10875
|
+
if (m === "captions" && c.appendChild(t.call(this, "captions", u)), m === "settings" && !o.empty(this.config.settings)) {
|
10837
10876
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10838
10877
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10839
10878
|
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" });
|
10840
10879
|
T2.appendChild(N2), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10841
|
-
const
|
10842
|
-
i2.call(this,
|
10880
|
+
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: "" }));
|
10881
|
+
i2.call(this, y, x), E.call(this, y, "click", () => {
|
10843
10882
|
d.call(this, x, false);
|
10844
10883
|
});
|
10845
10884
|
const C = _("span", null, j.get(x, this.config)), L2 = _("span", { class: this.config.classNames.menu.value });
|
10846
|
-
L2.innerHTML = e[x], C.appendChild(L2),
|
10885
|
+
L2.innerHTML = e[x], C.appendChild(L2), y.appendChild(C), N2.appendChild(y);
|
10847
10886
|
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10848
10887
|
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) => {
|
10849
10888
|
V2.key === "ArrowLeft" && (V2.preventDefault(), V2.stopPropagation(), d.call(this, "home", true));
|
10850
10889
|
}, false), E.call(this, D2, "click", () => {
|
10851
10890
|
d.call(this, "home", false);
|
10852
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] =
|
10891
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10853
10892
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10854
10893
|
}
|
10855
|
-
if (
|
10894
|
+
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") {
|
10856
10895
|
const p = z({}, u, { element: "a", href: this.download, target: "_blank" });
|
10857
10896
|
this.isHTML5 && (p.download = "");
|
10858
10897
|
const { download: v } = this.config.urls;
|
10859
10898
|
!o.url(v) && this.isEmbed && z(p, { icon: `logo-${this.provider}`, label: this.provider }), c.appendChild(t.call(this, "download", p));
|
10860
10899
|
}
|
10861
|
-
|
10900
|
+
m === "fullscreen" && c.appendChild(t.call(this, "fullscreen", u));
|
10862
10901
|
}), this.isHTML5 && a.call(this, Q.getQualityOptions.call(this)), l.call(this), c;
|
10863
10902
|
}, inject() {
|
10864
10903
|
if (this.config.loadSprite) {
|
@@ -11058,14 +11097,14 @@
|
|
11058
11097
|
}
|
11059
11098
|
class U {
|
11060
11099
|
constructor(i2) {
|
11061
|
-
|
11100
|
+
f(this, "onChange", () => {
|
11062
11101
|
if (!this.enabled)
|
11063
11102
|
return;
|
11064
11103
|
const t = this.player.elements.buttons.fullscreen;
|
11065
11104
|
o.element(t) && (t.pressed = this.active);
|
11066
11105
|
const r = this.target === this.player.media ? this.target : this.player.elements.container;
|
11067
11106
|
w.call(this.player, r, this.active ? "enterfullscreen" : "exitfullscreen", true);
|
11068
|
-
}),
|
11107
|
+
}), f(this, "toggleFallback", (t = false) => {
|
11069
11108
|
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) {
|
11070
11109
|
let r = document.head.querySelector('meta[name="viewport"]');
|
11071
11110
|
const s = "viewport-fit=cover";
|
@@ -11074,21 +11113,21 @@
|
|
11074
11113
|
t ? (this.cleanupViewport = !n, n || (r.content += `,${s}`)) : this.cleanupViewport && (r.content = r.content.split(",").filter((a) => a.trim() !== s).join(","));
|
11075
11114
|
}
|
11076
11115
|
this.onChange();
|
11077
|
-
}),
|
11116
|
+
}), f(this, "trapFocus", (t) => {
|
11078
11117
|
if (H.isIos || !this.active || t.key !== "Tab")
|
11079
11118
|
return;
|
11080
11119
|
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];
|
11081
11120
|
r !== a || t.shiftKey ? r === n && t.shiftKey && (a.focus(), t.preventDefault()) : (n.focus(), t.preventDefault());
|
11082
|
-
}),
|
11121
|
+
}), f(this, "update", () => {
|
11083
11122
|
if (this.enabled) {
|
11084
11123
|
let t;
|
11085
11124
|
t = this.forceFallback ? "Fallback (forced)" : U.native ? "Native" : "Fallback", this.player.debug.log(`${t} fullscreen enabled`);
|
11086
11125
|
} else
|
11087
11126
|
this.player.debug.log("Fullscreen not supported and fallback disabled");
|
11088
11127
|
A(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);
|
11089
|
-
}),
|
11128
|
+
}), f(this, "enter", () => {
|
11090
11129
|
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" }));
|
11091
|
-
}),
|
11130
|
+
}), f(this, "exit", () => {
|
11092
11131
|
if (this.enabled)
|
11093
11132
|
if (H.isIos && this.player.config.fullscreen.iosNative)
|
11094
11133
|
this.target.webkitExitFullscreen(), W(this.player.play());
|
@@ -11101,7 +11140,7 @@
|
|
11101
11140
|
}
|
11102
11141
|
} else
|
11103
11142
|
(document.cancelFullScreen || document.exitFullscreen).call(document);
|
11104
|
-
}),
|
11143
|
+
}), f(this, "toggle", () => {
|
11105
11144
|
this.active ? this.exit() : this.enter();
|
11106
11145
|
}), 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`, () => {
|
11107
11146
|
this.onChange();
|
@@ -11199,10 +11238,10 @@
|
|
11199
11238
|
} };
|
11200
11239
|
class wr {
|
11201
11240
|
constructor(i2) {
|
11202
|
-
|
11241
|
+
f(this, "firstTouch", () => {
|
11203
11242
|
const { player: t } = this, { elements: r } = t;
|
11204
11243
|
t.touch = true, A(r.container, t.config.classNames.isTouch, true);
|
11205
|
-
}),
|
11244
|
+
}), f(this, "setTabFocus", (t) => {
|
11206
11245
|
const { player: r } = this, { elements: s } = r, { key: n, type: a, timeStamp: l } = t;
|
11207
11246
|
if (clearTimeout(this.focusTimer), a === "keydown" && n !== "Tab")
|
11208
11247
|
return;
|
@@ -11215,10 +11254,10 @@
|
|
11215
11254
|
const c = document.activeElement;
|
11216
11255
|
s.container.contains(c) && A(document.activeElement, r.config.classNames.tabFocus, true);
|
11217
11256
|
}, 10)));
|
11218
|
-
}),
|
11257
|
+
}), f(this, "global", (t = true) => {
|
11219
11258
|
const { player: r } = this;
|
11220
11259
|
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);
|
11221
|
-
}),
|
11260
|
+
}), f(this, "container", () => {
|
11222
11261
|
const { player: t } = this, { config: r, elements: s, timers: n } = t;
|
11223
11262
|
!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) => {
|
11224
11263
|
const { controls: c } = s;
|
@@ -11229,11 +11268,11 @@
|
|
11229
11268
|
const a = () => {
|
11230
11269
|
if (!t.isVimeo || t.config.vimeo.premium)
|
11231
11270
|
return;
|
11232
|
-
const d = s.wrapper, { active: c } = t.fullscreen, [u,
|
11271
|
+
const d = s.wrapper, { active: c } = t.fullscreen, [u, m] = pt.call(t), p = Kt(`aspect-ratio: ${u} / ${m}`);
|
11233
11272
|
if (!c)
|
11234
11273
|
return void (p ? (d.style.width = null, d.style.height = null) : (d.style.maxWidth = null, d.style.margin = null));
|
11235
|
-
const [v, b] = pr(), T2 = v / b > u /
|
11236
|
-
p ? (d.style.width = T2 ? "auto" : "100%", d.style.height = T2 ? "100%" : "auto") : (d.style.maxWidth = T2 ? b /
|
11274
|
+
const [v, b] = pr(), T2 = v / b > u / m;
|
11275
|
+
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);
|
11237
11276
|
}, l = () => {
|
11238
11277
|
clearTimeout(n.resized), n.resized = setTimeout(a, 50);
|
11239
11278
|
};
|
@@ -11241,7 +11280,7 @@
|
|
11241
11280
|
const { target: c } = t.fullscreen;
|
11242
11281
|
c === s.container && (!t.isEmbed && o.empty(t.config.ratio) || (a(), (d.type === "enterfullscreen" ? E : je).call(t, window, "resize", l)));
|
11243
11282
|
});
|
11244
|
-
}),
|
11283
|
+
}), f(this, "media", () => {
|
11245
11284
|
const { player: t } = this, { elements: r } = t;
|
11246
11285
|
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", () => {
|
11247
11286
|
t.isHTML5 && t.isVideo && t.config.resetOnEnd && (t.restart(), t.pause());
|
@@ -11273,14 +11312,14 @@
|
|
11273
11312
|
let { detail: a = {} } = n;
|
11274
11313
|
n.type === "error" && (a = t.media.error), w.call(t, r.container, n.type, true, a);
|
11275
11314
|
});
|
11276
|
-
}),
|
11315
|
+
}), f(this, "proxy", (t, r, s) => {
|
11277
11316
|
const { player: n } = this, a = n.config.listeners[s];
|
11278
11317
|
let l = true;
|
11279
11318
|
o.function(a) && (l = a.call(n, t)), l !== false && o.function(r) && r.call(n, t);
|
11280
|
-
}),
|
11319
|
+
}), f(this, "bind", (t, r, s, n, a = true) => {
|
11281
11320
|
const { player: l } = this, d = l.config.listeners[n], c = o.function(d);
|
11282
11321
|
E.call(l, t, r, (u) => this.proxy(u, s, n), a && !c);
|
11283
|
-
}),
|
11322
|
+
}), f(this, "controls", () => {
|
11284
11323
|
const { player: t } = this, { elements: r } = t, s = H.isIE ? "change" : "input";
|
11285
11324
|
if (r.buttons.play && Array.from(r.buttons.play).forEach((n) => {
|
11286
11325
|
this.bind(n, "click", () => {
|
@@ -11356,7 +11395,7 @@
|
|
11356
11395
|
const l = this.touch ? 3e3 : 4e3;
|
11357
11396
|
clearTimeout(a.controls), a.controls = setTimeout(() => M.toggleControls.call(t, false), l);
|
11358
11397
|
}), this.bind(r.inputs.volume, "wheel", (n) => {
|
11359
|
-
const a = n.webkitDirectionInvertedFromDevice, [l, d] = [n.deltaX, -n.deltaY].map((
|
11398
|
+
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);
|
11360
11399
|
t.increaseVolume(c / 50);
|
11361
11400
|
const { volume: u } = t.media;
|
11362
11401
|
(c === 1 && u < 1 || c === -1 && u > 0) && n.preventDefault();
|
@@ -11364,7 +11403,7 @@
|
|
11364
11403
|
}), 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);
|
11365
11404
|
}
|
11366
11405
|
handleKey(i2) {
|
11367
|
-
const { player: t } = this, { elements: r } = t, { key: s, type: n, altKey: a, ctrlKey: l, metaKey: d, shiftKey: c } = i2, u = n === "keydown",
|
11406
|
+
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;
|
11368
11407
|
if (!(a || l || d || c) && !!s) {
|
11369
11408
|
if (u) {
|
11370
11409
|
const v = document.activeElement;
|
@@ -11384,11 +11423,11 @@
|
|
11384
11423
|
case "7":
|
11385
11424
|
case "8":
|
11386
11425
|
case "9":
|
11387
|
-
|
11426
|
+
m || (p = parseInt(s, 10), t.currentTime = t.duration / 10 * p);
|
11388
11427
|
break;
|
11389
11428
|
case "Space":
|
11390
11429
|
case "k":
|
11391
|
-
|
11430
|
+
m || W(t.togglePlay());
|
11392
11431
|
break;
|
11393
11432
|
case "ArrowUp":
|
11394
11433
|
t.increaseVolume(0.1);
|
@@ -11397,7 +11436,7 @@
|
|
11397
11436
|
t.decreaseVolume(0.1);
|
11398
11437
|
break;
|
11399
11438
|
case "m":
|
11400
|
-
|
11439
|
+
m || (t.muted = !t.muted);
|
11401
11440
|
break;
|
11402
11441
|
case "ArrowRight":
|
11403
11442
|
t.forward();
|
@@ -11409,7 +11448,7 @@
|
|
11409
11448
|
t.fullscreen.toggle();
|
11410
11449
|
break;
|
11411
11450
|
case "c":
|
11412
|
-
|
11451
|
+
m || t.toggleCaptions();
|
11413
11452
|
break;
|
11414
11453
|
case "l":
|
11415
11454
|
t.loop = !t.loop;
|
@@ -11433,11 +11472,11 @@
|
|
11433
11472
|
}, r = {}, s = {}, n = {};
|
11434
11473
|
function a(p, v) {
|
11435
11474
|
p = p.push ? p : [p];
|
11436
|
-
var b, T2, N2, x = [],
|
11475
|
+
var b, T2, N2, x = [], y = p.length, C = y;
|
11437
11476
|
for (b = function(L2, $) {
|
11438
11477
|
$.length && x.push(L2), --C || v(x);
|
11439
|
-
};
|
11440
|
-
T2 = p[
|
11478
|
+
}; y--; )
|
11479
|
+
T2 = p[y], (N2 = s[T2]) ? b(T2, N2) : (n[T2] = n[T2] || []).push(b);
|
11441
11480
|
}
|
11442
11481
|
function l(p, v) {
|
11443
11482
|
if (p) {
|
@@ -11451,8 +11490,8 @@
|
|
11451
11490
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11452
11491
|
}
|
11453
11492
|
function c(p, v, b, T2) {
|
11454
|
-
var N2, x,
|
11455
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x =
|
11493
|
+
var N2, x, y = document, C = b.async, L2 = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V2 = p.replace(/^(css|img)!/, "");
|
11494
|
+
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) {
|
11456
11495
|
var F2 = re.type[0];
|
11457
11496
|
if (N2)
|
11458
11497
|
try {
|
@@ -11466,10 +11505,10 @@
|
|
11466
11505
|
} else if (x.rel == "preload" && x.as == "style")
|
11467
11506
|
return x.rel = "stylesheet";
|
11468
11507
|
v(p, F2, re.defaultPrevented);
|
11469
|
-
}, $(p, x) !== false &&
|
11508
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11470
11509
|
}
|
11471
11510
|
function u(p, v, b) {
|
11472
|
-
var T2, N2, x = (p = p.push ? p : [p]).length,
|
11511
|
+
var T2, N2, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11473
11512
|
for (T2 = function(L2, $, D2) {
|
11474
11513
|
if ($ == "e" && C.push(L2), $ == "b") {
|
11475
11514
|
if (!D2)
|
@@ -11477,36 +11516,36 @@
|
|
11477
11516
|
C.push(L2);
|
11478
11517
|
}
|
11479
11518
|
--x || v(C);
|
11480
|
-
}, N2 = 0; N2 <
|
11519
|
+
}, N2 = 0; N2 < y; N2++)
|
11481
11520
|
c(p[N2], T2, b);
|
11482
11521
|
}
|
11483
|
-
function
|
11522
|
+
function m(p, v, b) {
|
11484
11523
|
var T2, N2;
|
11485
11524
|
if (v && v.trim && (T2 = v), N2 = (T2 ? b : v) || {}, T2) {
|
11486
11525
|
if (T2 in r)
|
11487
11526
|
throw "LoadJS";
|
11488
11527
|
r[T2] = true;
|
11489
11528
|
}
|
11490
|
-
function x(
|
11529
|
+
function x(y, C) {
|
11491
11530
|
u(p, function(L2) {
|
11492
|
-
d(N2, L2),
|
11531
|
+
d(N2, L2), y && d({ success: y, error: C }, L2), l(T2, L2);
|
11493
11532
|
}, N2);
|
11494
11533
|
}
|
11495
11534
|
if (N2.returnPromise)
|
11496
11535
|
return new Promise(x);
|
11497
11536
|
x();
|
11498
11537
|
}
|
11499
|
-
return
|
11538
|
+
return m.ready = function(p, v) {
|
11500
11539
|
return a(p, function(b) {
|
11501
11540
|
d(v, b);
|
11502
|
-
}),
|
11503
|
-
},
|
11541
|
+
}), m;
|
11542
|
+
}, m.done = function(p) {
|
11504
11543
|
l(p, []);
|
11505
|
-
},
|
11544
|
+
}, m.reset = function() {
|
11506
11545
|
r = {}, s = {}, n = {};
|
11507
|
-
},
|
11546
|
+
}, m.isDefined = function(p) {
|
11508
11547
|
return p in r;
|
11509
|
-
},
|
11548
|
+
}, m;
|
11510
11549
|
}();
|
11511
11550
|
});
|
11512
11551
|
function ut(e) {
|
@@ -11537,75 +11576,75 @@
|
|
11537
11576
|
o.empty(n) ? (n = e.media.getAttribute(e.config.attributes.embed.id), a = e.media.getAttribute(e.config.attributes.embed.hash)) : a = Cr(n);
|
11538
11577
|
const l = a ? { h: a } : {};
|
11539
11578
|
t && Object.assign(s, { controls: false, sidedock: false });
|
11540
|
-
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"),
|
11541
|
-
if (u.setAttribute("src",
|
11579
|
+
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);
|
11580
|
+
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)
|
11542
11581
|
u.setAttribute("data-poster", e.poster), e.media = Le(u, e.media);
|
11543
11582
|
else {
|
11544
|
-
const
|
11545
|
-
|
11583
|
+
const y = _("div", { class: e.config.classNames.embedContainer, "data-poster": e.poster });
|
11584
|
+
y.appendChild(u), e.media = Le(y, e.media);
|
11546
11585
|
}
|
11547
|
-
i2.customControls || Te(st(e.config.urls.vimeo.api,
|
11548
|
-
!o.empty(
|
11586
|
+
i2.customControls || Te(st(e.config.urls.vimeo.api, m)).then((y) => {
|
11587
|
+
!o.empty(y) && y.thumbnail_url && M.setPoster.call(e, y.thumbnail_url).catch(() => {
|
11549
11588
|
});
|
11550
11589
|
}), 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 = () => {
|
11551
11590
|
e.pause(), e.currentTime = 0;
|
11552
11591
|
};
|
11553
11592
|
let { currentTime: p } = e.media;
|
11554
|
-
Object.defineProperty(e.media, "currentTime", { get: () => p, set(
|
11593
|
+
Object.defineProperty(e.media, "currentTime", { get: () => p, set(y) {
|
11555
11594
|
const { embed: C, media: L2, paused: $, volume: D2 } = e, V2 = $ && !C.hasPlayed;
|
11556
|
-
L2.seeking = true, w.call(e, L2, "seeking"), Promise.resolve(V2 && C.setVolume(0)).then(() => C.setCurrentTime(
|
11595
|
+
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(() => {
|
11557
11596
|
});
|
11558
11597
|
} });
|
11559
11598
|
let v = e.config.speed.selected;
|
11560
|
-
Object.defineProperty(e.media, "playbackRate", { get: () => v, set(
|
11561
|
-
e.embed.setPlaybackRate(
|
11562
|
-
v =
|
11599
|
+
Object.defineProperty(e.media, "playbackRate", { get: () => v, set(y) {
|
11600
|
+
e.embed.setPlaybackRate(y).then(() => {
|
11601
|
+
v = y, w.call(e, e.media, "ratechange");
|
11563
11602
|
}).catch(() => {
|
11564
11603
|
e.options.speed = [1];
|
11565
11604
|
});
|
11566
11605
|
} });
|
11567
11606
|
let { volume: b } = e.config;
|
11568
|
-
Object.defineProperty(e.media, "volume", { get: () => b, set(
|
11569
|
-
e.embed.setVolume(
|
11570
|
-
b =
|
11607
|
+
Object.defineProperty(e.media, "volume", { get: () => b, set(y) {
|
11608
|
+
e.embed.setVolume(y).then(() => {
|
11609
|
+
b = y, w.call(e, e.media, "volumechange");
|
11571
11610
|
});
|
11572
11611
|
} });
|
11573
11612
|
let { muted: T2 } = e.config;
|
11574
|
-
Object.defineProperty(e.media, "muted", { get: () => T2, set(
|
11575
|
-
const C = !!o.boolean(
|
11613
|
+
Object.defineProperty(e.media, "muted", { get: () => T2, set(y) {
|
11614
|
+
const C = !!o.boolean(y) && y;
|
11576
11615
|
e.embed.setVolume(C ? 0 : e.config.volume).then(() => {
|
11577
11616
|
T2 = C, w.call(e, e.media, "volumechange");
|
11578
11617
|
});
|
11579
11618
|
} });
|
11580
11619
|
let N2, { loop: x } = e.config;
|
11581
|
-
Object.defineProperty(e.media, "loop", { get: () => x, set(
|
11582
|
-
const C = o.boolean(
|
11620
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11621
|
+
const C = o.boolean(y) ? y : e.config.loop.active;
|
11583
11622
|
e.embed.setLoop(C).then(() => {
|
11584
11623
|
x = C;
|
11585
11624
|
});
|
11586
|
-
} }), e.embed.getVideoUrl().then((
|
11587
|
-
N2 =
|
11588
|
-
}).catch((
|
11589
|
-
this.debug.warn(
|
11590
|
-
}), 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((
|
11591
|
-
const [C, L2] =
|
11625
|
+
} }), e.embed.getVideoUrl().then((y) => {
|
11626
|
+
N2 = y, h.setDownloadUrl.call(e);
|
11627
|
+
}).catch((y) => {
|
11628
|
+
this.debug.warn(y);
|
11629
|
+
}), 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) => {
|
11630
|
+
const [C, L2] = y;
|
11592
11631
|
e.embed.ratio = Qt(C, L2), oe.call(this);
|
11593
|
-
}), e.embed.setAutopause(e.config.autopause).then((
|
11594
|
-
e.config.autopause =
|
11595
|
-
}), e.embed.getVideoTitle().then((
|
11596
|
-
e.config.title =
|
11597
|
-
}), e.embed.getCurrentTime().then((
|
11598
|
-
p =
|
11599
|
-
}), e.embed.getDuration().then((
|
11600
|
-
e.media.duration =
|
11601
|
-
}), e.embed.getTextTracks().then((
|
11602
|
-
e.media.textTracks =
|
11603
|
-
}), e.embed.on("cuechange", ({ cues:
|
11604
|
-
const C =
|
11632
|
+
}), e.embed.setAutopause(e.config.autopause).then((y) => {
|
11633
|
+
e.config.autopause = y;
|
11634
|
+
}), e.embed.getVideoTitle().then((y) => {
|
11635
|
+
e.config.title = y, M.setTitle.call(this);
|
11636
|
+
}), e.embed.getCurrentTime().then((y) => {
|
11637
|
+
p = y, w.call(e, e.media, "timeupdate");
|
11638
|
+
}), e.embed.getDuration().then((y) => {
|
11639
|
+
e.media.duration = y, w.call(e, e.media, "durationchange");
|
11640
|
+
}), e.embed.getTextTracks().then((y) => {
|
11641
|
+
e.media.textTracks = y, P.setup.call(e);
|
11642
|
+
}), e.embed.on("cuechange", ({ cues: y = [] }) => {
|
11643
|
+
const C = y.map((L2) => fr(L2.text));
|
11605
11644
|
P.updateCues.call(e, C);
|
11606
11645
|
}), e.embed.on("loaded", () => {
|
11607
|
-
e.embed.getPaused().then((
|
11608
|
-
me.call(e, !
|
11646
|
+
e.embed.getPaused().then((y) => {
|
11647
|
+
me.call(e, !y), y || w.call(e, e.media, "playing");
|
11609
11648
|
}), o.element(e.embed.element) && e.supported.ui && e.embed.element.setAttribute("tabindex", -1);
|
11610
11649
|
}), e.embed.on("bufferstart", () => {
|
11611
11650
|
w.call(e, e.media, "waiting");
|
@@ -11615,18 +11654,18 @@
|
|
11615
11654
|
me.call(e, true), w.call(e, e.media, "playing");
|
11616
11655
|
}), e.embed.on("pause", () => {
|
11617
11656
|
me.call(e, false);
|
11618
|
-
}), e.embed.on("timeupdate", (
|
11619
|
-
e.media.seeking = false, p =
|
11620
|
-
}), e.embed.on("progress", (
|
11621
|
-
e.media.buffered =
|
11657
|
+
}), e.embed.on("timeupdate", (y) => {
|
11658
|
+
e.media.seeking = false, p = y.seconds, w.call(e, e.media, "timeupdate");
|
11659
|
+
}), e.embed.on("progress", (y) => {
|
11660
|
+
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) => {
|
11622
11661
|
C !== e.media.duration && (e.media.duration = C, w.call(e, e.media, "durationchange"));
|
11623
11662
|
});
|
11624
11663
|
}), e.embed.on("seeked", () => {
|
11625
11664
|
e.media.seeking = false, w.call(e, e.media, "seeked");
|
11626
11665
|
}), e.embed.on("ended", () => {
|
11627
11666
|
e.media.paused = true, w.call(e, e.media, "ended");
|
11628
|
-
}), e.embed.on("error", (
|
11629
|
-
e.media.error =
|
11667
|
+
}), e.embed.on("error", (y) => {
|
11668
|
+
e.media.error = y, w.call(e, e.media, "error");
|
11630
11669
|
}), i2.customControls && setTimeout(() => M.build.call(e), 0);
|
11631
11670
|
} };
|
11632
11671
|
function Sr(e) {
|
@@ -11691,22 +11730,22 @@
|
|
11691
11730
|
ge.call(e, false), l.pauseVideo();
|
11692
11731
|
}, e.media.stop = () => {
|
11693
11732
|
l.stopVideo();
|
11694
|
-
}, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(
|
11695
|
-
e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(
|
11696
|
-
} }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(
|
11697
|
-
l.setPlaybackRate(
|
11733
|
+
}, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(m) {
|
11734
|
+
e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(m);
|
11735
|
+
} }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(m) {
|
11736
|
+
l.setPlaybackRate(m);
|
11698
11737
|
} });
|
11699
11738
|
let { volume: d } = e.config;
|
11700
|
-
Object.defineProperty(e.media, "volume", { get: () => d, set(
|
11701
|
-
d =
|
11739
|
+
Object.defineProperty(e.media, "volume", { get: () => d, set(m) {
|
11740
|
+
d = m, l.setVolume(100 * d), w.call(e, e.media, "volumechange");
|
11702
11741
|
} });
|
11703
11742
|
let { muted: c } = e.config;
|
11704
|
-
Object.defineProperty(e.media, "muted", { get: () => c, set(
|
11705
|
-
const p = o.boolean(
|
11743
|
+
Object.defineProperty(e.media, "muted", { get: () => c, set(m) {
|
11744
|
+
const p = o.boolean(m) ? m : c;
|
11706
11745
|
c = p, l[p ? "mute" : "unMute"](), l.setVolume(100 * d), w.call(e, e.media, "volumechange");
|
11707
11746
|
} }), Object.defineProperty(e.media, "currentSrc", { get: () => l.getVideoUrl() }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration });
|
11708
11747
|
const u = l.getAvailablePlaybackRates();
|
11709
|
-
e.options.speed = u.filter((
|
11748
|
+
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(() => {
|
11710
11749
|
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"));
|
11711
11750
|
}, 200), i2.customControls && setTimeout(() => M.build.call(e), 50);
|
11712
11751
|
}, onStateChange(a) {
|
@@ -11736,20 +11775,20 @@
|
|
11736
11775
|
} };
|
11737
11776
|
class Er {
|
11738
11777
|
constructor(i2) {
|
11739
|
-
|
11778
|
+
f(this, "load", () => {
|
11740
11779
|
this.enabled && (o.object(window.google) && o.object(window.google.ima) ? this.ready() : ut(this.player.config.urls.googleIMA.sdk).then(() => {
|
11741
11780
|
this.ready();
|
11742
11781
|
}).catch(() => {
|
11743
11782
|
this.trigger("error", new Error("Google IMA SDK failed to load"));
|
11744
11783
|
}));
|
11745
|
-
}),
|
11784
|
+
}), f(this, "ready", () => {
|
11746
11785
|
var t;
|
11747
11786
|
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(() => {
|
11748
11787
|
this.clearSafetyTimer("onAdsManagerLoaded()");
|
11749
11788
|
}), this.listeners(), this.setupIMA();
|
11750
|
-
}),
|
11789
|
+
}), f(this, "setupIMA", () => {
|
11751
11790
|
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();
|
11752
|
-
}),
|
11791
|
+
}), f(this, "requestAds", () => {
|
11753
11792
|
const { container: t } = this.player.elements;
|
11754
11793
|
try {
|
11755
11794
|
const r = new google.ima.AdsRequest();
|
@@ -11757,21 +11796,21 @@
|
|
11757
11796
|
} catch (r) {
|
11758
11797
|
this.onAdError(r);
|
11759
11798
|
}
|
11760
|
-
}),
|
11799
|
+
}), f(this, "pollCountdown", (t = false) => {
|
11761
11800
|
if (!t)
|
11762
11801
|
return clearInterval(this.countdownTimer), void this.elements.container.removeAttribute("data-badge-text");
|
11763
11802
|
this.countdownTimer = setInterval(() => {
|
11764
11803
|
const r = He(Math.max(this.manager.getRemainingTime(), 0)), s = `${j.get("advertisement", this.player.config)} - ${r}`;
|
11765
11804
|
this.elements.container.setAttribute("data-badge-text", s);
|
11766
11805
|
}, 100);
|
11767
|
-
}),
|
11806
|
+
}), f(this, "onAdsManagerLoaded", (t) => {
|
11768
11807
|
if (!this.enabled)
|
11769
11808
|
return;
|
11770
11809
|
const r = new google.ima.AdsRenderingSettings();
|
11771
11810
|
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) => {
|
11772
11811
|
this.manager.addEventListener(google.ima.AdEvent.Type[s], (n) => this.onAdEvent(n));
|
11773
11812
|
}), this.trigger("loaded");
|
11774
|
-
}),
|
11813
|
+
}), f(this, "addCuePoints", () => {
|
11775
11814
|
o.empty(this.cuePoints) || this.cuePoints.forEach((t) => {
|
11776
11815
|
if (t !== 0 && t !== -1 && t < this.player.duration) {
|
11777
11816
|
const r = this.player.elements.progress;
|
@@ -11781,7 +11820,7 @@
|
|
11781
11820
|
}
|
11782
11821
|
}
|
11783
11822
|
});
|
11784
|
-
}),
|
11823
|
+
}), f(this, "onAdEvent", (t) => {
|
11785
11824
|
const { container: r } = this.player.elements, s = t.getAd(), n = t.getAdData();
|
11786
11825
|
switch (((a) => {
|
11787
11826
|
w.call(this.player, this.player.media, `ads${a.replace(/_/g, "").toLowerCase()}`);
|
@@ -11804,9 +11843,9 @@
|
|
11804
11843
|
case google.ima.AdEvent.Type.LOG:
|
11805
11844
|
n.adError && this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`);
|
11806
11845
|
}
|
11807
|
-
}),
|
11846
|
+
}), f(this, "onAdError", (t) => {
|
11808
11847
|
this.cancel(), this.player.debug.warn("Ads error", t);
|
11809
|
-
}),
|
11848
|
+
}), f(this, "listeners", () => {
|
11810
11849
|
const { container: t } = this.player.elements;
|
11811
11850
|
let r;
|
11812
11851
|
this.player.on("canplay", () => {
|
@@ -11823,7 +11862,7 @@
|
|
11823
11862
|
}), window.addEventListener("resize", () => {
|
11824
11863
|
this.manager && this.manager.resize(t.offsetWidth, t.offsetHeight, google.ima.ViewMode.NORMAL);
|
11825
11864
|
});
|
11826
|
-
}),
|
11865
|
+
}), f(this, "play", () => {
|
11827
11866
|
const { container: t } = this.player.elements;
|
11828
11867
|
this.managerPromise || this.resumeContent(), this.managerPromise.then(() => {
|
11829
11868
|
this.manager.setVolume(this.player.volume), this.elements.displayContainer.initialize();
|
@@ -11834,29 +11873,29 @@
|
|
11834
11873
|
}
|
11835
11874
|
}).catch(() => {
|
11836
11875
|
});
|
11837
|
-
}),
|
11876
|
+
}), f(this, "resumeContent", () => {
|
11838
11877
|
this.elements.container.style.zIndex = "", this.playing = false, W(this.player.media.play());
|
11839
|
-
}),
|
11878
|
+
}), f(this, "pauseContent", () => {
|
11840
11879
|
this.elements.container.style.zIndex = 3, this.playing = true, this.player.media.pause();
|
11841
|
-
}),
|
11880
|
+
}), f(this, "cancel", () => {
|
11842
11881
|
this.initialized && this.resumeContent(), this.trigger("error"), this.loadAds();
|
11843
|
-
}),
|
11882
|
+
}), f(this, "loadAds", () => {
|
11844
11883
|
this.managerPromise.then(() => {
|
11845
11884
|
this.manager && this.manager.destroy(), this.managerPromise = new Promise((t) => {
|
11846
11885
|
this.on("loaded", t), this.player.debug.log(this.manager);
|
11847
11886
|
}), this.initialized = false, this.requestAds();
|
11848
11887
|
}).catch(() => {
|
11849
11888
|
});
|
11850
|
-
}),
|
11889
|
+
}), f(this, "trigger", (t, ...r) => {
|
11851
11890
|
const s = this.events[t];
|
11852
11891
|
o.array(s) && s.forEach((n) => {
|
11853
11892
|
o.function(n) && n.apply(this, r);
|
11854
11893
|
});
|
11855
|
-
}),
|
11894
|
+
}), f(this, "on", (t, r) => (o.array(this.events[t]) || (this.events[t] = []), this.events[t].push(r), this)), f(this, "startSafetyTimer", (t, r) => {
|
11856
11895
|
this.player.debug.log(`Safety timer invoked from: ${r}`), this.safetyTimer = setTimeout(() => {
|
11857
11896
|
this.cancel(), this.clearSafetyTimer("startSafetyTimer()");
|
11858
11897
|
}, t);
|
11859
|
-
}),
|
11898
|
+
}), f(this, "clearSafetyTimer", (t) => {
|
11860
11899
|
o.nullOrUndefined(this.safetyTimer) || (this.player.debug.log(`Safety timer cleared from: ${t}`), clearTimeout(this.safetyTimer), this.safetyTimer = null);
|
11861
11900
|
}), 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) => {
|
11862
11901
|
this.on("loaded", t), this.on("error", r);
|
@@ -11896,11 +11935,11 @@
|
|
11896
11935
|
};
|
11897
11936
|
class at {
|
11898
11937
|
constructor(i2) {
|
11899
|
-
|
11938
|
+
f(this, "load", () => {
|
11900
11939
|
this.player.elements.display.seekTooltip && (this.player.elements.display.seekTooltip.hidden = this.enabled), this.enabled && this.getThumbnails().then(() => {
|
11901
11940
|
this.enabled && (this.render(), this.determineContainerAutoSizing(), this.loaded = true);
|
11902
11941
|
});
|
11903
|
-
}),
|
11942
|
+
}), f(this, "getThumbnails", () => new Promise((t) => {
|
11904
11943
|
const { src: r } = this.player.config.previewThumbnails;
|
11905
11944
|
if (o.empty(r))
|
11906
11945
|
throw new Error("Missing previewThumbnails.src config attribute");
|
@@ -11915,7 +11954,7 @@
|
|
11915
11954
|
const n = (o.string(r) ? [r] : r).map((a) => this.getThumbnail(a));
|
11916
11955
|
Promise.all(n).then(s);
|
11917
11956
|
}
|
11918
|
-
})),
|
11957
|
+
})), f(this, "getThumbnail", (t) => new Promise((r) => {
|
11919
11958
|
Te(t).then((s) => {
|
11920
11959
|
const n = { frames: Pr(s), height: null, urlPrefix: "" };
|
11921
11960
|
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));
|
@@ -11924,7 +11963,7 @@
|
|
11924
11963
|
n.height = a.naturalHeight, n.width = a.naturalWidth, this.thumbnails.push(n), r();
|
11925
11964
|
}, a.src = n.urlPrefix + n.frames[0].text;
|
11926
11965
|
});
|
11927
|
-
})),
|
11966
|
+
})), f(this, "startMove", (t) => {
|
11928
11967
|
if (this.loaded && o.event(t) && ["touchmove", "mousemove"].includes(t.type) && this.player.media.duration) {
|
11929
11968
|
if (t.type === "touchmove")
|
11930
11969
|
this.seekTime = this.player.media.duration * (this.player.elements.inputs.seek.value / 100);
|
@@ -11937,15 +11976,15 @@
|
|
11937
11976
|
}
|
11938
11977
|
this.showImageAtCurrentTime();
|
11939
11978
|
}
|
11940
|
-
}),
|
11979
|
+
}), f(this, "endMove", () => {
|
11941
11980
|
this.toggleThumbContainer(false, true);
|
11942
|
-
}),
|
11981
|
+
}), f(this, "startScrubbing", (t) => {
|
11943
11982
|
(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()));
|
11944
|
-
}),
|
11983
|
+
}), f(this, "endScrubbing", () => {
|
11945
11984
|
this.mouseDown = false, Math.ceil(this.lastTime) === Math.ceil(this.player.media.currentTime) ? this.toggleScrubbingContainer(false) : dt.call(this.player, this.player.media, "timeupdate", () => {
|
11946
11985
|
this.mouseDown || this.toggleScrubbingContainer(false);
|
11947
11986
|
});
|
11948
|
-
}),
|
11987
|
+
}), f(this, "listeners", () => {
|
11949
11988
|
this.player.on("play", () => {
|
11950
11989
|
this.toggleThumbContainer(false, true);
|
11951
11990
|
}), this.player.on("seeked", () => {
|
@@ -11953,20 +11992,20 @@
|
|
11953
11992
|
}), this.player.on("timeupdate", () => {
|
11954
11993
|
this.lastTime = this.player.media.currentTime;
|
11955
11994
|
});
|
11956
|
-
}),
|
11995
|
+
}), f(this, "render", () => {
|
11957
11996
|
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);
|
11958
11997
|
const t = _("div", { class: this.player.config.classNames.previewThumbnails.timeContainer });
|
11959
11998
|
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);
|
11960
|
-
}),
|
11999
|
+
}), f(this, "destroy", () => {
|
11961
12000
|
this.elements.thumb.container && this.elements.thumb.container.remove(), this.elements.scrubbing.container && this.elements.scrubbing.container.remove();
|
11962
|
-
}),
|
12001
|
+
}), f(this, "showImageAtCurrentTime", () => {
|
11963
12002
|
this.mouseDown ? this.setScrubbingContainerSize() : this.setThumbContainerSizeAndPos();
|
11964
12003
|
const t = this.thumbnails[0].frames.findIndex((n) => this.seekTime >= n.startTime && this.seekTime <= n.endTime), r = t >= 0;
|
11965
12004
|
let s = 0;
|
11966
12005
|
this.mouseDown || this.toggleThumbContainer(r), r && (this.thumbnails.forEach((n, a) => {
|
11967
12006
|
this.loadedImages.includes(n.frames[t].text) && (s = a);
|
11968
12007
|
}), t !== this.showingThumb && (this.showingThumb = t, this.loadImage(s)));
|
11969
|
-
}),
|
12008
|
+
}), f(this, "loadImage", (t = 0) => {
|
11970
12009
|
const r = this.showingThumb, s = this.thumbnails[t], { urlPrefix: n } = s, a = s.frames[r], l = s.frames[r].text, d = n + l;
|
11971
12010
|
if (this.currentImageElement && this.currentImageElement.dataset.filename === l)
|
11972
12011
|
this.showImage(this.currentImageElement, a, t, r, l, false), this.currentImageElement.dataset.index = r, this.removeOldImages(this.currentImageElement);
|
@@ -11975,9 +12014,9 @@
|
|
11975
12014
|
const c = new Image();
|
11976
12015
|
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);
|
11977
12016
|
}
|
11978
|
-
}),
|
12017
|
+
}), f(this, "showImage", (t, r, s, n, a, l = true) => {
|
11979
12018
|
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));
|
11980
|
-
}),
|
12019
|
+
}), f(this, "removeOldImages", (t) => {
|
11981
12020
|
Array.from(this.currentImageContainer.children).forEach((r) => {
|
11982
12021
|
if (r.tagName.toLowerCase() !== "img")
|
11983
12022
|
return;
|
@@ -11990,7 +12029,7 @@
|
|
11990
12029
|
}, s);
|
11991
12030
|
}
|
11992
12031
|
});
|
11993
|
-
}),
|
12032
|
+
}), f(this, "preloadNearby", (t, r = true) => new Promise((s) => {
|
11994
12033
|
setTimeout(() => {
|
11995
12034
|
const n = this.thumbnails[0].frames[t].text;
|
11996
12035
|
if (this.showingThumbFilename === n) {
|
@@ -12001,30 +12040,30 @@
|
|
12001
12040
|
const c = d.text;
|
12002
12041
|
if (c !== n && !this.loadedImages.includes(c)) {
|
12003
12042
|
l = true, this.player.debug.log(`Preloading thumb filename: ${c}`);
|
12004
|
-
const { urlPrefix: u } = this.thumbnails[0],
|
12005
|
-
p.src =
|
12043
|
+
const { urlPrefix: u } = this.thumbnails[0], m = u + c, p = new Image();
|
12044
|
+
p.src = m, p.onload = () => {
|
12006
12045
|
this.player.debug.log(`Preloaded thumb filename: ${c}`), this.loadedImages.includes(c) || this.loadedImages.push(c), s();
|
12007
12046
|
};
|
12008
12047
|
}
|
12009
12048
|
}), l || s();
|
12010
12049
|
}
|
12011
12050
|
}, 300);
|
12012
|
-
})),
|
12051
|
+
})), f(this, "getHigherQuality", (t, r, s, n) => {
|
12013
12052
|
if (t < this.thumbnails.length - 1) {
|
12014
12053
|
let a = r.naturalHeight;
|
12015
12054
|
this.usingSprites && (a = s.h), a < this.thumbContainerHeight && setTimeout(() => {
|
12016
12055
|
this.showingThumbFilename === n && (this.player.debug.log(`Showing higher quality thumb for: ${n}`), this.loadImage(t + 1));
|
12017
12056
|
}, 300);
|
12018
12057
|
}
|
12019
|
-
}),
|
12058
|
+
}), f(this, "toggleThumbContainer", (t = false, r = false) => {
|
12020
12059
|
const s = this.player.config.classNames.previewThumbnails.thumbContainerShown;
|
12021
12060
|
this.elements.thumb.container.classList.toggle(s, t), !t && r && (this.showingThumb = null, this.showingThumbFilename = null);
|
12022
|
-
}),
|
12061
|
+
}), f(this, "toggleScrubbingContainer", (t = false) => {
|
12023
12062
|
const r = this.player.config.classNames.previewThumbnails.scrubbingContainerShown;
|
12024
12063
|
this.elements.scrubbing.container.classList.toggle(r, t), t || (this.showingThumb = null, this.showingThumbFilename = null);
|
12025
|
-
}),
|
12064
|
+
}), f(this, "determineContainerAutoSizing", () => {
|
12026
12065
|
(this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) && (this.sizeSpecifiedInCSS = true);
|
12027
|
-
}),
|
12066
|
+
}), f(this, "setThumbContainerSizeAndPos", () => {
|
12028
12067
|
const { imageContainer: t } = this.elements.thumb;
|
12029
12068
|
if (this.sizeSpecifiedInCSS) {
|
12030
12069
|
if (t.clientHeight > 20 && t.clientWidth < 20) {
|
@@ -12039,13 +12078,13 @@
|
|
12039
12078
|
t.style.height = `${this.thumbContainerHeight}px`, t.style.width = `${r}px`;
|
12040
12079
|
}
|
12041
12080
|
this.setThumbContainerPos();
|
12042
|
-
}),
|
12081
|
+
}), f(this, "setThumbContainerPos", () => {
|
12043
12082
|
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);
|
12044
12083
|
s.style.left = `${d}px`, s.style.setProperty("--preview-arrow-offset", l - d + "px");
|
12045
|
-
}),
|
12084
|
+
}), f(this, "setScrubbingContainerSize", () => {
|
12046
12085
|
const { width: t, height: r } = kt(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight });
|
12047
12086
|
this.elements.scrubbing.container.style.width = `${t}px`, this.elements.scrubbing.container.style.height = `${r}px`;
|
12048
|
-
}),
|
12087
|
+
}), f(this, "setImageSizeAndOffset", (t, r) => {
|
12049
12088
|
if (!this.usingSprites)
|
12050
12089
|
return;
|
12051
12090
|
const s = this.thumbContainerHeight / r.h;
|
@@ -12091,38 +12130,38 @@
|
|
12091
12130
|
} };
|
12092
12131
|
class xe {
|
12093
12132
|
constructor(i2, t) {
|
12094
|
-
if (
|
12133
|
+
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", () => {
|
12095
12134
|
this.isHTML5 ? (this.pause(), this.restart()) : o.function(this.media.stop) && this.media.stop();
|
12096
|
-
}),
|
12135
|
+
}), f(this, "restart", () => {
|
12097
12136
|
this.currentTime = 0;
|
12098
|
-
}),
|
12137
|
+
}), f(this, "rewind", (l) => {
|
12099
12138
|
this.currentTime -= o.number(l) ? l : this.config.seekTime;
|
12100
|
-
}),
|
12139
|
+
}), f(this, "forward", (l) => {
|
12101
12140
|
this.currentTime += o.number(l) ? l : this.config.seekTime;
|
12102
|
-
}),
|
12141
|
+
}), f(this, "increaseVolume", (l) => {
|
12103
12142
|
const d = this.media.muted ? 0 : this.volume;
|
12104
12143
|
this.volume = d + (o.number(l) ? l : 0);
|
12105
|
-
}),
|
12144
|
+
}), f(this, "decreaseVolume", (l) => {
|
12106
12145
|
this.increaseVolume(-l);
|
12107
|
-
}),
|
12146
|
+
}), f(this, "airplay", () => {
|
12108
12147
|
I.airplay && this.media.webkitShowPlaybackTargetPicker();
|
12109
|
-
}),
|
12148
|
+
}), f(this, "toggleControls", (l) => {
|
12110
12149
|
if (this.supported.ui && !this.isAudio) {
|
12111
12150
|
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);
|
12112
12151
|
if (u && o.array(this.config.controls) && this.config.controls.includes("settings") && !o.empty(this.config.settings) && h.toggleMenu.call(this, false), u !== d) {
|
12113
|
-
const
|
12114
|
-
w.call(this, this.media,
|
12152
|
+
const m = u ? "controlshidden" : "controlsshown";
|
12153
|
+
w.call(this, this.media, m);
|
12115
12154
|
}
|
12116
12155
|
return !u;
|
12117
12156
|
}
|
12118
12157
|
return false;
|
12119
|
-
}),
|
12158
|
+
}), f(this, "on", (l, d) => {
|
12120
12159
|
E.call(this, this.elements.container, l, d);
|
12121
|
-
}),
|
12160
|
+
}), f(this, "once", (l, d) => {
|
12122
12161
|
dt.call(this, this.elements.container, l, d);
|
12123
|
-
}),
|
12162
|
+
}), f(this, "off", (l, d) => {
|
12124
12163
|
je(this.elements.container, l, d);
|
12125
|
-
}),
|
12164
|
+
}), f(this, "destroy", (l, d = false) => {
|
12126
12165
|
if (!this.ready)
|
12127
12166
|
return;
|
12128
12167
|
const c = () => {
|
@@ -12131,7 +12170,7 @@
|
|
12131
12170
|
}, 200));
|
12132
12171
|
};
|
12133
12172
|
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));
|
12134
|
-
}),
|
12173
|
+
}), 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 || {}, (() => {
|
12135
12174
|
try {
|
12136
12175
|
return JSON.parse(this.media.getAttribute("data-plyr-config"));
|
12137
12176
|
} catch {
|
@@ -12357,7 +12396,7 @@
|
|
12357
12396
|
let i2, t, r;
|
12358
12397
|
return {
|
12359
12398
|
c() {
|
12360
|
-
i2 = ie("video"), t = ie("source"), St(t.src, r = e[3]) ||
|
12399
|
+
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]);
|
12361
12400
|
},
|
12362
12401
|
m(s, n) {
|
12363
12402
|
te(s, i2, n), k(i2, t), e[8](i2);
|
@@ -12372,7 +12411,7 @@
|
|
12372
12411
|
let i2, t, r;
|
12373
12412
|
return {
|
12374
12413
|
c() {
|
12375
|
-
i2 = ie("audio"), t = ie("source"), St(t.src, r = e[3]) ||
|
12414
|
+
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]);
|
12376
12415
|
},
|
12377
12416
|
m(s, n) {
|
12378
12417
|
te(s, i2, n), k(i2, t), e[7](i2);
|
@@ -12391,7 +12430,7 @@
|
|
12391
12430
|
return {
|
12392
12431
|
c() {
|
12393
12432
|
i2 = ie("div"), t = Ge(`Invalid "src" or "type".
|
12394
|
-
`), s = Ge(r),
|
12433
|
+
`), s = Ge(r), g(i2, "data-app-kind", "Plyr"), g(i2, "class", "plyr--audio");
|
12395
12434
|
},
|
12396
12435
|
m(n, a) {
|
12397
12436
|
te(n, i2, a), k(i2, t), k(i2, s);
|
@@ -12411,7 +12450,7 @@
|
|
12411
12450
|
let i2;
|
12412
12451
|
return {
|
12413
12452
|
c() {
|
12414
|
-
i2 = ie("div"),
|
12453
|
+
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]);
|
12415
12454
|
},
|
12416
12455
|
m(t, r) {
|
12417
12456
|
te(t, i2, r), e[6](i2);
|
@@ -12477,7 +12516,7 @@
|
|
12477
12516
|
console.warn("[Plyr] destroy plyr error", b);
|
12478
12517
|
}
|
12479
12518
|
});
|
12480
|
-
function
|
12519
|
+
function m(b) {
|
12481
12520
|
be[b ? "unshift" : "push"](() => {
|
12482
12521
|
c = b, t(1, c);
|
12483
12522
|
});
|
@@ -12501,7 +12540,7 @@
|
|
12501
12540
|
a,
|
12502
12541
|
l,
|
12503
12542
|
s,
|
12504
|
-
|
12543
|
+
m,
|
12505
12544
|
p,
|
12506
12545
|
v
|
12507
12546
|
];
|
@@ -12550,7 +12589,10 @@
|
|
12550
12589
|
if (!t)
|
12551
12590
|
return;
|
12552
12591
|
const { currentTime: n, hostTime: a, muted: l, paused: d, volume: c, owner: u } = s.state;
|
12553
|
-
i2 === "owner" && u === this.uid && r.isWritable
|
12592
|
+
if (i2 === "owner" && u === this.uid && r.isWritable)
|
12593
|
+
return;
|
12594
|
+
let m = d;
|
12595
|
+
!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));
|
12554
12596
|
}
|
12555
12597
|
watchUserInputs(i2) {
|
12556
12598
|
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"]');
|
@@ -12744,39 +12786,24 @@
|
|
12744
12786
|
const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
12745
12787
|
constructor(context) {
|
12746
12788
|
super(context);
|
12747
|
-
this.version = "1.0.0-canary.
|
12748
|
-
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.
|
12789
|
+
this.version = "1.0.0-canary.66";
|
12790
|
+
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" } };
|
12749
12791
|
this.emitter = callbacks;
|
12750
12792
|
this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
|
12751
12793
|
this.playground$ = new valueEnhancer.Val(void 0);
|
12752
12794
|
this.isReplay = whiteWebSdk.isPlayer(this.displayer);
|
12753
12795
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
12754
12796
|
this.moveCamera = (camera) => {
|
12755
|
-
var _a2;
|
12797
|
+
var _a2, _b;
|
12756
12798
|
const pureCamera = lodash.omit(camera, ["animationMode"]);
|
12757
12799
|
const mainViewCamera = __spreadValues({}, this.mainView.camera);
|
12758
12800
|
if (lodash.isEqual(__spreadValues(__spreadValues({}, mainViewCamera), pureCamera), mainViewCamera))
|
12759
12801
|
return;
|
12760
|
-
this.
|
12761
|
-
this.
|
12762
|
-
(_a2 = this.appManager) == null ? void 0 : _a2.dispatchInternalEvent(Events.MoveCamera, camera);
|
12802
|
+
(_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.moveCamera(camera);
|
12803
|
+
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12763
12804
|
};
|
12764
|
-
this.debouncedStoreCamera = () => {
|
12765
|
-
const cameraListener = lodash.debounce(() => {
|
12766
|
-
var _a2;
|
12767
|
-
(_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.saveToCamera$();
|
12768
|
-
this.storeCamera();
|
12769
|
-
this.mainView.callbacks.off("onCameraUpdated", cameraListener);
|
12770
|
-
}, 50);
|
12771
|
-
this.mainView.callbacks.on("onCameraUpdated", cameraListener);
|
12772
|
-
};
|
12773
|
-
this.storeCamera = lodash.debounce(() => {
|
12774
|
-
var _a2, _b;
|
12775
|
-
(_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.storeCurrentCamera();
|
12776
|
-
(_b = this.appManager) == null ? void 0 : _b.mainViewProxy.storeCurrentSize();
|
12777
|
-
}, 300);
|
12778
12805
|
_WindowManager.displayer = context.displayer;
|
12779
|
-
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.
|
12806
|
+
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" } };
|
12780
12807
|
}
|
12781
12808
|
static mount(params) {
|
12782
12809
|
return __async(this, null, function* () {
|
@@ -13342,7 +13369,6 @@
|
|
13342
13369
|
}
|
13343
13370
|
moveCameraToContain(rectangle) {
|
13344
13371
|
var _a2;
|
13345
|
-
this.debouncedStoreCamera();
|
13346
13372
|
this.mainView.moveCameraToContain(rectangle);
|
13347
13373
|
(_a2 = this.appManager) == null ? void 0 : _a2.dispatchInternalEvent(Events.MoveCameraToContain, rectangle);
|
13348
13374
|
}
|