@instructure/studio-player 1.3.2 → 1.3.3
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/studio-player.es.js +339 -339
- package/dist/{vidstack-B8iikcPv.js → vidstack-CX-SWm4x.js} +10 -10
- package/dist/{vidstack-audio-Bq1pJf-F.js → vidstack-audio-Bd4Zsj4O.js} +2 -2
- package/dist/{vidstack-dash-Bi8vMZlt.js → vidstack-dash-D7xlwNJ9.js} +2 -2
- package/dist/{vidstack-google-cast-D3ys_R-E.js → vidstack-google-cast-DxqRtIco.js} +1 -1
- package/dist/{vidstack-hls-BytcbBHn.js → vidstack-hls-DVErTQIN.js} +2 -2
- package/dist/{vidstack-html-BpBnqulz.js → vidstack-html-B5QcGPQk.js} +1 -1
- package/dist/{vidstack-video-CqIaj_35.js → vidstack-video-DpYthusy.js} +2 -2
- package/dist/{vidstack-vimeo-B9SDrle5.js → vidstack-vimeo-Z3RDzI6N.js} +1 -1
- package/dist/{vidstack-youtube-Dgmpq-MT.js → vidstack-youtube-y1PQLbV7.js} +96 -92
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ var y = (n, e, t) => Qw(n, typeof e != "symbol" ? e + "" : e, t), cl = (n, e, t)
|
|
|
7
7
|
var s = (n, e, t) => (cl(n, e, "read from private field"), t ? t.call(n) : e.get(n)), c = (n, e, t) => e.has(n) ? zu("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), u = (n, e, t, i) => (cl(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t), a = (n, e, t) => (cl(n, e, "access private method"), t);
|
|
8
8
|
import { jsx as N, Fragment as zw, jsxs as Jr } from "react/jsx-runtime";
|
|
9
9
|
import * as $ from "react";
|
|
10
|
-
import { g as Yw, a as Xw, i as Yu, h as Jw, b as Zw, c as tT, d as eT, e as iT, f as sT } from "./vidstack-google-cast-
|
|
10
|
+
import { g as Yw, a as Xw, i as Yu, h as Jw, b as Zw, c as tT, d as eT, e as iT, f as sT } from "./vidstack-google-cast-DxqRtIco.js";
|
|
11
11
|
const li = Symbol(0);
|
|
12
12
|
let mh = !1, $l = !1, Qe = null, Qn = null, Ae = null, ye = 0, jn = [], $u = {};
|
|
13
13
|
const nT = () => {
|
|
@@ -2992,7 +2992,7 @@ class G$ {
|
|
|
2992
2992
|
return "audio";
|
|
2993
2993
|
}
|
|
2994
2994
|
async load(e) {
|
|
2995
|
-
return new (await import("./vidstack-audio-
|
|
2995
|
+
return new (await import("./vidstack-audio-Bd4Zsj4O.js")).AudioProvider(this.target, e);
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
2998
|
class Du {
|
|
@@ -3007,7 +3007,7 @@ class Du {
|
|
|
3007
3007
|
return "video";
|
|
3008
3008
|
}
|
|
3009
3009
|
async load(e) {
|
|
3010
|
-
return new (await import("./vidstack-video-
|
|
3010
|
+
return new (await import("./vidstack-video-DpYthusy.js")).VideoProvider(this.target, e);
|
|
3011
3011
|
}
|
|
3012
3012
|
}
|
|
3013
3013
|
const Mh = class Mh extends Du {
|
|
@@ -3019,7 +3019,7 @@ const Mh = class Mh extends Du {
|
|
|
3019
3019
|
return Mh.supported && ca(t);
|
|
3020
3020
|
}
|
|
3021
3021
|
async load(t) {
|
|
3022
|
-
return new (await import("./vidstack-hls-
|
|
3022
|
+
return new (await import("./vidstack-hls-DVErTQIN.js")).HLSProvider(this.target, t);
|
|
3023
3023
|
}
|
|
3024
3024
|
};
|
|
3025
3025
|
y(Mh, "supported", Mu());
|
|
@@ -3843,7 +3843,7 @@ const qh = class qh extends Du {
|
|
|
3843
3843
|
return qh.supported && Lu(t);
|
|
3844
3844
|
}
|
|
3845
3845
|
async load(t) {
|
|
3846
|
-
return new (await import("./vidstack-dash-
|
|
3846
|
+
return new (await import("./vidstack-dash-D7xlwNJ9.js")).DASHProvider(this.target, t);
|
|
3847
3847
|
}
|
|
3848
3848
|
};
|
|
3849
3849
|
y(qh, "supported", FT());
|
|
@@ -3869,10 +3869,10 @@ class av {
|
|
|
3869
3869
|
return "video";
|
|
3870
3870
|
}
|
|
3871
3871
|
async load(e) {
|
|
3872
|
-
return new (await import("./vidstack-vimeo-
|
|
3872
|
+
return new (await import("./vidstack-vimeo-Z3RDzI6N.js").then((t) => t.p)).VimeoProvider(this.target, e);
|
|
3873
3873
|
}
|
|
3874
3874
|
async loadPoster(e, t, i) {
|
|
3875
|
-
const { resolveVimeoVideoId: r, getVimeoVideoInfo: o } = await import("./vidstack-vimeo-
|
|
3875
|
+
const { resolveVimeoVideoId: r, getVimeoVideoInfo: o } = await import("./vidstack-vimeo-Z3RDzI6N.js").then((d) => d.u);
|
|
3876
3876
|
if (!R(e.src)) return null;
|
|
3877
3877
|
const { videoId: h, hash: l } = r(e.src);
|
|
3878
3878
|
return h ? o(h, i, l).then((d) => d ? d.poster : null) : null;
|
|
@@ -3903,10 +3903,10 @@ class ov {
|
|
|
3903
3903
|
return "video";
|
|
3904
3904
|
}
|
|
3905
3905
|
async load(e) {
|
|
3906
|
-
return new (await import("./vidstack-youtube-
|
|
3906
|
+
return new (await import("./vidstack-youtube-y1PQLbV7.js").then((t) => t.p)).YouTubeProvider(this.target, e);
|
|
3907
3907
|
}
|
|
3908
3908
|
async loadPoster(e, t, i) {
|
|
3909
|
-
const { findYouTubePoster: r, resolveYouTubeVideoId: o } = await import("./vidstack-youtube-
|
|
3909
|
+
const { findYouTubePoster: r, resolveYouTubeVideoId: o } = await import("./vidstack-youtube-y1PQLbV7.js").then((l) => l.u), h = R(e.src) && o(e.src);
|
|
3910
3910
|
return h ? r(h, i) : null;
|
|
3911
3911
|
}
|
|
3912
3912
|
}
|
|
@@ -9541,7 +9541,7 @@ class Mk {
|
|
|
9541
9541
|
async load(e) {
|
|
9542
9542
|
if (!s(this, Rs))
|
|
9543
9543
|
throw Error("[vidstack] google cast player was not initialized");
|
|
9544
|
-
return new (await import("./vidstack-google-cast-
|
|
9544
|
+
return new (await import("./vidstack-google-cast-DxqRtIco.js").then((t) => t.p)).GoogleCastProvider(s(this, Rs), e);
|
|
9545
9545
|
}
|
|
9546
9546
|
}
|
|
9547
9547
|
Rs = new WeakMap(), Yt = new WeakSet(), _w = async function(e) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var o = Object.defineProperty;
|
|
2
2
|
var a = (i, e, t) => e in i ? o(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var r = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { s as p, H as d } from "./vidstack-
|
|
5
|
-
import { H as u } from "./vidstack-html-
|
|
4
|
+
import { s as p, H as d } from "./vidstack-CX-SWm4x.js";
|
|
5
|
+
import { H as u } from "./vidstack-html-B5QcGPQk.js";
|
|
6
6
|
class n extends u {
|
|
7
7
|
constructor(t, s) {
|
|
8
8
|
super(t, s);
|
|
@@ -5,8 +5,8 @@ var u = (e) => {
|
|
|
5
5
|
var g = (e, s, t) => s in e ? S(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
6
|
var h = (e, s, t) => g(e, typeof s != "symbol" ? s + "" : s, t), d = (e, s, t) => s.has(e) || u("Cannot " + t);
|
|
7
7
|
var i = (e, s, t) => (d(e, s, "read from private field"), t ? t.call(e) : s.get(e)), a = (e, s, t) => s.has(e) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), p = (e, s, t, n) => (d(e, s, "write to private field"), n ? n.call(e, t) : s.set(e, t), t);
|
|
8
|
-
import { D as f, i as m, a as l, p as y, b as D, c as x } from "./vidstack-
|
|
9
|
-
import { VideoProvider as v } from "./vidstack-video-
|
|
8
|
+
import { D as f, i as m, a as l, p as y, b as D, c as x } from "./vidstack-CX-SWm4x.js";
|
|
9
|
+
import { VideoProvider as v } from "./vidstack-video-DpYthusy.js";
|
|
10
10
|
const $ = "https://cdn.jsdelivr.net";
|
|
11
11
|
var c, r, o;
|
|
12
12
|
class b extends v {
|
|
@@ -5,7 +5,7 @@ var U = (r) => {
|
|
|
5
5
|
var ct = (r, t, s) => t in r ? ht(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s;
|
|
6
6
|
var _ = (r, t, s) => ct(r, typeof t != "symbol" ? t + "" : t, s), D = (r, t, s) => t.has(r) || U("Cannot " + s);
|
|
7
7
|
var e = (r, t, s) => (D(r, t, "read from private field"), s ? s.call(r) : t.get(r)), d = (r, t, s) => t.has(r) ? U("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), u = (r, t, s, n) => (D(r, t, "write to private field"), n ? n.call(r, s) : t.set(r, s), s), a = (r, t, s) => (D(r, t, "access private method"), s);
|
|
8
|
-
import { l as ut, d as dt, T as E, R as lt, G as ft, k as F, o as mt, e as x, c as I, f as gt } from "./vidstack-
|
|
8
|
+
import { l as ut, d as dt, T as E, R as lt, G as ft, k as F, o as mt, e as x, c as I, f as gt } from "./vidstack-CX-SWm4x.js";
|
|
9
9
|
function Tt() {
|
|
10
10
|
return "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
|
|
11
11
|
}
|
|
@@ -5,8 +5,8 @@ var u = (e) => {
|
|
|
5
5
|
var g = (e, s, t) => s in e ? S(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
6
|
var a = (e, s, t) => g(e, typeof s != "symbol" ? s + "" : s, t), d = (e, s, t) => s.has(e) || u("Cannot " + t);
|
|
7
7
|
var i = (e, s, t) => (d(e, s, "read from private field"), t ? t.call(e) : s.get(e)), h = (e, s, t) => s.has(e) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), p = (e, s, t, n) => (d(e, s, "write to private field"), n ? n.call(e, t) : s.set(e, t), t);
|
|
8
|
-
import { g as f, h as m, a as l, p as y, j as L, c as x } from "./vidstack-
|
|
9
|
-
import { VideoProvider as v } from "./vidstack-video-
|
|
8
|
+
import { g as f, h as m, a as l, p as y, j as L, c as x } from "./vidstack-CX-SWm4x.js";
|
|
9
|
+
import { VideoProvider as v } from "./vidstack-video-DpYthusy.js";
|
|
10
10
|
const $ = "https://cdn.jsdelivr.net";
|
|
11
11
|
var c, r, o;
|
|
12
12
|
class j extends v {
|
|
@@ -6,7 +6,7 @@ var p = (i, e, t) => e in i ? l(i, e, { enumerable: !0, configurable: !0, writab
|
|
|
6
6
|
var d = (i, e, t) => p(i, typeof e != "symbol" ? e + "" : e, t), S = (i, e, t) => e.has(i) || m("Cannot " + t);
|
|
7
7
|
var h = (i, e, t) => e.has(i) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t);
|
|
8
8
|
var n = (i, e, t) => (S(i, e, "access private method"), t);
|
|
9
|
-
import { A as y, d as v, m as f, N as T, o as b, n as c, q as $, a as M } from "./vidstack-
|
|
9
|
+
import { A as y, d as v, m as f, N as T, o as b, n as c, q as $, a as M } from "./vidstack-CX-SWm4x.js";
|
|
10
10
|
var r, u;
|
|
11
11
|
class g {
|
|
12
12
|
constructor(e, t) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var n = Object.defineProperty;
|
|
2
2
|
var o = (s, t, e) => t in s ? n(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
3
|
var i = (s, t, e) => o(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { s as c, H as u, r as P, V as p, F as d, P as h, t as l, u as f, v as V, w as y, o as I } from "./vidstack-
|
|
5
|
-
import { H as v } from "./vidstack-html-
|
|
4
|
+
import { s as c, H as u, r as P, V as p, F as d, P as h, t as l, u as f, v as V, w as y, o as I } from "./vidstack-CX-SWm4x.js";
|
|
5
|
+
import { H as v } from "./vidstack-html-B5QcGPQk.js";
|
|
6
6
|
class m extends v {
|
|
7
7
|
constructor(e, r) {
|
|
8
8
|
super(e, r);
|
|
@@ -5,7 +5,7 @@ var W = (a) => {
|
|
|
5
5
|
var ke = (a, c, e) => c in a ? me(a, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[c] = e;
|
|
6
6
|
var b = (a, c, e) => ke(a, typeof c != "symbol" ? c + "" : c, e), j = (a, c, e) => c.has(a) || W("Cannot " + e);
|
|
7
7
|
var s = (a, c, e) => (j(a, c, "read from private field"), e ? e.call(a) : c.get(a)), d = (a, c, e) => c.has(a) ? W("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(a) : c.set(a, e), f = (a, c, e, t) => (j(a, c, "write to private field"), t ? t.call(a, e) : c.set(a, e), e), h = (a, c, e) => (j(a, c, "access private method"), e);
|
|
8
|
-
import { E as ve, d as we, x as Y, T as g, R as Te, p as Pe, y as x, c as A, a as Ce, z as G, L as M, l as $e, B as ge, C as Ee, I as Re, Q as J } from "./vidstack-
|
|
8
|
+
import { E as ve, d as we, x as Y, T as g, R as Te, p as Pe, y as x, c as A, a as Ce, z as G, L as M, l as $e, B as ge, C as Ee, I as Re, Q as J } from "./vidstack-CX-SWm4x.js";
|
|
9
9
|
const Ve = /(?:https:\/\/)?(?:player\.)?vimeo(?:\.com)?\/(?:video\/)?(\d+)(?:(?:\?hash=|\?h=|\/)(.*))?/, O = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
|
|
10
10
|
function K(a) {
|
|
11
11
|
const c = a.match(Ve);
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
var Q = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var z = (a) => {
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var W = (a,
|
|
6
|
-
var
|
|
7
|
-
var s = (a,
|
|
8
|
-
import { E as X, d as Z, x as ee, p as te, y as se, a as ie, J as ae, z as
|
|
9
|
-
const ue = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/, Y = /* @__PURE__ */ new Map(),
|
|
10
|
-
function
|
|
11
|
-
var
|
|
12
|
-
return (
|
|
5
|
+
var W = (a, n, e) => n in a ? Q(a, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[n] = e;
|
|
6
|
+
var m = (a, n, e) => W(a, typeof n != "symbol" ? n + "" : n, e), E = (a, n, e) => n.has(a) || z("Cannot " + e);
|
|
7
|
+
var s = (a, n, e) => (E(a, n, "read from private field"), e ? e.call(a) : n.get(a)), p = (a, n, e) => n.has(a) ? z("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, e), c = (a, n, e, t) => (E(a, n, "write to private field"), t ? t.call(a, e) : n.set(a, e), e), r = (a, n, e) => (E(a, n, "access private method"), e);
|
|
8
|
+
import { E as X, d as Z, x as ee, p as te, y as se, a as ie, J as ae, z as oe, Y as k, K as ne, M as _, T as j, O as re } from "./vidstack-CX-SWm4x.js";
|
|
9
|
+
const ue = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/, Y = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
|
|
10
|
+
function B(a) {
|
|
11
|
+
var n;
|
|
12
|
+
return (n = a.match(ue)) == null ? void 0 : n[1];
|
|
13
13
|
}
|
|
14
|
-
async function de(a,
|
|
14
|
+
async function de(a, n) {
|
|
15
15
|
if (Y.has(a)) return Y.get(a);
|
|
16
|
-
if (
|
|
16
|
+
if (R.has(a)) return R.get(a);
|
|
17
17
|
const e = new Promise(async (t) => {
|
|
18
18
|
const u = ["maxresdefault", "sddefault", "hqdefault"];
|
|
19
19
|
for (const d of u)
|
|
20
20
|
for (const h of [!0, !1]) {
|
|
21
|
-
const
|
|
22
|
-
if ((await fetch(
|
|
21
|
+
const l = he(a, d, h);
|
|
22
|
+
if ((await fetch(l, {
|
|
23
23
|
mode: "no-cors",
|
|
24
|
-
signal:
|
|
24
|
+
signal: n.signal
|
|
25
25
|
})).status < 400) {
|
|
26
|
-
Y.set(a,
|
|
26
|
+
Y.set(a, l), t(l);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
}).catch(() => "").finally(() =>
|
|
31
|
-
return
|
|
30
|
+
}).catch(() => "").finally(() => R.delete(a));
|
|
31
|
+
return R.set(a, e), e;
|
|
32
32
|
}
|
|
33
|
-
function he(a,
|
|
34
|
-
return `https://i.ytimg.com/${e ? "vi_webp" : "vi"}/${a}/${
|
|
33
|
+
function he(a, n, e) {
|
|
34
|
+
return `https://i.ytimg.com/${e ? "vi_webp" : "vi"}/${a}/${n}.${e ? "webp" : "jpg"}`;
|
|
35
35
|
}
|
|
36
36
|
const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
37
37
|
__proto__: null,
|
|
38
38
|
findYouTubePoster: de,
|
|
39
|
-
resolveYouTubeVideoId:
|
|
39
|
+
resolveYouTubeVideoId: B
|
|
40
40
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
41
|
-
var
|
|
42
|
-
class
|
|
41
|
+
var o, g, P, S, C, T, w, y, O, i, ce, pe, F, U, b, I, J, N, D, V, q, K, L, M, A;
|
|
42
|
+
class le extends X {
|
|
43
43
|
constructor(e, t) {
|
|
44
44
|
super(e);
|
|
45
45
|
p(this, i);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
p(this,
|
|
49
|
-
p(this,
|
|
46
|
+
m(this, "$$PROVIDER_TYPE", "YOUTUBE");
|
|
47
|
+
m(this, "scope", Z());
|
|
48
|
+
p(this, o);
|
|
49
|
+
p(this, g, ee(""));
|
|
50
50
|
p(this, P, -1);
|
|
51
51
|
p(this, S, null);
|
|
52
|
-
p(this,
|
|
52
|
+
p(this, C, null);
|
|
53
53
|
p(this, T, -1);
|
|
54
|
-
p(this,
|
|
54
|
+
p(this, w, !1);
|
|
55
55
|
p(this, y, /* @__PURE__ */ new Map());
|
|
56
56
|
/**
|
|
57
57
|
* Sets the player's interface language. The parameter value is an ISO 639-1 two-letter
|
|
@@ -64,29 +64,33 @@ class ce extends X {
|
|
|
64
64
|
*
|
|
65
65
|
* @defaultValue 'en'
|
|
66
66
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
m(this, "language", "en");
|
|
68
|
+
m(this, "color", "red");
|
|
69
69
|
/**
|
|
70
70
|
* Whether cookies should be enabled on the embed. This is turned off by default to be
|
|
71
71
|
* GDPR-compliant.
|
|
72
72
|
*
|
|
73
73
|
* @defaultValue `false`
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
m(this, "cookies", !1);
|
|
76
76
|
/**
|
|
77
77
|
* Whether the embed should use YouTube Education. This is turned off by default.
|
|
78
78
|
*
|
|
79
79
|
* @defaultValue `false`
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
m(this, "education", !1);
|
|
82
|
+
/**
|
|
83
|
+
* Whether the YouTube captions should be auto loaded
|
|
84
|
+
*/
|
|
85
|
+
m(this, "autoLoadCaptions", !1);
|
|
82
86
|
/**
|
|
83
87
|
* The encrypted payload to use for the embed. This is mandatory for YouTube Education
|
|
84
88
|
* to work as expected.
|
|
85
89
|
*
|
|
86
90
|
* @defaultValue `undefined`
|
|
87
91
|
*/
|
|
88
|
-
p(this,
|
|
89
|
-
|
|
92
|
+
p(this, O);
|
|
93
|
+
c(this, o, t);
|
|
90
94
|
}
|
|
91
95
|
/**
|
|
92
96
|
* Set the encrypted payload to use for the embed. It must be encrypted according to YouTube dev guide.
|
|
@@ -95,7 +99,7 @@ class ce extends X {
|
|
|
95
99
|
* @defaultValue `undefined`
|
|
96
100
|
*/
|
|
97
101
|
set encryptedPayload(e) {
|
|
98
|
-
|
|
102
|
+
c(this, O, e);
|
|
99
103
|
}
|
|
100
104
|
get currentSrc() {
|
|
101
105
|
return s(this, S);
|
|
@@ -104,46 +108,46 @@ class ce extends X {
|
|
|
104
108
|
return "youtube";
|
|
105
109
|
}
|
|
106
110
|
get videoId() {
|
|
107
|
-
return s(this,
|
|
111
|
+
return s(this, g).call(this);
|
|
108
112
|
}
|
|
109
113
|
preconnect() {
|
|
110
114
|
te(this.getOrigin());
|
|
111
115
|
}
|
|
112
116
|
setup() {
|
|
113
|
-
super.setup(), se(r(this, i,
|
|
117
|
+
super.setup(), se(r(this, i, F).bind(this)), s(this, o).notify("provider-setup", this);
|
|
114
118
|
}
|
|
115
119
|
destroy() {
|
|
116
|
-
r(this, i,
|
|
120
|
+
r(this, i, L).call(this);
|
|
117
121
|
const e = "provider destroyed";
|
|
118
122
|
for (const t of s(this, y).values())
|
|
119
123
|
for (const { reject: u } of t) u(e);
|
|
120
124
|
s(this, y).clear();
|
|
121
125
|
}
|
|
122
126
|
async play() {
|
|
123
|
-
return r(this, i,
|
|
127
|
+
return r(this, i, b).call(this, "playVideo");
|
|
124
128
|
}
|
|
125
129
|
async pause() {
|
|
126
|
-
return r(this, i,
|
|
130
|
+
return r(this, i, b).call(this, "pauseVideo");
|
|
127
131
|
}
|
|
128
132
|
setMuted(e) {
|
|
129
|
-
e ? r(this, i,
|
|
133
|
+
e ? r(this, i, b).call(this, "mute") : r(this, i, b).call(this, "unMute");
|
|
130
134
|
}
|
|
131
135
|
setCurrentTime(e) {
|
|
132
|
-
r(this, i,
|
|
136
|
+
r(this, i, b).call(this, "seekTo", e), s(this, o).notify("seeking", e);
|
|
133
137
|
}
|
|
134
138
|
setVolume(e) {
|
|
135
|
-
r(this, i,
|
|
139
|
+
r(this, i, b).call(this, "setVolume", e * 100);
|
|
136
140
|
}
|
|
137
141
|
setPlaybackRate(e) {
|
|
138
|
-
r(this, i,
|
|
142
|
+
r(this, i, b).call(this, "setPlaybackRate", e);
|
|
139
143
|
}
|
|
140
144
|
async loadSource(e) {
|
|
141
145
|
if (!ie(e.src)) {
|
|
142
|
-
|
|
146
|
+
c(this, S, null), s(this, g).set("");
|
|
143
147
|
return;
|
|
144
148
|
}
|
|
145
|
-
const t =
|
|
146
|
-
s(this,
|
|
149
|
+
const t = B(e.src);
|
|
150
|
+
s(this, g).set(t ?? ""), c(this, S, e);
|
|
147
151
|
}
|
|
148
152
|
getOrigin() {
|
|
149
153
|
switch (!0) {
|
|
@@ -156,12 +160,12 @@ class ce extends X {
|
|
|
156
160
|
}
|
|
157
161
|
}
|
|
158
162
|
buildParams() {
|
|
159
|
-
const { keyDisabled: e } = s(this,
|
|
163
|
+
const { keyDisabled: e } = s(this, o).$props, { muted: t, playsInline: u, nativeControls: d } = s(this, o).$state, h = d();
|
|
160
164
|
return {
|
|
161
165
|
rel: 0,
|
|
162
166
|
autoplay: 0,
|
|
163
167
|
color: this.color,
|
|
164
|
-
cc_load_policy: 1,
|
|
168
|
+
cc_load_policy: this.autoLoadCaptions ? 1 : void 0,
|
|
165
169
|
controls: h ? 1 : 0,
|
|
166
170
|
disablekb: !h || e() ? 1 : 0,
|
|
167
171
|
enablejsapi: 1,
|
|
@@ -170,107 +174,107 @@ class ce extends X {
|
|
|
170
174
|
iv_load_policy: h ? 1 : 3,
|
|
171
175
|
mute: t() ? 1 : 0,
|
|
172
176
|
playsinline: u() ? 1 : 0,
|
|
173
|
-
videoId: s(this,
|
|
174
|
-
embed_config: r(this, i,
|
|
177
|
+
videoId: s(this, g).call(this),
|
|
178
|
+
embed_config: r(this, i, U).call(this)
|
|
175
179
|
};
|
|
176
180
|
}
|
|
177
181
|
onLoad() {
|
|
178
182
|
window.setTimeout(() => this.postMessage({ event: "listening" }), 100);
|
|
179
183
|
}
|
|
180
184
|
onMessage({ info: e }, t) {
|
|
181
|
-
var
|
|
185
|
+
var l, $;
|
|
182
186
|
if (!e) return;
|
|
183
|
-
const { title: u, intrinsicDuration: d, playbackRate: h } = s(this,
|
|
184
|
-
if (
|
|
187
|
+
const { title: u, intrinsicDuration: d, playbackRate: h } = s(this, o).$state;
|
|
188
|
+
if (ne(e.videoData) && e.videoData.title !== u() && s(this, o).notify("title-change", e.videoData.title, t), (l = e.namespaces) != null && l.includes("captions") && e.captions && s(this, C) === null && (c(this, C, e.captions.tracklist), s(this, o).notify("loaded-metadata")), _(e.duration) && e.duration !== d()) {
|
|
185
189
|
if (_(e.videoLoadedFraction)) {
|
|
186
190
|
const f = (($ = e.progressState) == null ? void 0 : $.loaded) ?? e.videoLoadedFraction * e.duration, v = new j(0, e.duration);
|
|
187
191
|
r(this, i, D).call(this, f, v, t);
|
|
188
192
|
}
|
|
189
|
-
s(this,
|
|
193
|
+
s(this, o).notify("duration-change", e.duration, t);
|
|
190
194
|
}
|
|
191
|
-
if (_(e.playbackRate) && e.playbackRate !== h() && s(this,
|
|
192
|
-
const { current: f, seekableStart: v, seekableEnd: G, loaded: H, duration:
|
|
193
|
-
r(this, i, N).call(this, f, t), r(this, i, D).call(this, H, new j(v, G), t),
|
|
195
|
+
if (_(e.playbackRate) && e.playbackRate !== h() && s(this, o).notify("rate-change", e.playbackRate, t), e.progressState) {
|
|
196
|
+
const { current: f, seekableStart: v, seekableEnd: G, loaded: H, duration: x } = e.progressState;
|
|
197
|
+
r(this, i, N).call(this, f, t), r(this, i, D).call(this, H, new j(v, G), t), x !== d() && s(this, o).notify("duration-change", x, t);
|
|
194
198
|
}
|
|
195
|
-
if (_(e.volume) && re(e.muted) && !s(this,
|
|
199
|
+
if (_(e.volume) && re(e.muted) && !s(this, w)) {
|
|
196
200
|
const f = {
|
|
197
201
|
muted: e.muted,
|
|
198
202
|
volume: e.volume / 100
|
|
199
203
|
};
|
|
200
|
-
s(this,
|
|
204
|
+
s(this, o).notify("volume-change", f, t);
|
|
201
205
|
}
|
|
202
206
|
_(e.playerState) && e.playerState !== s(this, P) && r(this, i, K).call(this, e.playerState, t);
|
|
203
207
|
}
|
|
204
208
|
}
|
|
205
|
-
|
|
209
|
+
o = new WeakMap(), g = new WeakMap(), P = new WeakMap(), S = new WeakMap(), C = new WeakMap(), T = new WeakMap(), w = new WeakMap(), y = new WeakMap(), O = new WeakMap(), i = new WeakSet(), ce = function(e) {
|
|
206
210
|
var t;
|
|
207
211
|
(t = r(this, i, M).call(this, "playVideo")) == null || t.reject(e);
|
|
208
212
|
}, pe = function(e) {
|
|
209
213
|
var t;
|
|
210
214
|
(t = r(this, i, M).call(this, "pauseVideo")) == null || t.reject(e);
|
|
211
|
-
},
|
|
212
|
-
r(this, i,
|
|
213
|
-
const e = s(this,
|
|
215
|
+
}, F = function() {
|
|
216
|
+
r(this, i, L).call(this);
|
|
217
|
+
const e = s(this, g).call(this);
|
|
214
218
|
if (!e) {
|
|
215
219
|
this.src.set("");
|
|
216
220
|
return;
|
|
217
221
|
}
|
|
218
|
-
this.src.set(`${this.getOrigin()}/embed/${e}`), s(this,
|
|
219
|
-
},
|
|
220
|
-
const e = s(this,
|
|
222
|
+
this.src.set(`${this.getOrigin()}/embed/${e}`), s(this, o).notify("load-start");
|
|
223
|
+
}, U = function() {
|
|
224
|
+
const e = s(this, O);
|
|
221
225
|
if (!ae(e))
|
|
222
226
|
return JSON.stringify({ enc: e, hideTitle: !0 });
|
|
223
|
-
},
|
|
224
|
-
let u =
|
|
227
|
+
}, b = function(e, t) {
|
|
228
|
+
let u = oe(), d = s(this, y).get(e);
|
|
225
229
|
return d || s(this, y).set(e, d = []), d.push(u), this.postMessage({
|
|
226
230
|
event: "command",
|
|
227
231
|
func: e,
|
|
228
232
|
args: t ? [t] : void 0
|
|
229
233
|
}), u.promise;
|
|
230
234
|
}, I = function(e) {
|
|
231
|
-
s(this,
|
|
235
|
+
s(this, o).notify("loaded-data"), s(this, o).delegate.ready(void 0, e);
|
|
232
236
|
}, J = function(e) {
|
|
233
237
|
var t;
|
|
234
|
-
(t = r(this, i, M).call(this, "pauseVideo")) == null || t.resolve(), s(this,
|
|
238
|
+
(t = r(this, i, M).call(this, "pauseVideo")) == null || t.resolve(), s(this, o).notify("pause", void 0, e);
|
|
235
239
|
}, N = function(e, t) {
|
|
236
|
-
const { duration: u, realCurrentTime: d } = s(this,
|
|
237
|
-
s(this,
|
|
240
|
+
const { duration: u, realCurrentTime: d } = s(this, o).$state, h = s(this, P) === k.Ended, l = h ? u() : e;
|
|
241
|
+
s(this, o).notify("time-change", l, t), !h && Math.abs(l - d()) > 1 && s(this, o).notify("seeking", l, t);
|
|
238
242
|
}, D = function(e, t, u) {
|
|
239
243
|
const d = {
|
|
240
244
|
buffered: new j(0, e),
|
|
241
245
|
seekable: t
|
|
242
246
|
};
|
|
243
|
-
s(this,
|
|
244
|
-
const { seeking: h, realCurrentTime:
|
|
245
|
-
h() && e >
|
|
246
|
-
},
|
|
247
|
-
const { paused: t, realCurrentTime: u } = s(this,
|
|
248
|
-
window.clearTimeout(s(this, T)),
|
|
247
|
+
s(this, o).notify("progress", d, u);
|
|
248
|
+
const { seeking: h, realCurrentTime: l } = s(this, o).$state;
|
|
249
|
+
h() && e > l() && r(this, i, V).call(this, u);
|
|
250
|
+
}, V = function(e) {
|
|
251
|
+
const { paused: t, realCurrentTime: u } = s(this, o).$state;
|
|
252
|
+
window.clearTimeout(s(this, T)), c(this, T, window.setTimeout(
|
|
249
253
|
() => {
|
|
250
|
-
s(this,
|
|
254
|
+
s(this, o).notify("seeked", u(), e), c(this, T, -1);
|
|
251
255
|
},
|
|
252
256
|
t() ? 100 : 0
|
|
253
257
|
));
|
|
254
258
|
}, q = function(e) {
|
|
255
|
-
const { seeking: t } = s(this,
|
|
256
|
-
t() && r(this, i,
|
|
259
|
+
const { seeking: t } = s(this, o).$state;
|
|
260
|
+
t() && r(this, i, V).call(this, e), s(this, o).notify("pause", void 0, e), s(this, o).notify("end", void 0, e);
|
|
257
261
|
}, K = function(e, t) {
|
|
258
262
|
var v;
|
|
259
|
-
const { paused: u, seeking: d } = s(this,
|
|
260
|
-
if (
|
|
261
|
-
this.pause(),
|
|
263
|
+
const { paused: u, seeking: d } = s(this, o).$state, h = e === k.Playing, l = e === k.Buffering, $ = r(this, i, A).call(this, "playVideo"), f = u() && (l || h);
|
|
264
|
+
if (l && s(this, o).notify("waiting", void 0, t), d() && h && r(this, i, V).call(this, t), s(this, w) && h) {
|
|
265
|
+
this.pause(), c(this, w, !1), this.setMuted(s(this, o).$state.muted());
|
|
262
266
|
return;
|
|
263
267
|
}
|
|
264
268
|
if (!$ && f) {
|
|
265
|
-
|
|
269
|
+
c(this, w, !0), this.setMuted(!0);
|
|
266
270
|
return;
|
|
267
271
|
}
|
|
268
|
-
switch (f && ((v = r(this, i, M).call(this, "playVideo")) == null || v.resolve(), s(this,
|
|
272
|
+
switch (f && ((v = r(this, i, M).call(this, "playVideo")) == null || v.resolve(), s(this, o).notify("play", void 0, t)), e) {
|
|
269
273
|
case k.Cued:
|
|
270
274
|
r(this, i, I).call(this, t);
|
|
271
275
|
break;
|
|
272
276
|
case k.Playing:
|
|
273
|
-
s(this,
|
|
277
|
+
s(this, o).notify("playing", void 0, t);
|
|
274
278
|
break;
|
|
275
279
|
case k.Paused:
|
|
276
280
|
r(this, i, J).call(this, t);
|
|
@@ -279,9 +283,9 @@ n = new WeakMap(), b = new WeakMap(), P = new WeakMap(), S = new WeakMap(), O =
|
|
|
279
283
|
r(this, i, q).call(this, t);
|
|
280
284
|
break;
|
|
281
285
|
}
|
|
282
|
-
|
|
283
|
-
},
|
|
284
|
-
|
|
286
|
+
c(this, P, e);
|
|
287
|
+
}, L = function() {
|
|
288
|
+
c(this, P, -1), c(this, T, -1), c(this, w, !1);
|
|
285
289
|
}, M = function(e) {
|
|
286
290
|
var t;
|
|
287
291
|
return (t = s(this, y).get(e)) == null ? void 0 : t.shift();
|
|
@@ -291,7 +295,7 @@ n = new WeakMap(), b = new WeakMap(), P = new WeakMap(), S = new WeakMap(), O =
|
|
|
291
295
|
};
|
|
292
296
|
const be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
293
297
|
__proto__: null,
|
|
294
|
-
YouTubeProvider:
|
|
298
|
+
YouTubeProvider: le
|
|
295
299
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
296
300
|
export {
|
|
297
301
|
be as p,
|