@netless/window-manager 1.0.0-canary.65 → 1.0.0-canary.67
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 +205 -202
- package/dist/index.mjs +205 -202
- package/dist/index.umd.js +205 -202
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppContext.ts +1 -1
package/dist/index.umd.js
CHANGED
@@ -1123,7 +1123,7 @@
|
|
1123
1123
|
const storage = new syncedStore.Storage({
|
1124
1124
|
plugin$,
|
1125
1125
|
isWritable$,
|
1126
|
-
namespace
|
1126
|
+
namespace: `${this.appId}:${namespace}`,
|
1127
1127
|
defaultState
|
1128
1128
|
});
|
1129
1129
|
this.emitter.on("writableChange", (writable) => {
|
@@ -9042,30 +9042,30 @@
|
|
9042
9042
|
if (w2.thumbnail)
|
9043
9043
|
return w2;
|
9044
9044
|
try {
|
9045
|
-
const
|
9046
|
-
return
|
9047
|
-
} catch (
|
9048
|
-
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;
|
9049
9049
|
}
|
9050
9050
|
})
|
9051
9051
|
);
|
9052
9052
|
const o2 = valueEnhancer.derive(s, (d) => {
|
9053
9053
|
const w2 = Array(d.length);
|
9054
|
-
for (let
|
9055
|
-
w2[
|
9054
|
+
for (let f2 = 0; f2 < d.length; f2++)
|
9055
|
+
w2[f2] = f2 > 0 ? w2[f2 - 1] + d[f2 - 1].height : 0;
|
9056
9056
|
return w2;
|
9057
9057
|
}), l = valueEnhancer.derive(s, (d) => {
|
9058
9058
|
let w2 = 1 / 0;
|
9059
|
-
for (let
|
9060
|
-
d[
|
9059
|
+
for (let f2 = d.length - 1; f2 >= 0; f2--)
|
9060
|
+
d[f2].height <= w2 && (w2 = d[f2].height);
|
9061
9061
|
return w2;
|
9062
9062
|
}), c = valueEnhancer.combine(
|
9063
9063
|
[e, o2, s],
|
9064
|
-
([d, w2,
|
9065
|
-
if (w2.length !==
|
9064
|
+
([d, w2, f2]) => {
|
9065
|
+
if (w2.length !== f2.length)
|
9066
9066
|
return c.value;
|
9067
9067
|
for (let v = 0; v < w2.length; v++)
|
9068
|
-
if (w2[v] +
|
9068
|
+
if (w2[v] + f2[v].height - d >= 1e-3)
|
9069
9069
|
return v;
|
9070
9070
|
return w2.length - 1;
|
9071
9071
|
}
|
@@ -9074,7 +9074,7 @@
|
|
9074
9074
|
([d, w2]) => d.width / w2.width || 1
|
9075
9075
|
), a = valueEnhancer.combine(
|
9076
9076
|
[s, t, l, h2],
|
9077
|
-
([d, w2,
|
9077
|
+
([d, w2, f2, v]) => S$1(Math.ceil(w2.height / v / f2 / 2), 1, d.length)
|
9078
9078
|
);
|
9079
9079
|
valueEnhancer.withReadonlyValueEnhancer(this, {
|
9080
9080
|
pagesScrollTop: e,
|
@@ -9094,9 +9094,9 @@
|
|
9094
9094
|
this.sideEffect.setTimeout(g2, 1e3, "turn-off-hwa"), p.setValue(true);
|
9095
9095
|
};
|
9096
9096
|
this.sideEffect.addDisposer(
|
9097
|
-
valueEnhancer.combine([c, a, s]).subscribe(([d, w2,
|
9097
|
+
valueEnhancer.combine([c, a, s]).subscribe(([d, w2, f2]) => {
|
9098
9098
|
u();
|
9099
|
-
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);
|
9100
9100
|
for (let $ = 0; $ < this.$pages.children.length; $++) {
|
9101
9101
|
const x = this.$pages.children[$], k2 = Number(x.dataset.index);
|
9102
9102
|
k2 >= v && k2 <= C || (x.remove(), $--);
|
@@ -9618,10 +9618,10 @@
|
|
9618
9618
|
const h2 = n.add(() => {
|
9619
9619
|
const a = ({ width: p, height: g2 }) => {
|
9620
9620
|
if (s.length > 0 && t.state !== "maximized") {
|
9621
|
-
const { width: u, height: d } = s[0],
|
9622
|
-
|
9621
|
+
const { width: u, height: d } = s[0], f2 = d / u * p - g2;
|
9622
|
+
f2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9623
9623
|
width: t.intrinsicWidth,
|
9624
|
-
height: t.intrinsicHeight +
|
9624
|
+
height: t.intrinsicHeight + f2 / t.rootRect.height
|
9625
9625
|
});
|
9626
9626
|
}
|
9627
9627
|
n.remove(h2);
|
@@ -9678,7 +9678,7 @@
|
|
9678
9678
|
function di() {
|
9679
9679
|
return Ge(" ");
|
9680
9680
|
}
|
9681
|
-
function
|
9681
|
+
function g(e, i2, t) {
|
9682
9682
|
t == null ? e.removeAttribute(i2) : e.getAttribute(i2) !== t && e.setAttribute(i2, t);
|
9683
9683
|
}
|
9684
9684
|
function pi(e) {
|
@@ -9796,13 +9796,13 @@
|
|
9796
9796
|
};
|
9797
9797
|
a && a(c.root);
|
9798
9798
|
let u = false;
|
9799
|
-
if (c.ctx = t ? t(e, i2.props || {}, (
|
9799
|
+
if (c.ctx = t ? t(e, i2.props || {}, (m, p, ...v) => {
|
9800
9800
|
const b = v.length ? v[0] : p;
|
9801
|
-
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;
|
9802
9802
|
}) : [], c.update(), u = true, $e(c.before_update), c.fragment = r ? r(c.ctx) : false, i2.target) {
|
9803
9803
|
if (i2.hydrate) {
|
9804
|
-
const
|
9805
|
-
c.fragment && c.fragment.l(
|
9804
|
+
const m = pi(i2.target);
|
9805
|
+
c.fragment && c.fragment.l(m), m.forEach(G);
|
9806
9806
|
} else
|
9807
9807
|
c.fragment && c.fragment.c();
|
9808
9808
|
i2.intro && Pt(e.$$.fragment), Mt(e, i2.target, i2.anchor, i2.customElement), Et();
|
@@ -9986,13 +9986,13 @@
|
|
9986
9986
|
return Array.isArray(e) ? e[0] : e;
|
9987
9987
|
}
|
9988
9988
|
function Li(e) {
|
9989
|
-
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;
|
9990
9990
|
return {
|
9991
9991
|
c() {
|
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"),
|
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");
|
9993
9993
|
},
|
9994
9994
|
m(We, ni) {
|
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,
|
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);
|
9996
9996
|
},
|
9997
9997
|
p: X,
|
9998
9998
|
i: X,
|
@@ -10007,7 +10007,7 @@
|
|
10007
10007
|
super(), Lt(this, i2, null, Li, Ct, {});
|
10008
10008
|
}
|
10009
10009
|
}
|
10010
|
-
function
|
10010
|
+
function f(e, i2, t) {
|
10011
10011
|
return i2 in e ? Object.defineProperty(e, i2, { value: t, enumerable: true, configurable: true, writable: true }) : e[i2] = t, e;
|
10012
10012
|
}
|
10013
10013
|
function zi(e, i2) {
|
@@ -10468,7 +10468,7 @@
|
|
10468
10468
|
} };
|
10469
10469
|
class we {
|
10470
10470
|
constructor(i2) {
|
10471
|
-
|
10471
|
+
f(this, "get", (t) => {
|
10472
10472
|
if (!we.supported || !this.enabled)
|
10473
10473
|
return null;
|
10474
10474
|
const r = window.localStorage.getItem(this.key);
|
@@ -10476,7 +10476,7 @@
|
|
10476
10476
|
return null;
|
10477
10477
|
const s = JSON.parse(r);
|
10478
10478
|
return o.string(t) && t.length ? s[t] : s;
|
10479
|
-
}),
|
10479
|
+
}), f(this, "set", (t) => {
|
10480
10480
|
if (!we.supported || !this.enabled || !o.object(t))
|
10481
10481
|
return;
|
10482
10482
|
let r = this.get();
|
@@ -10856,8 +10856,8 @@
|
|
10856
10856
|
const c = _("div", B(this.config.selectors.controls.wrapper));
|
10857
10857
|
this.elements.controls = c;
|
10858
10858
|
const u = { class: "plyr__controls__item" };
|
10859
|
-
return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((
|
10860
|
-
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") {
|
10861
10861
|
const p = _("div", { class: `${u.class} plyr__progress__container` }), v = _("div", B(this.config.selectors.progress));
|
10862
10862
|
if (v.appendChild(s.call(this, "seek", { id: `plyr-seek-${e.id}` })), v.appendChild(r.call(this, "buffer")), this.config.tooltips.seek) {
|
10863
10863
|
const b = _("span", { class: this.config.classNames.tooltip }, "00:00");
|
@@ -10865,39 +10865,39 @@
|
|
10865
10865
|
}
|
10866
10866
|
this.elements.progress = v, p.appendChild(this.elements.progress), c.appendChild(p);
|
10867
10867
|
}
|
10868
|
-
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") {
|
10869
10869
|
let { volume: p } = this.elements;
|
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)),
|
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) {
|
10871
10871
|
const v = { max: 1, step: 0.05, value: this.config.volume };
|
10872
10872
|
p.appendChild(s.call(this, "volume", z(v, { id: `plyr-volume-${e.id}` })));
|
10873
10873
|
}
|
10874
10874
|
}
|
10875
|
-
if (
|
10875
|
+
if (m === "captions" && c.appendChild(t.call(this, "captions", u)), m === "settings" && !o.empty(this.config.settings)) {
|
10876
10876
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10877
10877
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10878
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" });
|
10879
10879
|
T2.appendChild(N2), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10880
|
-
const
|
10881
|
-
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", () => {
|
10882
10882
|
d.call(this, x, false);
|
10883
10883
|
});
|
10884
10884
|
const C = _("span", null, j.get(x, this.config)), L2 = _("span", { class: this.config.classNames.menu.value });
|
10885
|
-
L2.innerHTML = e[x], C.appendChild(L2),
|
10885
|
+
L2.innerHTML = e[x], C.appendChild(L2), y.appendChild(C), N2.appendChild(y);
|
10886
10886
|
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10887
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) => {
|
10888
10888
|
V2.key === "ArrowLeft" && (V2.preventDefault(), V2.stopPropagation(), d.call(this, "home", true));
|
10889
10889
|
}, false), E.call(this, D2, "click", () => {
|
10890
10890
|
d.call(this, "home", false);
|
10891
|
-
}), $.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] = $;
|
10892
10892
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10893
10893
|
}
|
10894
|
-
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") {
|
10895
10895
|
const p = z({}, u, { element: "a", href: this.download, target: "_blank" });
|
10896
10896
|
this.isHTML5 && (p.download = "");
|
10897
10897
|
const { download: v } = this.config.urls;
|
10898
10898
|
!o.url(v) && this.isEmbed && z(p, { icon: `logo-${this.provider}`, label: this.provider }), c.appendChild(t.call(this, "download", p));
|
10899
10899
|
}
|
10900
|
-
|
10900
|
+
m === "fullscreen" && c.appendChild(t.call(this, "fullscreen", u));
|
10901
10901
|
}), this.isHTML5 && a.call(this, Q.getQualityOptions.call(this)), l.call(this), c;
|
10902
10902
|
}, inject() {
|
10903
10903
|
if (this.config.loadSprite) {
|
@@ -11097,14 +11097,14 @@
|
|
11097
11097
|
}
|
11098
11098
|
class U {
|
11099
11099
|
constructor(i2) {
|
11100
|
-
|
11100
|
+
f(this, "onChange", () => {
|
11101
11101
|
if (!this.enabled)
|
11102
11102
|
return;
|
11103
11103
|
const t = this.player.elements.buttons.fullscreen;
|
11104
11104
|
o.element(t) && (t.pressed = this.active);
|
11105
11105
|
const r = this.target === this.player.media ? this.target : this.player.elements.container;
|
11106
11106
|
w.call(this.player, r, this.active ? "enterfullscreen" : "exitfullscreen", true);
|
11107
|
-
}),
|
11107
|
+
}), f(this, "toggleFallback", (t = false) => {
|
11108
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) {
|
11109
11109
|
let r = document.head.querySelector('meta[name="viewport"]');
|
11110
11110
|
const s = "viewport-fit=cover";
|
@@ -11113,21 +11113,21 @@
|
|
11113
11113
|
t ? (this.cleanupViewport = !n, n || (r.content += `,${s}`)) : this.cleanupViewport && (r.content = r.content.split(",").filter((a) => a.trim() !== s).join(","));
|
11114
11114
|
}
|
11115
11115
|
this.onChange();
|
11116
|
-
}),
|
11116
|
+
}), f(this, "trapFocus", (t) => {
|
11117
11117
|
if (H.isIos || !this.active || t.key !== "Tab")
|
11118
11118
|
return;
|
11119
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];
|
11120
11120
|
r !== a || t.shiftKey ? r === n && t.shiftKey && (a.focus(), t.preventDefault()) : (n.focus(), t.preventDefault());
|
11121
|
-
}),
|
11121
|
+
}), f(this, "update", () => {
|
11122
11122
|
if (this.enabled) {
|
11123
11123
|
let t;
|
11124
11124
|
t = this.forceFallback ? "Fallback (forced)" : U.native ? "Native" : "Fallback", this.player.debug.log(`${t} fullscreen enabled`);
|
11125
11125
|
} else
|
11126
11126
|
this.player.debug.log("Fullscreen not supported and fallback disabled");
|
11127
11127
|
A(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);
|
11128
|
-
}),
|
11128
|
+
}), f(this, "enter", () => {
|
11129
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" }));
|
11130
|
-
}),
|
11130
|
+
}), f(this, "exit", () => {
|
11131
11131
|
if (this.enabled)
|
11132
11132
|
if (H.isIos && this.player.config.fullscreen.iosNative)
|
11133
11133
|
this.target.webkitExitFullscreen(), W(this.player.play());
|
@@ -11140,7 +11140,7 @@
|
|
11140
11140
|
}
|
11141
11141
|
} else
|
11142
11142
|
(document.cancelFullScreen || document.exitFullscreen).call(document);
|
11143
|
-
}),
|
11143
|
+
}), f(this, "toggle", () => {
|
11144
11144
|
this.active ? this.exit() : this.enter();
|
11145
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`, () => {
|
11146
11146
|
this.onChange();
|
@@ -11238,10 +11238,10 @@
|
|
11238
11238
|
} };
|
11239
11239
|
class wr {
|
11240
11240
|
constructor(i2) {
|
11241
|
-
|
11241
|
+
f(this, "firstTouch", () => {
|
11242
11242
|
const { player: t } = this, { elements: r } = t;
|
11243
11243
|
t.touch = true, A(r.container, t.config.classNames.isTouch, true);
|
11244
|
-
}),
|
11244
|
+
}), f(this, "setTabFocus", (t) => {
|
11245
11245
|
const { player: r } = this, { elements: s } = r, { key: n, type: a, timeStamp: l } = t;
|
11246
11246
|
if (clearTimeout(this.focusTimer), a === "keydown" && n !== "Tab")
|
11247
11247
|
return;
|
@@ -11254,10 +11254,10 @@
|
|
11254
11254
|
const c = document.activeElement;
|
11255
11255
|
s.container.contains(c) && A(document.activeElement, r.config.classNames.tabFocus, true);
|
11256
11256
|
}, 10)));
|
11257
|
-
}),
|
11257
|
+
}), f(this, "global", (t = true) => {
|
11258
11258
|
const { player: r } = this;
|
11259
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);
|
11260
|
-
}),
|
11260
|
+
}), f(this, "container", () => {
|
11261
11261
|
const { player: t } = this, { config: r, elements: s, timers: n } = t;
|
11262
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) => {
|
11263
11263
|
const { controls: c } = s;
|
@@ -11268,11 +11268,11 @@
|
|
11268
11268
|
const a = () => {
|
11269
11269
|
if (!t.isVimeo || t.config.vimeo.premium)
|
11270
11270
|
return;
|
11271
|
-
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}`);
|
11272
11272
|
if (!c)
|
11273
11273
|
return void (p ? (d.style.width = null, d.style.height = null) : (d.style.maxWidth = null, d.style.margin = null));
|
11274
|
-
const [v, b] = pr(), T2 = v / b > u /
|
11275
|
-
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);
|
11276
11276
|
}, l = () => {
|
11277
11277
|
clearTimeout(n.resized), n.resized = setTimeout(a, 50);
|
11278
11278
|
};
|
@@ -11280,7 +11280,7 @@
|
|
11280
11280
|
const { target: c } = t.fullscreen;
|
11281
11281
|
c === s.container && (!t.isEmbed && o.empty(t.config.ratio) || (a(), (d.type === "enterfullscreen" ? E : je).call(t, window, "resize", l)));
|
11282
11282
|
});
|
11283
|
-
}),
|
11283
|
+
}), f(this, "media", () => {
|
11284
11284
|
const { player: t } = this, { elements: r } = t;
|
11285
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", () => {
|
11286
11286
|
t.isHTML5 && t.isVideo && t.config.resetOnEnd && (t.restart(), t.pause());
|
@@ -11312,14 +11312,14 @@
|
|
11312
11312
|
let { detail: a = {} } = n;
|
11313
11313
|
n.type === "error" && (a = t.media.error), w.call(t, r.container, n.type, true, a);
|
11314
11314
|
});
|
11315
|
-
}),
|
11315
|
+
}), f(this, "proxy", (t, r, s) => {
|
11316
11316
|
const { player: n } = this, a = n.config.listeners[s];
|
11317
11317
|
let l = true;
|
11318
11318
|
o.function(a) && (l = a.call(n, t)), l !== false && o.function(r) && r.call(n, t);
|
11319
|
-
}),
|
11319
|
+
}), f(this, "bind", (t, r, s, n, a = true) => {
|
11320
11320
|
const { player: l } = this, d = l.config.listeners[n], c = o.function(d);
|
11321
11321
|
E.call(l, t, r, (u) => this.proxy(u, s, n), a && !c);
|
11322
|
-
}),
|
11322
|
+
}), f(this, "controls", () => {
|
11323
11323
|
const { player: t } = this, { elements: r } = t, s = H.isIE ? "change" : "input";
|
11324
11324
|
if (r.buttons.play && Array.from(r.buttons.play).forEach((n) => {
|
11325
11325
|
this.bind(n, "click", () => {
|
@@ -11395,7 +11395,7 @@
|
|
11395
11395
|
const l = this.touch ? 3e3 : 4e3;
|
11396
11396
|
clearTimeout(a.controls), a.controls = setTimeout(() => M.toggleControls.call(t, false), l);
|
11397
11397
|
}), this.bind(r.inputs.volume, "wheel", (n) => {
|
11398
|
-
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);
|
11399
11399
|
t.increaseVolume(c / 50);
|
11400
11400
|
const { volume: u } = t.media;
|
11401
11401
|
(c === 1 && u < 1 || c === -1 && u > 0) && n.preventDefault();
|
@@ -11403,7 +11403,7 @@
|
|
11403
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);
|
11404
11404
|
}
|
11405
11405
|
handleKey(i2) {
|
11406
|
-
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;
|
11407
11407
|
if (!(a || l || d || c) && !!s) {
|
11408
11408
|
if (u) {
|
11409
11409
|
const v = document.activeElement;
|
@@ -11423,11 +11423,11 @@
|
|
11423
11423
|
case "7":
|
11424
11424
|
case "8":
|
11425
11425
|
case "9":
|
11426
|
-
|
11426
|
+
m || (p = parseInt(s, 10), t.currentTime = t.duration / 10 * p);
|
11427
11427
|
break;
|
11428
11428
|
case "Space":
|
11429
11429
|
case "k":
|
11430
|
-
|
11430
|
+
m || W(t.togglePlay());
|
11431
11431
|
break;
|
11432
11432
|
case "ArrowUp":
|
11433
11433
|
t.increaseVolume(0.1);
|
@@ -11436,7 +11436,7 @@
|
|
11436
11436
|
t.decreaseVolume(0.1);
|
11437
11437
|
break;
|
11438
11438
|
case "m":
|
11439
|
-
|
11439
|
+
m || (t.muted = !t.muted);
|
11440
11440
|
break;
|
11441
11441
|
case "ArrowRight":
|
11442
11442
|
t.forward();
|
@@ -11448,7 +11448,7 @@
|
|
11448
11448
|
t.fullscreen.toggle();
|
11449
11449
|
break;
|
11450
11450
|
case "c":
|
11451
|
-
|
11451
|
+
m || t.toggleCaptions();
|
11452
11452
|
break;
|
11453
11453
|
case "l":
|
11454
11454
|
t.loop = !t.loop;
|
@@ -11472,11 +11472,11 @@
|
|
11472
11472
|
}, r = {}, s = {}, n = {};
|
11473
11473
|
function a(p, v) {
|
11474
11474
|
p = p.push ? p : [p];
|
11475
|
-
var b, T2, N2, x = [],
|
11475
|
+
var b, T2, N2, x = [], y = p.length, C = y;
|
11476
11476
|
for (b = function(L2, $) {
|
11477
11477
|
$.length && x.push(L2), --C || v(x);
|
11478
|
-
};
|
11479
|
-
T2 = p[
|
11478
|
+
}; y--; )
|
11479
|
+
T2 = p[y], (N2 = s[T2]) ? b(T2, N2) : (n[T2] = n[T2] || []).push(b);
|
11480
11480
|
}
|
11481
11481
|
function l(p, v) {
|
11482
11482
|
if (p) {
|
@@ -11490,8 +11490,8 @@
|
|
11490
11490
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11491
11491
|
}
|
11492
11492
|
function c(p, v, b, T2) {
|
11493
|
-
var N2, x,
|
11494
|
-
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) {
|
11495
11495
|
var F2 = re.type[0];
|
11496
11496
|
if (N2)
|
11497
11497
|
try {
|
@@ -11505,10 +11505,10 @@
|
|
11505
11505
|
} else if (x.rel == "preload" && x.as == "style")
|
11506
11506
|
return x.rel = "stylesheet";
|
11507
11507
|
v(p, F2, re.defaultPrevented);
|
11508
|
-
}, $(p, x) !== false &&
|
11508
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11509
11509
|
}
|
11510
11510
|
function u(p, v, b) {
|
11511
|
-
var T2, N2, x = (p = p.push ? p : [p]).length,
|
11511
|
+
var T2, N2, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11512
11512
|
for (T2 = function(L2, $, D2) {
|
11513
11513
|
if ($ == "e" && C.push(L2), $ == "b") {
|
11514
11514
|
if (!D2)
|
@@ -11516,36 +11516,36 @@
|
|
11516
11516
|
C.push(L2);
|
11517
11517
|
}
|
11518
11518
|
--x || v(C);
|
11519
|
-
}, N2 = 0; N2 <
|
11519
|
+
}, N2 = 0; N2 < y; N2++)
|
11520
11520
|
c(p[N2], T2, b);
|
11521
11521
|
}
|
11522
|
-
function
|
11522
|
+
function m(p, v, b) {
|
11523
11523
|
var T2, N2;
|
11524
11524
|
if (v && v.trim && (T2 = v), N2 = (T2 ? b : v) || {}, T2) {
|
11525
11525
|
if (T2 in r)
|
11526
11526
|
throw "LoadJS";
|
11527
11527
|
r[T2] = true;
|
11528
11528
|
}
|
11529
|
-
function x(
|
11529
|
+
function x(y, C) {
|
11530
11530
|
u(p, function(L2) {
|
11531
|
-
d(N2, L2),
|
11531
|
+
d(N2, L2), y && d({ success: y, error: C }, L2), l(T2, L2);
|
11532
11532
|
}, N2);
|
11533
11533
|
}
|
11534
11534
|
if (N2.returnPromise)
|
11535
11535
|
return new Promise(x);
|
11536
11536
|
x();
|
11537
11537
|
}
|
11538
|
-
return
|
11538
|
+
return m.ready = function(p, v) {
|
11539
11539
|
return a(p, function(b) {
|
11540
11540
|
d(v, b);
|
11541
|
-
}),
|
11542
|
-
},
|
11541
|
+
}), m;
|
11542
|
+
}, m.done = function(p) {
|
11543
11543
|
l(p, []);
|
11544
|
-
},
|
11544
|
+
}, m.reset = function() {
|
11545
11545
|
r = {}, s = {}, n = {};
|
11546
|
-
},
|
11546
|
+
}, m.isDefined = function(p) {
|
11547
11547
|
return p in r;
|
11548
|
-
},
|
11548
|
+
}, m;
|
11549
11549
|
}();
|
11550
11550
|
});
|
11551
11551
|
function ut(e) {
|
@@ -11576,75 +11576,75 @@
|
|
11576
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);
|
11577
11577
|
const l = a ? { h: a } : {};
|
11578
11578
|
t && Object.assign(s, { controls: false, sidedock: false });
|
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"),
|
11580
|
-
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)
|
11581
11581
|
u.setAttribute("data-poster", e.poster), e.media = Le(u, e.media);
|
11582
11582
|
else {
|
11583
|
-
const
|
11584
|
-
|
11583
|
+
const y = _("div", { class: e.config.classNames.embedContainer, "data-poster": e.poster });
|
11584
|
+
y.appendChild(u), e.media = Le(y, e.media);
|
11585
11585
|
}
|
11586
|
-
i2.customControls || Te(st(e.config.urls.vimeo.api,
|
11587
|
-
!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(() => {
|
11588
11588
|
});
|
11589
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 = () => {
|
11590
11590
|
e.pause(), e.currentTime = 0;
|
11591
11591
|
};
|
11592
11592
|
let { currentTime: p } = e.media;
|
11593
|
-
Object.defineProperty(e.media, "currentTime", { get: () => p, set(
|
11593
|
+
Object.defineProperty(e.media, "currentTime", { get: () => p, set(y) {
|
11594
11594
|
const { embed: C, media: L2, paused: $, volume: D2 } = e, V2 = $ && !C.hasPlayed;
|
11595
|
-
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(() => {
|
11596
11596
|
});
|
11597
11597
|
} });
|
11598
11598
|
let v = e.config.speed.selected;
|
11599
|
-
Object.defineProperty(e.media, "playbackRate", { get: () => v, set(
|
11600
|
-
e.embed.setPlaybackRate(
|
11601
|
-
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");
|
11602
11602
|
}).catch(() => {
|
11603
11603
|
e.options.speed = [1];
|
11604
11604
|
});
|
11605
11605
|
} });
|
11606
11606
|
let { volume: b } = e.config;
|
11607
|
-
Object.defineProperty(e.media, "volume", { get: () => b, set(
|
11608
|
-
e.embed.setVolume(
|
11609
|
-
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");
|
11610
11610
|
});
|
11611
11611
|
} });
|
11612
11612
|
let { muted: T2 } = e.config;
|
11613
|
-
Object.defineProperty(e.media, "muted", { get: () => T2, set(
|
11614
|
-
const C = !!o.boolean(
|
11613
|
+
Object.defineProperty(e.media, "muted", { get: () => T2, set(y) {
|
11614
|
+
const C = !!o.boolean(y) && y;
|
11615
11615
|
e.embed.setVolume(C ? 0 : e.config.volume).then(() => {
|
11616
11616
|
T2 = C, w.call(e, e.media, "volumechange");
|
11617
11617
|
});
|
11618
11618
|
} });
|
11619
11619
|
let N2, { loop: x } = e.config;
|
11620
|
-
Object.defineProperty(e.media, "loop", { get: () => x, set(
|
11621
|
-
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;
|
11622
11622
|
e.embed.setLoop(C).then(() => {
|
11623
11623
|
x = C;
|
11624
11624
|
});
|
11625
|
-
} }), e.embed.getVideoUrl().then((
|
11626
|
-
N2 =
|
11627
|
-
}).catch((
|
11628
|
-
this.debug.warn(
|
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((
|
11630
|
-
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;
|
11631
11631
|
e.embed.ratio = Qt(C, L2), oe.call(this);
|
11632
|
-
}), e.embed.setAutopause(e.config.autopause).then((
|
11633
|
-
e.config.autopause =
|
11634
|
-
}), e.embed.getVideoTitle().then((
|
11635
|
-
e.config.title =
|
11636
|
-
}), e.embed.getCurrentTime().then((
|
11637
|
-
p =
|
11638
|
-
}), e.embed.getDuration().then((
|
11639
|
-
e.media.duration =
|
11640
|
-
}), e.embed.getTextTracks().then((
|
11641
|
-
e.media.textTracks =
|
11642
|
-
}), e.embed.on("cuechange", ({ cues:
|
11643
|
-
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));
|
11644
11644
|
P.updateCues.call(e, C);
|
11645
11645
|
}), e.embed.on("loaded", () => {
|
11646
|
-
e.embed.getPaused().then((
|
11647
|
-
me.call(e, !
|
11646
|
+
e.embed.getPaused().then((y) => {
|
11647
|
+
me.call(e, !y), y || w.call(e, e.media, "playing");
|
11648
11648
|
}), o.element(e.embed.element) && e.supported.ui && e.embed.element.setAttribute("tabindex", -1);
|
11649
11649
|
}), e.embed.on("bufferstart", () => {
|
11650
11650
|
w.call(e, e.media, "waiting");
|
@@ -11654,18 +11654,18 @@
|
|
11654
11654
|
me.call(e, true), w.call(e, e.media, "playing");
|
11655
11655
|
}), e.embed.on("pause", () => {
|
11656
11656
|
me.call(e, false);
|
11657
|
-
}), e.embed.on("timeupdate", (
|
11658
|
-
e.media.seeking = false, p =
|
11659
|
-
}), e.embed.on("progress", (
|
11660
|
-
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) => {
|
11661
11661
|
C !== e.media.duration && (e.media.duration = C, w.call(e, e.media, "durationchange"));
|
11662
11662
|
});
|
11663
11663
|
}), e.embed.on("seeked", () => {
|
11664
11664
|
e.media.seeking = false, w.call(e, e.media, "seeked");
|
11665
11665
|
}), e.embed.on("ended", () => {
|
11666
11666
|
e.media.paused = true, w.call(e, e.media, "ended");
|
11667
|
-
}), e.embed.on("error", (
|
11668
|
-
e.media.error =
|
11667
|
+
}), e.embed.on("error", (y) => {
|
11668
|
+
e.media.error = y, w.call(e, e.media, "error");
|
11669
11669
|
}), i2.customControls && setTimeout(() => M.build.call(e), 0);
|
11670
11670
|
} };
|
11671
11671
|
function Sr(e) {
|
@@ -11730,22 +11730,22 @@
|
|
11730
11730
|
ge.call(e, false), l.pauseVideo();
|
11731
11731
|
}, e.media.stop = () => {
|
11732
11732
|
l.stopVideo();
|
11733
|
-
}, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(
|
11734
|
-
e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(
|
11735
|
-
} }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(
|
11736
|
-
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);
|
11737
11737
|
} });
|
11738
11738
|
let { volume: d } = e.config;
|
11739
|
-
Object.defineProperty(e.media, "volume", { get: () => d, set(
|
11740
|
-
d =
|
11739
|
+
Object.defineProperty(e.media, "volume", { get: () => d, set(m) {
|
11740
|
+
d = m, l.setVolume(100 * d), w.call(e, e.media, "volumechange");
|
11741
11741
|
} });
|
11742
11742
|
let { muted: c } = e.config;
|
11743
|
-
Object.defineProperty(e.media, "muted", { get: () => c, set(
|
11744
|
-
const p = o.boolean(
|
11743
|
+
Object.defineProperty(e.media, "muted", { get: () => c, set(m) {
|
11744
|
+
const p = o.boolean(m) ? m : c;
|
11745
11745
|
c = p, l[p ? "mute" : "unMute"](), l.setVolume(100 * d), w.call(e, e.media, "volumechange");
|
11746
11746
|
} }), Object.defineProperty(e.media, "currentSrc", { get: () => l.getVideoUrl() }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration });
|
11747
11747
|
const u = l.getAvailablePlaybackRates();
|
11748
|
-
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(() => {
|
11749
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"));
|
11750
11750
|
}, 200), i2.customControls && setTimeout(() => M.build.call(e), 50);
|
11751
11751
|
}, onStateChange(a) {
|
@@ -11775,20 +11775,20 @@
|
|
11775
11775
|
} };
|
11776
11776
|
class Er {
|
11777
11777
|
constructor(i2) {
|
11778
|
-
|
11778
|
+
f(this, "load", () => {
|
11779
11779
|
this.enabled && (o.object(window.google) && o.object(window.google.ima) ? this.ready() : ut(this.player.config.urls.googleIMA.sdk).then(() => {
|
11780
11780
|
this.ready();
|
11781
11781
|
}).catch(() => {
|
11782
11782
|
this.trigger("error", new Error("Google IMA SDK failed to load"));
|
11783
11783
|
}));
|
11784
|
-
}),
|
11784
|
+
}), f(this, "ready", () => {
|
11785
11785
|
var t;
|
11786
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(() => {
|
11787
11787
|
this.clearSafetyTimer("onAdsManagerLoaded()");
|
11788
11788
|
}), this.listeners(), this.setupIMA();
|
11789
|
-
}),
|
11789
|
+
}), f(this, "setupIMA", () => {
|
11790
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();
|
11791
|
-
}),
|
11791
|
+
}), f(this, "requestAds", () => {
|
11792
11792
|
const { container: t } = this.player.elements;
|
11793
11793
|
try {
|
11794
11794
|
const r = new google.ima.AdsRequest();
|
@@ -11796,21 +11796,21 @@
|
|
11796
11796
|
} catch (r) {
|
11797
11797
|
this.onAdError(r);
|
11798
11798
|
}
|
11799
|
-
}),
|
11799
|
+
}), f(this, "pollCountdown", (t = false) => {
|
11800
11800
|
if (!t)
|
11801
11801
|
return clearInterval(this.countdownTimer), void this.elements.container.removeAttribute("data-badge-text");
|
11802
11802
|
this.countdownTimer = setInterval(() => {
|
11803
11803
|
const r = He(Math.max(this.manager.getRemainingTime(), 0)), s = `${j.get("advertisement", this.player.config)} - ${r}`;
|
11804
11804
|
this.elements.container.setAttribute("data-badge-text", s);
|
11805
11805
|
}, 100);
|
11806
|
-
}),
|
11806
|
+
}), f(this, "onAdsManagerLoaded", (t) => {
|
11807
11807
|
if (!this.enabled)
|
11808
11808
|
return;
|
11809
11809
|
const r = new google.ima.AdsRenderingSettings();
|
11810
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) => {
|
11811
11811
|
this.manager.addEventListener(google.ima.AdEvent.Type[s], (n) => this.onAdEvent(n));
|
11812
11812
|
}), this.trigger("loaded");
|
11813
|
-
}),
|
11813
|
+
}), f(this, "addCuePoints", () => {
|
11814
11814
|
o.empty(this.cuePoints) || this.cuePoints.forEach((t) => {
|
11815
11815
|
if (t !== 0 && t !== -1 && t < this.player.duration) {
|
11816
11816
|
const r = this.player.elements.progress;
|
@@ -11820,7 +11820,7 @@
|
|
11820
11820
|
}
|
11821
11821
|
}
|
11822
11822
|
});
|
11823
|
-
}),
|
11823
|
+
}), f(this, "onAdEvent", (t) => {
|
11824
11824
|
const { container: r } = this.player.elements, s = t.getAd(), n = t.getAdData();
|
11825
11825
|
switch (((a) => {
|
11826
11826
|
w.call(this.player, this.player.media, `ads${a.replace(/_/g, "").toLowerCase()}`);
|
@@ -11843,9 +11843,9 @@
|
|
11843
11843
|
case google.ima.AdEvent.Type.LOG:
|
11844
11844
|
n.adError && this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`);
|
11845
11845
|
}
|
11846
|
-
}),
|
11846
|
+
}), f(this, "onAdError", (t) => {
|
11847
11847
|
this.cancel(), this.player.debug.warn("Ads error", t);
|
11848
|
-
}),
|
11848
|
+
}), f(this, "listeners", () => {
|
11849
11849
|
const { container: t } = this.player.elements;
|
11850
11850
|
let r;
|
11851
11851
|
this.player.on("canplay", () => {
|
@@ -11862,7 +11862,7 @@
|
|
11862
11862
|
}), window.addEventListener("resize", () => {
|
11863
11863
|
this.manager && this.manager.resize(t.offsetWidth, t.offsetHeight, google.ima.ViewMode.NORMAL);
|
11864
11864
|
});
|
11865
|
-
}),
|
11865
|
+
}), f(this, "play", () => {
|
11866
11866
|
const { container: t } = this.player.elements;
|
11867
11867
|
this.managerPromise || this.resumeContent(), this.managerPromise.then(() => {
|
11868
11868
|
this.manager.setVolume(this.player.volume), this.elements.displayContainer.initialize();
|
@@ -11873,29 +11873,29 @@
|
|
11873
11873
|
}
|
11874
11874
|
}).catch(() => {
|
11875
11875
|
});
|
11876
|
-
}),
|
11876
|
+
}), f(this, "resumeContent", () => {
|
11877
11877
|
this.elements.container.style.zIndex = "", this.playing = false, W(this.player.media.play());
|
11878
|
-
}),
|
11878
|
+
}), f(this, "pauseContent", () => {
|
11879
11879
|
this.elements.container.style.zIndex = 3, this.playing = true, this.player.media.pause();
|
11880
|
-
}),
|
11880
|
+
}), f(this, "cancel", () => {
|
11881
11881
|
this.initialized && this.resumeContent(), this.trigger("error"), this.loadAds();
|
11882
|
-
}),
|
11882
|
+
}), f(this, "loadAds", () => {
|
11883
11883
|
this.managerPromise.then(() => {
|
11884
11884
|
this.manager && this.manager.destroy(), this.managerPromise = new Promise((t) => {
|
11885
11885
|
this.on("loaded", t), this.player.debug.log(this.manager);
|
11886
11886
|
}), this.initialized = false, this.requestAds();
|
11887
11887
|
}).catch(() => {
|
11888
11888
|
});
|
11889
|
-
}),
|
11889
|
+
}), f(this, "trigger", (t, ...r) => {
|
11890
11890
|
const s = this.events[t];
|
11891
11891
|
o.array(s) && s.forEach((n) => {
|
11892
11892
|
o.function(n) && n.apply(this, r);
|
11893
11893
|
});
|
11894
|
-
}),
|
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) => {
|
11895
11895
|
this.player.debug.log(`Safety timer invoked from: ${r}`), this.safetyTimer = setTimeout(() => {
|
11896
11896
|
this.cancel(), this.clearSafetyTimer("startSafetyTimer()");
|
11897
11897
|
}, t);
|
11898
|
-
}),
|
11898
|
+
}), f(this, "clearSafetyTimer", (t) => {
|
11899
11899
|
o.nullOrUndefined(this.safetyTimer) || (this.player.debug.log(`Safety timer cleared from: ${t}`), clearTimeout(this.safetyTimer), this.safetyTimer = null);
|
11900
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) => {
|
11901
11901
|
this.on("loaded", t), this.on("error", r);
|
@@ -11935,11 +11935,11 @@
|
|
11935
11935
|
};
|
11936
11936
|
class at {
|
11937
11937
|
constructor(i2) {
|
11938
|
-
|
11938
|
+
f(this, "load", () => {
|
11939
11939
|
this.player.elements.display.seekTooltip && (this.player.elements.display.seekTooltip.hidden = this.enabled), this.enabled && this.getThumbnails().then(() => {
|
11940
11940
|
this.enabled && (this.render(), this.determineContainerAutoSizing(), this.loaded = true);
|
11941
11941
|
});
|
11942
|
-
}),
|
11942
|
+
}), f(this, "getThumbnails", () => new Promise((t) => {
|
11943
11943
|
const { src: r } = this.player.config.previewThumbnails;
|
11944
11944
|
if (o.empty(r))
|
11945
11945
|
throw new Error("Missing previewThumbnails.src config attribute");
|
@@ -11954,7 +11954,7 @@
|
|
11954
11954
|
const n = (o.string(r) ? [r] : r).map((a) => this.getThumbnail(a));
|
11955
11955
|
Promise.all(n).then(s);
|
11956
11956
|
}
|
11957
|
-
})),
|
11957
|
+
})), f(this, "getThumbnail", (t) => new Promise((r) => {
|
11958
11958
|
Te(t).then((s) => {
|
11959
11959
|
const n = { frames: Pr(s), height: null, urlPrefix: "" };
|
11960
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));
|
@@ -11963,7 +11963,7 @@
|
|
11963
11963
|
n.height = a.naturalHeight, n.width = a.naturalWidth, this.thumbnails.push(n), r();
|
11964
11964
|
}, a.src = n.urlPrefix + n.frames[0].text;
|
11965
11965
|
});
|
11966
|
-
})),
|
11966
|
+
})), f(this, "startMove", (t) => {
|
11967
11967
|
if (this.loaded && o.event(t) && ["touchmove", "mousemove"].includes(t.type) && this.player.media.duration) {
|
11968
11968
|
if (t.type === "touchmove")
|
11969
11969
|
this.seekTime = this.player.media.duration * (this.player.elements.inputs.seek.value / 100);
|
@@ -11976,15 +11976,15 @@
|
|
11976
11976
|
}
|
11977
11977
|
this.showImageAtCurrentTime();
|
11978
11978
|
}
|
11979
|
-
}),
|
11979
|
+
}), f(this, "endMove", () => {
|
11980
11980
|
this.toggleThumbContainer(false, true);
|
11981
|
-
}),
|
11981
|
+
}), f(this, "startScrubbing", (t) => {
|
11982
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()));
|
11983
|
-
}),
|
11983
|
+
}), f(this, "endScrubbing", () => {
|
11984
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", () => {
|
11985
11985
|
this.mouseDown || this.toggleScrubbingContainer(false);
|
11986
11986
|
});
|
11987
|
-
}),
|
11987
|
+
}), f(this, "listeners", () => {
|
11988
11988
|
this.player.on("play", () => {
|
11989
11989
|
this.toggleThumbContainer(false, true);
|
11990
11990
|
}), this.player.on("seeked", () => {
|
@@ -11992,20 +11992,20 @@
|
|
11992
11992
|
}), this.player.on("timeupdate", () => {
|
11993
11993
|
this.lastTime = this.player.media.currentTime;
|
11994
11994
|
});
|
11995
|
-
}),
|
11995
|
+
}), f(this, "render", () => {
|
11996
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);
|
11997
11997
|
const t = _("div", { class: this.player.config.classNames.previewThumbnails.timeContainer });
|
11998
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);
|
11999
|
-
}),
|
11999
|
+
}), f(this, "destroy", () => {
|
12000
12000
|
this.elements.thumb.container && this.elements.thumb.container.remove(), this.elements.scrubbing.container && this.elements.scrubbing.container.remove();
|
12001
|
-
}),
|
12001
|
+
}), f(this, "showImageAtCurrentTime", () => {
|
12002
12002
|
this.mouseDown ? this.setScrubbingContainerSize() : this.setThumbContainerSizeAndPos();
|
12003
12003
|
const t = this.thumbnails[0].frames.findIndex((n) => this.seekTime >= n.startTime && this.seekTime <= n.endTime), r = t >= 0;
|
12004
12004
|
let s = 0;
|
12005
12005
|
this.mouseDown || this.toggleThumbContainer(r), r && (this.thumbnails.forEach((n, a) => {
|
12006
12006
|
this.loadedImages.includes(n.frames[t].text) && (s = a);
|
12007
12007
|
}), t !== this.showingThumb && (this.showingThumb = t, this.loadImage(s)));
|
12008
|
-
}),
|
12008
|
+
}), f(this, "loadImage", (t = 0) => {
|
12009
12009
|
const r = this.showingThumb, s = this.thumbnails[t], { urlPrefix: n } = s, a = s.frames[r], l = s.frames[r].text, d = n + l;
|
12010
12010
|
if (this.currentImageElement && this.currentImageElement.dataset.filename === l)
|
12011
12011
|
this.showImage(this.currentImageElement, a, t, r, l, false), this.currentImageElement.dataset.index = r, this.removeOldImages(this.currentImageElement);
|
@@ -12014,9 +12014,9 @@
|
|
12014
12014
|
const c = new Image();
|
12015
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);
|
12016
12016
|
}
|
12017
|
-
}),
|
12017
|
+
}), f(this, "showImage", (t, r, s, n, a, l = true) => {
|
12018
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));
|
12019
|
-
}),
|
12019
|
+
}), f(this, "removeOldImages", (t) => {
|
12020
12020
|
Array.from(this.currentImageContainer.children).forEach((r) => {
|
12021
12021
|
if (r.tagName.toLowerCase() !== "img")
|
12022
12022
|
return;
|
@@ -12029,7 +12029,7 @@
|
|
12029
12029
|
}, s);
|
12030
12030
|
}
|
12031
12031
|
});
|
12032
|
-
}),
|
12032
|
+
}), f(this, "preloadNearby", (t, r = true) => new Promise((s) => {
|
12033
12033
|
setTimeout(() => {
|
12034
12034
|
const n = this.thumbnails[0].frames[t].text;
|
12035
12035
|
if (this.showingThumbFilename === n) {
|
@@ -12040,30 +12040,30 @@
|
|
12040
12040
|
const c = d.text;
|
12041
12041
|
if (c !== n && !this.loadedImages.includes(c)) {
|
12042
12042
|
l = true, this.player.debug.log(`Preloading thumb filename: ${c}`);
|
12043
|
-
const { urlPrefix: u } = this.thumbnails[0],
|
12044
|
-
p.src =
|
12043
|
+
const { urlPrefix: u } = this.thumbnails[0], m = u + c, p = new Image();
|
12044
|
+
p.src = m, p.onload = () => {
|
12045
12045
|
this.player.debug.log(`Preloaded thumb filename: ${c}`), this.loadedImages.includes(c) || this.loadedImages.push(c), s();
|
12046
12046
|
};
|
12047
12047
|
}
|
12048
12048
|
}), l || s();
|
12049
12049
|
}
|
12050
12050
|
}, 300);
|
12051
|
-
})),
|
12051
|
+
})), f(this, "getHigherQuality", (t, r, s, n) => {
|
12052
12052
|
if (t < this.thumbnails.length - 1) {
|
12053
12053
|
let a = r.naturalHeight;
|
12054
12054
|
this.usingSprites && (a = s.h), a < this.thumbContainerHeight && setTimeout(() => {
|
12055
12055
|
this.showingThumbFilename === n && (this.player.debug.log(`Showing higher quality thumb for: ${n}`), this.loadImage(t + 1));
|
12056
12056
|
}, 300);
|
12057
12057
|
}
|
12058
|
-
}),
|
12058
|
+
}), f(this, "toggleThumbContainer", (t = false, r = false) => {
|
12059
12059
|
const s = this.player.config.classNames.previewThumbnails.thumbContainerShown;
|
12060
12060
|
this.elements.thumb.container.classList.toggle(s, t), !t && r && (this.showingThumb = null, this.showingThumbFilename = null);
|
12061
|
-
}),
|
12061
|
+
}), f(this, "toggleScrubbingContainer", (t = false) => {
|
12062
12062
|
const r = this.player.config.classNames.previewThumbnails.scrubbingContainerShown;
|
12063
12063
|
this.elements.scrubbing.container.classList.toggle(r, t), t || (this.showingThumb = null, this.showingThumbFilename = null);
|
12064
|
-
}),
|
12064
|
+
}), f(this, "determineContainerAutoSizing", () => {
|
12065
12065
|
(this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) && (this.sizeSpecifiedInCSS = true);
|
12066
|
-
}),
|
12066
|
+
}), f(this, "setThumbContainerSizeAndPos", () => {
|
12067
12067
|
const { imageContainer: t } = this.elements.thumb;
|
12068
12068
|
if (this.sizeSpecifiedInCSS) {
|
12069
12069
|
if (t.clientHeight > 20 && t.clientWidth < 20) {
|
@@ -12078,13 +12078,13 @@
|
|
12078
12078
|
t.style.height = `${this.thumbContainerHeight}px`, t.style.width = `${r}px`;
|
12079
12079
|
}
|
12080
12080
|
this.setThumbContainerPos();
|
12081
|
-
}),
|
12081
|
+
}), f(this, "setThumbContainerPos", () => {
|
12082
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);
|
12083
12083
|
s.style.left = `${d}px`, s.style.setProperty("--preview-arrow-offset", l - d + "px");
|
12084
|
-
}),
|
12084
|
+
}), f(this, "setScrubbingContainerSize", () => {
|
12085
12085
|
const { width: t, height: r } = kt(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight });
|
12086
12086
|
this.elements.scrubbing.container.style.width = `${t}px`, this.elements.scrubbing.container.style.height = `${r}px`;
|
12087
|
-
}),
|
12087
|
+
}), f(this, "setImageSizeAndOffset", (t, r) => {
|
12088
12088
|
if (!this.usingSprites)
|
12089
12089
|
return;
|
12090
12090
|
const s = this.thumbContainerHeight / r.h;
|
@@ -12130,38 +12130,38 @@
|
|
12130
12130
|
} };
|
12131
12131
|
class xe {
|
12132
12132
|
constructor(i2, t) {
|
12133
|
-
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", () => {
|
12134
12134
|
this.isHTML5 ? (this.pause(), this.restart()) : o.function(this.media.stop) && this.media.stop();
|
12135
|
-
}),
|
12135
|
+
}), f(this, "restart", () => {
|
12136
12136
|
this.currentTime = 0;
|
12137
|
-
}),
|
12137
|
+
}), f(this, "rewind", (l) => {
|
12138
12138
|
this.currentTime -= o.number(l) ? l : this.config.seekTime;
|
12139
|
-
}),
|
12139
|
+
}), f(this, "forward", (l) => {
|
12140
12140
|
this.currentTime += o.number(l) ? l : this.config.seekTime;
|
12141
|
-
}),
|
12141
|
+
}), f(this, "increaseVolume", (l) => {
|
12142
12142
|
const d = this.media.muted ? 0 : this.volume;
|
12143
12143
|
this.volume = d + (o.number(l) ? l : 0);
|
12144
|
-
}),
|
12144
|
+
}), f(this, "decreaseVolume", (l) => {
|
12145
12145
|
this.increaseVolume(-l);
|
12146
|
-
}),
|
12146
|
+
}), f(this, "airplay", () => {
|
12147
12147
|
I.airplay && this.media.webkitShowPlaybackTargetPicker();
|
12148
|
-
}),
|
12148
|
+
}), f(this, "toggleControls", (l) => {
|
12149
12149
|
if (this.supported.ui && !this.isAudio) {
|
12150
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);
|
12151
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) {
|
12152
|
-
const
|
12153
|
-
w.call(this, this.media,
|
12152
|
+
const m = u ? "controlshidden" : "controlsshown";
|
12153
|
+
w.call(this, this.media, m);
|
12154
12154
|
}
|
12155
12155
|
return !u;
|
12156
12156
|
}
|
12157
12157
|
return false;
|
12158
|
-
}),
|
12158
|
+
}), f(this, "on", (l, d) => {
|
12159
12159
|
E.call(this, this.elements.container, l, d);
|
12160
|
-
}),
|
12160
|
+
}), f(this, "once", (l, d) => {
|
12161
12161
|
dt.call(this, this.elements.container, l, d);
|
12162
|
-
}),
|
12162
|
+
}), f(this, "off", (l, d) => {
|
12163
12163
|
je(this.elements.container, l, d);
|
12164
|
-
}),
|
12164
|
+
}), f(this, "destroy", (l, d = false) => {
|
12165
12165
|
if (!this.ready)
|
12166
12166
|
return;
|
12167
12167
|
const c = () => {
|
@@ -12170,7 +12170,7 @@
|
|
12170
12170
|
}, 200));
|
12171
12171
|
};
|
12172
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));
|
12173
|
-
}),
|
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 || {}, (() => {
|
12174
12174
|
try {
|
12175
12175
|
return JSON.parse(this.media.getAttribute("data-plyr-config"));
|
12176
12176
|
} catch {
|
@@ -12396,7 +12396,7 @@
|
|
12396
12396
|
let i2, t, r;
|
12397
12397
|
return {
|
12398
12398
|
c() {
|
12399
|
-
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]);
|
12400
12400
|
},
|
12401
12401
|
m(s, n) {
|
12402
12402
|
te(s, i2, n), k(i2, t), e[8](i2);
|
@@ -12411,7 +12411,7 @@
|
|
12411
12411
|
let i2, t, r;
|
12412
12412
|
return {
|
12413
12413
|
c() {
|
12414
|
-
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]);
|
12415
12415
|
},
|
12416
12416
|
m(s, n) {
|
12417
12417
|
te(s, i2, n), k(i2, t), e[7](i2);
|
@@ -12430,7 +12430,7 @@
|
|
12430
12430
|
return {
|
12431
12431
|
c() {
|
12432
12432
|
i2 = ie("div"), t = Ge(`Invalid "src" or "type".
|
12433
|
-
`), s = Ge(r),
|
12433
|
+
`), s = Ge(r), g(i2, "data-app-kind", "Plyr"), g(i2, "class", "plyr--audio");
|
12434
12434
|
},
|
12435
12435
|
m(n, a) {
|
12436
12436
|
te(n, i2, a), k(i2, t), k(i2, s);
|
@@ -12450,7 +12450,7 @@
|
|
12450
12450
|
let i2;
|
12451
12451
|
return {
|
12452
12452
|
c() {
|
12453
|
-
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]);
|
12454
12454
|
},
|
12455
12455
|
m(t, r) {
|
12456
12456
|
te(t, i2, r), e[6](i2);
|
@@ -12516,7 +12516,7 @@
|
|
12516
12516
|
console.warn("[Plyr] destroy plyr error", b);
|
12517
12517
|
}
|
12518
12518
|
});
|
12519
|
-
function
|
12519
|
+
function m(b) {
|
12520
12520
|
be[b ? "unshift" : "push"](() => {
|
12521
12521
|
c = b, t(1, c);
|
12522
12522
|
});
|
@@ -12540,7 +12540,7 @@
|
|
12540
12540
|
a,
|
12541
12541
|
l,
|
12542
12542
|
s,
|
12543
|
-
|
12543
|
+
m,
|
12544
12544
|
p,
|
12545
12545
|
v
|
12546
12546
|
];
|
@@ -12589,7 +12589,10 @@
|
|
12589
12589
|
if (!t)
|
12590
12590
|
return;
|
12591
12591
|
const { currentTime: n, hostTime: a, muted: l, paused: d, volume: c, owner: u } = s.state;
|
12592
|
-
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));
|
12593
12596
|
}
|
12594
12597
|
watchUserInputs(i2) {
|
12595
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"]');
|
@@ -12783,8 +12786,8 @@
|
|
12783
12786
|
const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
12784
12787
|
constructor(context) {
|
12785
12788
|
super(context);
|
12786
|
-
this.version = "1.0.0-canary.
|
12787
|
-
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.67";
|
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" } };
|
12788
12791
|
this.emitter = callbacks;
|
12789
12792
|
this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
|
12790
12793
|
this.playground$ = new valueEnhancer.Val(void 0);
|
@@ -12800,7 +12803,7 @@
|
|
12800
12803
|
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12801
12804
|
};
|
12802
12805
|
_WindowManager.displayer = context.displayer;
|
12803
|
-
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" } };
|
12804
12807
|
}
|
12805
12808
|
static mount(params) {
|
12806
12809
|
return __async(this, null, function* () {
|