@instructure/studio-player 0.1.1
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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/StudioPlayer/StudioPlayer.d.ts +10 -0
- package/dist/StudioPlayer/StudioPlayerContext.d.ts +11 -0
- package/dist/StudioPlayer/components/BufferingIndicator/BufferingIndicator.d.ts +1 -0
- package/dist/StudioPlayer/components/CaptionsButton/CaptionsButton.d.ts +1 -0
- package/dist/StudioPlayer/components/CaptionsOverlay/CaptionsOverlay.d.ts +5 -0
- package/dist/StudioPlayer/components/ControlsLayout/ControlsLayout.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/CustomSettingsMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/CustomSettingsMenuContext.d.ts +8 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/CaptionsMenu/CaptionsFontSizeMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/CaptionsMenu/CaptionsLanguageMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/CaptionsMenu/CaptionsMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/MainMenu/MainMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/QualityMenu/QualityMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/SpeedMenu/SpeedMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/BaseButton.d.ts +8 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/CaptionsButton.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/CaptionsFontSizeButton.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/CaptionsLanguageButton.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/QualityButton.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/SpeedButton.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/useCallbackOnEsc.d.ts +1 -0
- package/dist/StudioPlayer/components/CustomSettingsMenu/useCustomSettingsMenu.d.ts +18 -0
- package/dist/StudioPlayer/components/FeedbackOverlay/FeedbackIcon.d.ts +1 -0
- package/dist/StudioPlayer/components/FeedbackOverlay/FeedbackMessage.d.ts +1 -0
- package/dist/StudioPlayer/components/FeedbackOverlay/FeedbackOverlay.d.ts +1 -0
- package/dist/StudioPlayer/components/FeedbackOverlay/createFeedbackComponent.d.ts +1 -0
- package/dist/StudioPlayer/components/FullscreenButton/FullscreenButton.d.ts +1 -0
- package/dist/StudioPlayer/components/GesturesContainer/GesturesContainer.d.ts +1 -0
- package/dist/StudioPlayer/components/PlayPauseButton/PlayPauseButton.d.ts +1 -0
- package/dist/StudioPlayer/components/PosterContainer/PosterContainer.d.ts +4 -0
- package/dist/StudioPlayer/components/SmallLayoutOverlay/SmallLayoutOverlay.d.ts +1 -0
- package/dist/StudioPlayer/components/TimeIndicator/TimeIndicator.d.ts +1 -0
- package/dist/StudioPlayer/components/TimeLine/TimeLine.d.ts +4 -0
- package/dist/StudioPlayer/components/VolumeMenu/VolumeMenu.d.ts +1 -0
- package/dist/StudioPlayer/components/index.d.ts +14 -0
- package/dist/StudioPlayer/shortcuts.d.ts +2 -0
- package/dist/constants.d.ts +5 -0
- package/dist/errors-DCJKAXTz.js +70 -0
- package/dist/index-BM9a_WKH.js +33480 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/prod-DTLJXtPo.js +994 -0
- package/dist/srt-parser-CWqahKwO.js +27 -0
- package/dist/ssa-parser-BqjjKy4M.js +209 -0
- package/dist/studio-player.es.js +6 -0
- package/dist/types.d.ts +6 -0
- package/dist/vidstack-B-YW57m0-DZMwUKSQ.js +140 -0
- package/dist/vidstack-BFbyAy5g-DqVWIlTG.js +378 -0
- package/dist/vidstack-BGEqnOoX-BiZsT73r.js +434 -0
- package/dist/vidstack-CC0Rsbn0-Cf76Gp3K.js +32 -0
- package/dist/vidstack-CbSFenOv-DX2VhxT6.js +60 -0
- package/dist/vidstack-D2cUZes0-BnrvKkrf.js +237 -0
- package/dist/vidstack-Xu8hy52p-DHV2kI-e.js +323 -0
- package/dist/vidstack-Zc3I7oOd-DDsBgkhs.js +31 -0
- package/dist/vidstack-krOAtKMi-B4IZWKdc.js +29 -0
- package/package.json +78 -0
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var N = (r) => {
|
|
3
|
+
throw TypeError(r);
|
|
4
|
+
};
|
|
5
|
+
var de = (r, c, e) => c in r ? ue(r, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[c] = e;
|
|
6
|
+
var b = (r, c, e) => de(r, typeof c != "symbol" ? c + "" : c, e), M = (r, c, e) => c.has(r) || N("Cannot " + e);
|
|
7
|
+
var t = (r, c, e) => (M(r, c, "read from private field"), e ? e.call(r) : c.get(r)), f = (r, c, e) => c.has(r) ? N("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(r) : c.set(r, e), u = (r, c, e, i) => (M(r, c, "write to private field"), i ? i.call(r, e) : c.set(r, e), e), o = (r, c, e) => (M(r, c, "access private method"), e);
|
|
8
|
+
import { m as fe, n as U, o as C, R as pe, p as ye, e as S, c as Q, b as be, q as _, L as R, l as ke, r as ve, T as me, Q as W } from "./index-BM9a_WKH.js";
|
|
9
|
+
import { E as we } from "./vidstack-CbSFenOv-DX2VhxT6.js";
|
|
10
|
+
import { resolveVimeoVideoId as Pe, getVimeoVideoInfo as Te } from "./vidstack-krOAtKMi-B4IZWKdc.js";
|
|
11
|
+
import "react";
|
|
12
|
+
const Ce = [
|
|
13
|
+
"bufferend",
|
|
14
|
+
"bufferstart",
|
|
15
|
+
// 'cuechange',
|
|
16
|
+
"durationchange",
|
|
17
|
+
"ended",
|
|
18
|
+
"enterpictureinpicture",
|
|
19
|
+
"error",
|
|
20
|
+
"fullscreenchange",
|
|
21
|
+
"leavepictureinpicture",
|
|
22
|
+
"loaded",
|
|
23
|
+
// 'loadeddata',
|
|
24
|
+
// 'loadedmetadata',
|
|
25
|
+
// 'loadstart',
|
|
26
|
+
"playProgress",
|
|
27
|
+
"loadProgress",
|
|
28
|
+
"pause",
|
|
29
|
+
"play",
|
|
30
|
+
"playbackratechange",
|
|
31
|
+
// 'progress',
|
|
32
|
+
"qualitychange",
|
|
33
|
+
"seeked",
|
|
34
|
+
"seeking",
|
|
35
|
+
// 'texttrackchange',
|
|
36
|
+
"timeupdate",
|
|
37
|
+
"volumechange",
|
|
38
|
+
"waiting"
|
|
39
|
+
// 'adstarted',
|
|
40
|
+
// 'adcompleted',
|
|
41
|
+
// 'aderror',
|
|
42
|
+
// 'adskipped',
|
|
43
|
+
// 'adallcompleted',
|
|
44
|
+
// 'adclicked',
|
|
45
|
+
// 'chapterchange',
|
|
46
|
+
// 'chromecastconnected',
|
|
47
|
+
// 'remoteplaybackavailabilitychange',
|
|
48
|
+
// 'remoteplaybackconnecting',
|
|
49
|
+
// 'remoteplaybackconnect',
|
|
50
|
+
// 'remoteplaybackdisconnect',
|
|
51
|
+
// 'liveeventended',
|
|
52
|
+
// 'liveeventstarted',
|
|
53
|
+
// 'livestreamoffline',
|
|
54
|
+
// 'livestreamonline',
|
|
55
|
+
];
|
|
56
|
+
var a, y, k, w, g, V, v, $, q, P, m, E, s, Y, z, G, H, T, J, K, X, L, Z, ee, te, se, ie, x, ne, ae, oe, F, he, O, re, D, ce, le, l, j, B;
|
|
57
|
+
class Re extends we {
|
|
58
|
+
constructor(e, i) {
|
|
59
|
+
super(e);
|
|
60
|
+
f(this, s);
|
|
61
|
+
b(this, "$$PROVIDER_TYPE", "VIMEO");
|
|
62
|
+
b(this, "scope", fe());
|
|
63
|
+
b(this, "fullscreen");
|
|
64
|
+
f(this, a);
|
|
65
|
+
f(this, y, U(""));
|
|
66
|
+
f(this, k, U(!1));
|
|
67
|
+
f(this, w, null);
|
|
68
|
+
f(this, g, null);
|
|
69
|
+
f(this, V, !1);
|
|
70
|
+
f(this, v, new C(0, 0));
|
|
71
|
+
f(this, $, new pe(o(this, s, H).bind(this)));
|
|
72
|
+
f(this, q, null);
|
|
73
|
+
f(this, P, null);
|
|
74
|
+
f(this, m, /* @__PURE__ */ new Map());
|
|
75
|
+
f(this, E, null);
|
|
76
|
+
/**
|
|
77
|
+
* Whether tracking session data should be enabled on the embed, including cookies and analytics.
|
|
78
|
+
* This is turned off by default to be GDPR-compliant.
|
|
79
|
+
*
|
|
80
|
+
* @defaultValue `false`
|
|
81
|
+
*/
|
|
82
|
+
b(this, "cookies", !1);
|
|
83
|
+
b(this, "title", !0);
|
|
84
|
+
b(this, "byline", !0);
|
|
85
|
+
b(this, "portrait", !0);
|
|
86
|
+
b(this, "color", "00ADEF");
|
|
87
|
+
// Embed will sometimes dispatch 0 at end of playback.
|
|
88
|
+
f(this, T, !1);
|
|
89
|
+
u(this, a, i);
|
|
90
|
+
const n = this;
|
|
91
|
+
this.fullscreen = {
|
|
92
|
+
get active() {
|
|
93
|
+
return t(n, V);
|
|
94
|
+
},
|
|
95
|
+
supported: !0,
|
|
96
|
+
enter: () => o(this, s, l).call(this, "requestFullscreen"),
|
|
97
|
+
exit: () => o(this, s, l).call(this, "exitFullscreen")
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
get type() {
|
|
101
|
+
return "vimeo";
|
|
102
|
+
}
|
|
103
|
+
get currentSrc() {
|
|
104
|
+
return t(this, g);
|
|
105
|
+
}
|
|
106
|
+
get videoId() {
|
|
107
|
+
return t(this, y).call(this);
|
|
108
|
+
}
|
|
109
|
+
get hash() {
|
|
110
|
+
return t(this, w);
|
|
111
|
+
}
|
|
112
|
+
get isPro() {
|
|
113
|
+
return t(this, k).call(this);
|
|
114
|
+
}
|
|
115
|
+
preconnect() {
|
|
116
|
+
ye(this.getOrigin());
|
|
117
|
+
}
|
|
118
|
+
setup() {
|
|
119
|
+
super.setup(), S(o(this, s, Y).bind(this)), S(o(this, s, z).bind(this)), S(o(this, s, G).bind(this)), t(this, a).notify("provider-setup", this);
|
|
120
|
+
}
|
|
121
|
+
destroy() {
|
|
122
|
+
o(this, s, j).call(this), this.fullscreen = void 0;
|
|
123
|
+
const e = "provider destroyed";
|
|
124
|
+
for (const i of t(this, m).values())
|
|
125
|
+
for (const { reject: n } of i) n(e);
|
|
126
|
+
t(this, m).clear(), o(this, s, l).call(this, "destroy");
|
|
127
|
+
}
|
|
128
|
+
async play() {
|
|
129
|
+
return o(this, s, l).call(this, "play");
|
|
130
|
+
}
|
|
131
|
+
async pause() {
|
|
132
|
+
return o(this, s, l).call(this, "pause");
|
|
133
|
+
}
|
|
134
|
+
setMuted(e) {
|
|
135
|
+
o(this, s, l).call(this, "setMuted", e);
|
|
136
|
+
}
|
|
137
|
+
setCurrentTime(e) {
|
|
138
|
+
o(this, s, l).call(this, "seekTo", e), t(this, a).notify("seeking", e);
|
|
139
|
+
}
|
|
140
|
+
setVolume(e) {
|
|
141
|
+
o(this, s, l).call(this, "setVolume", e), o(this, s, l).call(this, "setMuted", Q(t(this, a).$state.muted));
|
|
142
|
+
}
|
|
143
|
+
setPlaybackRate(e) {
|
|
144
|
+
o(this, s, l).call(this, "setPlaybackRate", e);
|
|
145
|
+
}
|
|
146
|
+
async loadSource(e) {
|
|
147
|
+
if (!be(e.src)) {
|
|
148
|
+
u(this, g, null), u(this, w, null), t(this, y).set("");
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const { videoId: i, hash: n } = Pe(e.src);
|
|
152
|
+
t(this, y).set(i ?? ""), u(this, w, n ?? null), u(this, g, e);
|
|
153
|
+
}
|
|
154
|
+
getOrigin() {
|
|
155
|
+
return "https://player.vimeo.com";
|
|
156
|
+
}
|
|
157
|
+
buildParams() {
|
|
158
|
+
const { keyDisabled: e } = t(this, a).$props, { playsInline: i, nativeControls: n } = t(this, a).$state, h = n();
|
|
159
|
+
return {
|
|
160
|
+
title: this.title,
|
|
161
|
+
byline: this.byline,
|
|
162
|
+
color: this.color,
|
|
163
|
+
portrait: this.portrait,
|
|
164
|
+
controls: h,
|
|
165
|
+
h: this.hash,
|
|
166
|
+
keyboard: h && !e(),
|
|
167
|
+
transparent: !0,
|
|
168
|
+
playsinline: i(),
|
|
169
|
+
dnt: !this.cookies
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
onMessage(e, i) {
|
|
173
|
+
e.event ? o(this, s, ce).call(this, e.event, e.data, i) : e.method && o(this, s, Z).call(this, e.method, e.value, i);
|
|
174
|
+
}
|
|
175
|
+
onLoad() {
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
a = new WeakMap(), y = new WeakMap(), k = new WeakMap(), w = new WeakMap(), g = new WeakMap(), V = new WeakMap(), v = new WeakMap(), $ = new WeakMap(), q = new WeakMap(), P = new WeakMap(), m = new WeakMap(), E = new WeakMap(), s = new WeakSet(), Y = function() {
|
|
179
|
+
o(this, s, j).call(this);
|
|
180
|
+
const e = t(this, y).call(this);
|
|
181
|
+
if (!e) {
|
|
182
|
+
this.src.set("");
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.src.set(`${this.getOrigin()}/video/${e}`), t(this, a).notify("load-start");
|
|
186
|
+
}, z = function() {
|
|
187
|
+
const e = t(this, y).call(this);
|
|
188
|
+
if (!e) return;
|
|
189
|
+
const i = _(), n = new AbortController();
|
|
190
|
+
return u(this, E, i), Te(e, n, t(this, w)).then((h) => {
|
|
191
|
+
i.resolve(h);
|
|
192
|
+
}).catch((h) => {
|
|
193
|
+
i.reject();
|
|
194
|
+
}), () => {
|
|
195
|
+
i.reject(), n.abort();
|
|
196
|
+
};
|
|
197
|
+
}, G = function() {
|
|
198
|
+
const e = t(this, k).call(this), { $state: i, qualities: n } = t(this, a);
|
|
199
|
+
if (i.canSetPlaybackRate.set(e), n[R.setReadonly](!e), e)
|
|
200
|
+
return ke(n, "change", () => {
|
|
201
|
+
var d;
|
|
202
|
+
if (n.auto) return;
|
|
203
|
+
const h = (d = n.selected) == null ? void 0 : d.id;
|
|
204
|
+
h && o(this, s, l).call(this, "setQuality", h);
|
|
205
|
+
});
|
|
206
|
+
}, H = function() {
|
|
207
|
+
o(this, s, l).call(this, "getCurrentTime");
|
|
208
|
+
}, T = new WeakMap(), J = function(e, i) {
|
|
209
|
+
if (t(this, T) && e === 0) return;
|
|
210
|
+
const { realCurrentTime: n, paused: h, bufferedEnd: d, seekableEnd: p, live: I } = t(this, a).$state;
|
|
211
|
+
if (n() === e) return;
|
|
212
|
+
const A = n();
|
|
213
|
+
t(this, a).notify("time-change", e, i), Math.abs(A - e) > 1.5 && (t(this, a).notify("seeking", e, i), !h() && d() < e && t(this, a).notify("waiting", void 0, i)), !I() && p() - e < 0.01 && (t(this, a).notify("end", void 0, i), u(this, T, !0), setTimeout(() => {
|
|
214
|
+
u(this, T, !1);
|
|
215
|
+
}, 500));
|
|
216
|
+
}, K = function(e, i) {
|
|
217
|
+
t(this, a).notify("seeked", e, i);
|
|
218
|
+
}, X = function(e) {
|
|
219
|
+
var n;
|
|
220
|
+
const i = t(this, y).call(this);
|
|
221
|
+
(n = t(this, E)) == null || n.promise.then((h) => {
|
|
222
|
+
if (!h) return;
|
|
223
|
+
const { title: d, poster: p, duration: I, pro: A } = h;
|
|
224
|
+
t(this, k).set(A), t(this, a).notify("title-change", d, e), t(this, a).notify("poster-change", p, e), t(this, a).notify("duration-change", I, e), o(this, s, L).call(this, I, e);
|
|
225
|
+
}).catch(() => {
|
|
226
|
+
i === t(this, y).call(this) && (o(this, s, l).call(this, "getVideoTitle"), o(this, s, l).call(this, "getDuration"));
|
|
227
|
+
});
|
|
228
|
+
}, L = function(e, i) {
|
|
229
|
+
const { nativeControls: n } = t(this, a).$state, h = n();
|
|
230
|
+
u(this, v, new C(0, e));
|
|
231
|
+
const d = {
|
|
232
|
+
buffered: new C(0, 0),
|
|
233
|
+
seekable: t(this, v),
|
|
234
|
+
duration: e
|
|
235
|
+
};
|
|
236
|
+
t(this, a).delegate.ready(d, i), h || o(this, s, l).call(this, "_hideOverlay"), o(this, s, l).call(this, "getQualities"), o(this, s, l).call(this, "getChapters");
|
|
237
|
+
}, Z = function(e, i, n) {
|
|
238
|
+
var h;
|
|
239
|
+
switch (e) {
|
|
240
|
+
case "getVideoTitle":
|
|
241
|
+
const d = i;
|
|
242
|
+
t(this, a).notify("title-change", d, n);
|
|
243
|
+
break;
|
|
244
|
+
case "getDuration":
|
|
245
|
+
const p = i;
|
|
246
|
+
t(this, a).$state.canPlay() ? t(this, a).notify("duration-change", p, n) : o(this, s, L).call(this, p, n);
|
|
247
|
+
break;
|
|
248
|
+
case "getCurrentTime":
|
|
249
|
+
o(this, s, J).call(this, i, n);
|
|
250
|
+
break;
|
|
251
|
+
case "getBuffered":
|
|
252
|
+
ve(i) && i.length && o(this, s, x).call(this, i[i.length - 1][1], n);
|
|
253
|
+
break;
|
|
254
|
+
case "setMuted":
|
|
255
|
+
o(this, s, F).call(this, Q(t(this, a).$state.volume), i, n);
|
|
256
|
+
break;
|
|
257
|
+
case "getChapters":
|
|
258
|
+
o(this, s, he).call(this, i);
|
|
259
|
+
break;
|
|
260
|
+
case "getQualities":
|
|
261
|
+
o(this, s, re).call(this, i, n);
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
(h = o(this, s, B).call(this, e)) == null || h.resolve();
|
|
265
|
+
}, ee = function() {
|
|
266
|
+
for (const e of Ce)
|
|
267
|
+
o(this, s, l).call(this, "addEventListener", e);
|
|
268
|
+
}, te = function(e) {
|
|
269
|
+
t(this, $).stop(), t(this, a).notify("pause", void 0, e);
|
|
270
|
+
}, se = function(e) {
|
|
271
|
+
t(this, $).start(), t(this, a).notify("play", void 0, e);
|
|
272
|
+
}, ie = function(e) {
|
|
273
|
+
const { paused: i } = t(this, a).$state;
|
|
274
|
+
!i() && !t(this, T) && t(this, a).notify("playing", void 0, e);
|
|
275
|
+
}, x = function(e, i) {
|
|
276
|
+
const n = {
|
|
277
|
+
buffered: new C(0, e),
|
|
278
|
+
seekable: t(this, v)
|
|
279
|
+
};
|
|
280
|
+
t(this, a).notify("progress", n, i);
|
|
281
|
+
}, ne = function(e) {
|
|
282
|
+
t(this, a).notify("waiting", void 0, e);
|
|
283
|
+
}, ae = function(e) {
|
|
284
|
+
const { paused: i } = t(this, a).$state;
|
|
285
|
+
i() || t(this, a).notify("playing", void 0, e);
|
|
286
|
+
}, oe = function(e) {
|
|
287
|
+
const { paused: i } = t(this, a).$state;
|
|
288
|
+
i() && t(this, a).notify("play", void 0, e), t(this, a).notify("waiting", void 0, e);
|
|
289
|
+
}, F = function(e, i, n) {
|
|
290
|
+
const h = { volume: e, muted: i };
|
|
291
|
+
t(this, a).notify("volume-change", h, n);
|
|
292
|
+
}, // #onTextTrackChange(track: VimeoTextTrack, trigger: Event) {
|
|
293
|
+
// const textTrack = this.#ctx.textTracks.toArray().find((t) => t.language === track.language);
|
|
294
|
+
// if (textTrack) textTrack.mode = track.mode;
|
|
295
|
+
// }
|
|
296
|
+
// #onTextTracksChange(tracks: VimeoTextTrack[], trigger: Event) {
|
|
297
|
+
// for (const init of tracks) {
|
|
298
|
+
// const textTrack = new TextTrack({
|
|
299
|
+
// ...init,
|
|
300
|
+
// label: init.label.replace('auto-generated', 'auto'),
|
|
301
|
+
// });
|
|
302
|
+
// textTrack[TextTrackSymbol.readyState] = 2;
|
|
303
|
+
// this.#ctx.textTracks.add(textTrack, trigger);
|
|
304
|
+
// textTrack.setMode(init.mode, trigger);
|
|
305
|
+
// }
|
|
306
|
+
// }
|
|
307
|
+
// #onCueChange(cue: VimeoTextCue, trigger: Event) {
|
|
308
|
+
// const { textTracks, $state } = this.#ctx,
|
|
309
|
+
// { currentTime } = $state,
|
|
310
|
+
// track = textTracks.selected;
|
|
311
|
+
// if (this.#currentCue) track?.removeCue(this.#currentCue, trigger);
|
|
312
|
+
// this.#currentCue = new window.VTTCue(currentTime(), Number.MAX_SAFE_INTEGER, cue.text);
|
|
313
|
+
// track?.addCue(this.#currentCue, trigger);
|
|
314
|
+
// }
|
|
315
|
+
he = function(e) {
|
|
316
|
+
if (o(this, s, O).call(this), !e.length) return;
|
|
317
|
+
const i = new me({
|
|
318
|
+
kind: "chapters",
|
|
319
|
+
default: !0
|
|
320
|
+
}), { seekableEnd: n } = t(this, a).$state;
|
|
321
|
+
for (let h = 0; h < e.length; h++) {
|
|
322
|
+
const d = e[h], p = e[h + 1];
|
|
323
|
+
i.addCue(
|
|
324
|
+
new window.VTTCue(
|
|
325
|
+
d.startTime,
|
|
326
|
+
(p == null ? void 0 : p.startTime) ?? n(),
|
|
327
|
+
d.title
|
|
328
|
+
)
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
u(this, P, i), t(this, a).textTracks.add(i);
|
|
332
|
+
}, O = function() {
|
|
333
|
+
t(this, P) && (t(this, a).textTracks.remove(t(this, P)), u(this, P, null));
|
|
334
|
+
}, re = function(e, i) {
|
|
335
|
+
t(this, a).qualities[W.enableAuto] = e.some((n) => n.id === "auto") ? () => o(this, s, l).call(this, "setQuality", "auto") : void 0;
|
|
336
|
+
for (const n of e) {
|
|
337
|
+
if (n.id === "auto") continue;
|
|
338
|
+
const h = +n.id.slice(0, -1);
|
|
339
|
+
isNaN(h) || t(this, a).qualities[R.add](
|
|
340
|
+
{
|
|
341
|
+
id: n.id,
|
|
342
|
+
width: h * (16 / 9),
|
|
343
|
+
height: h,
|
|
344
|
+
codec: "avc1,h.264",
|
|
345
|
+
bitrate: -1
|
|
346
|
+
},
|
|
347
|
+
i
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
o(this, s, D).call(this, e.find((n) => n.active), i);
|
|
351
|
+
}, D = function({ id: e } = {}, i) {
|
|
352
|
+
if (!e) return;
|
|
353
|
+
const n = e === "auto", h = t(this, a).qualities.getById(e);
|
|
354
|
+
n ? (t(this, a).qualities[W.setAuto](n, i), t(this, a).qualities[R.select](void 0, !0, i)) : t(this, a).qualities[R.select](h ?? void 0, !0, i);
|
|
355
|
+
}, ce = function(e, i, n) {
|
|
356
|
+
switch (e) {
|
|
357
|
+
case "ready":
|
|
358
|
+
o(this, s, ee).call(this);
|
|
359
|
+
break;
|
|
360
|
+
case "loaded":
|
|
361
|
+
o(this, s, X).call(this, n);
|
|
362
|
+
break;
|
|
363
|
+
case "play":
|
|
364
|
+
o(this, s, se).call(this, n);
|
|
365
|
+
break;
|
|
366
|
+
case "playProgress":
|
|
367
|
+
o(this, s, ie).call(this, n);
|
|
368
|
+
break;
|
|
369
|
+
case "pause":
|
|
370
|
+
o(this, s, te).call(this, n);
|
|
371
|
+
break;
|
|
372
|
+
case "loadProgress":
|
|
373
|
+
o(this, s, x).call(this, i.seconds, n);
|
|
374
|
+
break;
|
|
375
|
+
case "waiting":
|
|
376
|
+
o(this, s, oe).call(this, n);
|
|
377
|
+
break;
|
|
378
|
+
case "bufferstart":
|
|
379
|
+
o(this, s, ne).call(this, n);
|
|
380
|
+
break;
|
|
381
|
+
case "bufferend":
|
|
382
|
+
o(this, s, ae).call(this, n);
|
|
383
|
+
break;
|
|
384
|
+
case "volumechange":
|
|
385
|
+
o(this, s, F).call(this, i.volume, Q(t(this, a).$state.muted), n);
|
|
386
|
+
break;
|
|
387
|
+
case "durationchange":
|
|
388
|
+
u(this, v, new C(0, i.duration)), t(this, a).notify("duration-change", i.duration, n);
|
|
389
|
+
break;
|
|
390
|
+
case "playbackratechange":
|
|
391
|
+
t(this, a).notify("rate-change", i.playbackRate, n);
|
|
392
|
+
break;
|
|
393
|
+
case "qualitychange":
|
|
394
|
+
o(this, s, D).call(this, i, n);
|
|
395
|
+
break;
|
|
396
|
+
case "fullscreenchange":
|
|
397
|
+
u(this, V, i.fullscreen), t(this, a).notify("fullscreen-change", i.fullscreen, n);
|
|
398
|
+
break;
|
|
399
|
+
case "enterpictureinpicture":
|
|
400
|
+
t(this, a).notify("picture-in-picture-change", !0, n);
|
|
401
|
+
break;
|
|
402
|
+
case "leavepictureinpicture":
|
|
403
|
+
t(this, a).notify("picture-in-picture-change", !1, n);
|
|
404
|
+
break;
|
|
405
|
+
case "ended":
|
|
406
|
+
t(this, a).notify("end", void 0, n);
|
|
407
|
+
break;
|
|
408
|
+
case "error":
|
|
409
|
+
o(this, s, le).call(this, i, n);
|
|
410
|
+
break;
|
|
411
|
+
case "seek":
|
|
412
|
+
case "seeked":
|
|
413
|
+
o(this, s, K).call(this, i.seconds, n);
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}, le = function(e, i) {
|
|
417
|
+
var d;
|
|
418
|
+
const { message: n, method: h } = e;
|
|
419
|
+
h === "setPlaybackRate" && t(this, k).set(!1), h && ((d = o(this, s, B).call(this, h)) == null || d.reject(n));
|
|
420
|
+
}, l = async function(e, i) {
|
|
421
|
+
let n = _(), h = t(this, m).get(e);
|
|
422
|
+
return h || t(this, m).set(e, h = []), h.push(n), this.postMessage({
|
|
423
|
+
method: e,
|
|
424
|
+
value: i
|
|
425
|
+
}), n.promise;
|
|
426
|
+
}, j = function() {
|
|
427
|
+
t(this, $).stop(), u(this, v, new C(0, 0)), u(this, E, null), u(this, q, null), t(this, k).set(!1), o(this, s, O).call(this);
|
|
428
|
+
}, B = function(e) {
|
|
429
|
+
var i;
|
|
430
|
+
return (i = t(this, m).get(e)) == null ? void 0 : i.shift();
|
|
431
|
+
};
|
|
432
|
+
export {
|
|
433
|
+
Re as VimeoProvider
|
|
434
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var o = (i, e, t) => e in i ? a(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var r = (i, e, t) => o(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { H as p, s as d, a as u } from "./index-BM9a_WKH.js";
|
|
5
|
+
import "react";
|
|
6
|
+
class y extends p {
|
|
7
|
+
constructor(t, s) {
|
|
8
|
+
super(t, s);
|
|
9
|
+
r(this, "$$PROVIDER_TYPE", "AUDIO");
|
|
10
|
+
r(this, "airPlay");
|
|
11
|
+
d(() => {
|
|
12
|
+
this.airPlay = new u(this.media, s);
|
|
13
|
+
}, this.scope);
|
|
14
|
+
}
|
|
15
|
+
get type() {
|
|
16
|
+
return "audio";
|
|
17
|
+
}
|
|
18
|
+
setup() {
|
|
19
|
+
super.setup(), this.type === "audio" && this.ctx.notify("provider-setup", this);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The native HTML `<audio>` element.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement}
|
|
25
|
+
*/
|
|
26
|
+
get audio() {
|
|
27
|
+
return this.media;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
y as AudioProvider
|
|
32
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var g = (s) => {
|
|
3
|
+
throw TypeError(s);
|
|
4
|
+
};
|
|
5
|
+
var w = (s, t, r) => t in s ? y(s, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[t] = r;
|
|
6
|
+
var c = (s, t, r) => w(s, typeof t != "symbol" ? t + "" : t, r), h = (s, t, r) => t.has(s) || g("Cannot " + r);
|
|
7
|
+
var e = (s, t, r) => (h(s, t, "read from private field"), r ? r.call(s) : t.get(s)), u = (s, t, r) => t.has(s) ? g("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, r), p = (s, t, r, a) => (h(s, t, "write to private field"), a ? a.call(s, r) : t.set(s, r), r), l = (s, t, r) => (h(s, t, "access private method"), r);
|
|
8
|
+
import { n as M, l as f, e as A, c as P, w as S, x as E, b as O } from "./index-BM9a_WKH.js";
|
|
9
|
+
var i, o, b, m;
|
|
10
|
+
class x {
|
|
11
|
+
constructor(t) {
|
|
12
|
+
u(this, o);
|
|
13
|
+
u(this, i);
|
|
14
|
+
c(this, "src", M(""));
|
|
15
|
+
/**
|
|
16
|
+
* Defines which referrer is sent when fetching the resource.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy}
|
|
19
|
+
*/
|
|
20
|
+
c(this, "referrerPolicy", null);
|
|
21
|
+
p(this, i, t), t.setAttribute("frameBorder", "0"), t.setAttribute("aria-hidden", "true"), t.setAttribute(
|
|
22
|
+
"allow",
|
|
23
|
+
"autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"
|
|
24
|
+
), this.referrerPolicy !== null && t.setAttribute("referrerpolicy", this.referrerPolicy);
|
|
25
|
+
}
|
|
26
|
+
get iframe() {
|
|
27
|
+
return e(this, i);
|
|
28
|
+
}
|
|
29
|
+
setup() {
|
|
30
|
+
f(window, "message", l(this, o, m).bind(this)), f(e(this, i), "load", this.onLoad.bind(this)), A(l(this, o, b).bind(this));
|
|
31
|
+
}
|
|
32
|
+
postMessage(t, r) {
|
|
33
|
+
var a;
|
|
34
|
+
E || (a = e(this, i).contentWindow) == null || a.postMessage(JSON.stringify(t), r ?? "*");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
i = new WeakMap(), o = new WeakSet(), b = function() {
|
|
38
|
+
const t = this.src();
|
|
39
|
+
if (!t.length) {
|
|
40
|
+
e(this, i).setAttribute("src", "");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const r = P(() => this.buildParams());
|
|
44
|
+
e(this, i).setAttribute("src", S(t, r));
|
|
45
|
+
}, m = function(t) {
|
|
46
|
+
var d;
|
|
47
|
+
const r = this.getOrigin();
|
|
48
|
+
if ((t.source === null || t.source === ((d = e(this, i)) == null ? void 0 : d.contentWindow)) && (!O(r) || r === t.origin)) {
|
|
49
|
+
try {
|
|
50
|
+
const n = JSON.parse(t.data);
|
|
51
|
+
n && this.onMessage(n, t);
|
|
52
|
+
return;
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
t.data && this.onMessage(t.data, t);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
x as E
|
|
60
|
+
};
|