test-bentoweb-ui 1.0.73 → 1.0.75
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/bentoweb-ui.css +2 -6
- package/dist/bentoweb-ui.es.js +21 -22411
- package/dist/bentoweb-ui.umd.js +639 -15
- package/dist/errors-DCJKAXTz.js +70 -0
- package/dist/index-CJNQa9oe.js +35674 -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/vidstack-BTigPj2h-D_5mpAw4.js +55 -0
- package/dist/vidstack-Bq6c3Bam-ajJxDr7M.js +413 -0
- package/dist/vidstack-D2pY00kU-DWwZEB1N.js +138 -0
- package/dist/vidstack-DDXt6fpN-BeN5Ad9F.js +60 -0
- package/dist/vidstack-D_-9AA6_-BuzH0TZC.js +20 -0
- package/dist/vidstack-Dm1xEU9Q-qSXq3AI-.js +31 -0
- package/dist/vidstack-DqAw8m9J-C-yN2xmu.js +29 -0
- package/dist/vidstack-audio-yjQusryw.js +32 -0
- package/dist/vidstack-dash-C4POZ3R2.js +403 -0
- package/dist/vidstack-google-cast-D-pvs1aK.js +377 -0
- package/dist/vidstack-hls-B2397RGn.js +324 -0
- package/dist/vidstack-krOAtKMi-B4IZWKdc.js +29 -0
- package/dist/vidstack-video-YYohV9Kw.js +181 -0
- package/dist/vidstack-vimeo-CkoazTKm.js +434 -0
- package/dist/vidstack-youtube-Dx-0kw3S.js +236 -0
- package/package.json +1 -1
@@ -0,0 +1,236 @@
|
|
1
|
+
var K = Object.defineProperty;
|
2
|
+
var B = (r) => {
|
3
|
+
throw TypeError(r);
|
4
|
+
};
|
5
|
+
var N = (r, n, e) => n in r ? K(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
|
6
|
+
var T = (r, n, e) => N(r, typeof n != "symbol" ? n + "" : n, e), R = (r, n, e) => n.has(r) || B("Cannot " + e);
|
7
|
+
var s = (r, n, e) => (R(r, n, "read from private field"), e ? e.call(r) : n.get(r)), p = (r, n, e) => n.has(r) ? B("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, e), l = (r, n, e, t) => (R(r, n, "write to private field"), t ? t.call(r, e) : n.set(r, e), e), o = (r, n, e) => (R(r, n, "access private method"), e);
|
8
|
+
import { y as q, J as z, p as A, e as G, b as H, M as Q, O as W, t as $, K as C, P as X } from "./index-CJNQa9oe.js";
|
9
|
+
import { E as Z } from "./vidstack-DDXt6fpN-BeN5Ad9F.js";
|
10
|
+
import { resolveYouTubeVideoId as ee } from "./vidstack-Dm1xEU9Q-qSXq3AI-.js";
|
11
|
+
const b = {
|
12
|
+
Ended: 0,
|
13
|
+
Playing: 1,
|
14
|
+
Paused: 2,
|
15
|
+
Buffering: 3,
|
16
|
+
Cued: 5
|
17
|
+
};
|
18
|
+
var a, k, v, S, P, m, y, i, te, se, D, f, j, Y, F, I, M, x, L, O, V, U;
|
19
|
+
class ne extends Z {
|
20
|
+
constructor(e, t) {
|
21
|
+
super(e);
|
22
|
+
p(this, i);
|
23
|
+
T(this, "$$PROVIDER_TYPE", "YOUTUBE");
|
24
|
+
T(this, "scope", q());
|
25
|
+
p(this, a);
|
26
|
+
p(this, k, z(""));
|
27
|
+
p(this, v, -1);
|
28
|
+
p(this, S, null);
|
29
|
+
p(this, P, -1);
|
30
|
+
p(this, m, !1);
|
31
|
+
p(this, y, /* @__PURE__ */ new Map());
|
32
|
+
/**
|
33
|
+
* Sets the player's interface language. The parameter value is an ISO 639-1 two-letter
|
34
|
+
* language code or a fully specified locale. For example, fr and fr-ca are both valid values.
|
35
|
+
* Other language input codes, such as IETF language tags (BCP 47) might also be handled properly.
|
36
|
+
*
|
37
|
+
* The interface language is used for tooltips in the player and also affects the default caption
|
38
|
+
* track. Note that YouTube might select a different caption track language for a particular
|
39
|
+
* user based on the user's individual language preferences and the availability of caption tracks.
|
40
|
+
*
|
41
|
+
* @defaultValue 'en'
|
42
|
+
*/
|
43
|
+
T(this, "language", "en");
|
44
|
+
T(this, "color", "red");
|
45
|
+
/**
|
46
|
+
* Whether cookies should be enabled on the embed. This is turned off by default to be
|
47
|
+
* GDPR-compliant.
|
48
|
+
*
|
49
|
+
* @defaultValue `false`
|
50
|
+
*/
|
51
|
+
T(this, "cookies", !1);
|
52
|
+
l(this, a, t);
|
53
|
+
}
|
54
|
+
get currentSrc() {
|
55
|
+
return s(this, S);
|
56
|
+
}
|
57
|
+
get type() {
|
58
|
+
return "youtube";
|
59
|
+
}
|
60
|
+
get videoId() {
|
61
|
+
return s(this, k).call(this);
|
62
|
+
}
|
63
|
+
preconnect() {
|
64
|
+
A(this.getOrigin());
|
65
|
+
}
|
66
|
+
setup() {
|
67
|
+
super.setup(), G(o(this, i, D).bind(this)), s(this, a).notify("provider-setup", this);
|
68
|
+
}
|
69
|
+
destroy() {
|
70
|
+
o(this, i, O).call(this);
|
71
|
+
const e = "provider destroyed";
|
72
|
+
for (const t of s(this, y).values())
|
73
|
+
for (const { reject: d } of t) d(e);
|
74
|
+
s(this, y).clear();
|
75
|
+
}
|
76
|
+
async play() {
|
77
|
+
return o(this, i, f).call(this, "playVideo");
|
78
|
+
}
|
79
|
+
async pause() {
|
80
|
+
return o(this, i, f).call(this, "pauseVideo");
|
81
|
+
}
|
82
|
+
setMuted(e) {
|
83
|
+
e ? o(this, i, f).call(this, "mute") : o(this, i, f).call(this, "unMute");
|
84
|
+
}
|
85
|
+
setCurrentTime(e) {
|
86
|
+
o(this, i, f).call(this, "seekTo", e), s(this, a).notify("seeking", e);
|
87
|
+
}
|
88
|
+
setVolume(e) {
|
89
|
+
o(this, i, f).call(this, "setVolume", e * 100);
|
90
|
+
}
|
91
|
+
setPlaybackRate(e) {
|
92
|
+
o(this, i, f).call(this, "setPlaybackRate", e);
|
93
|
+
}
|
94
|
+
async loadSource(e) {
|
95
|
+
if (!H(e.src)) {
|
96
|
+
l(this, S, null), s(this, k).set("");
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
const t = ee(e.src);
|
100
|
+
s(this, k).set(t ?? ""), l(this, S, e);
|
101
|
+
}
|
102
|
+
getOrigin() {
|
103
|
+
return this.cookies ? "https://www.youtube.com" : "https://www.youtube-nocookie.com";
|
104
|
+
}
|
105
|
+
buildParams() {
|
106
|
+
const { keyDisabled: e } = s(this, a).$props, { muted: t, playsInline: d, nativeControls: u } = s(this, a).$state, h = u();
|
107
|
+
return {
|
108
|
+
rel: 0,
|
109
|
+
autoplay: 0,
|
110
|
+
cc_lang_pref: this.language,
|
111
|
+
cc_load_policy: h ? 1 : void 0,
|
112
|
+
color: this.color,
|
113
|
+
controls: h ? 1 : 0,
|
114
|
+
disablekb: !h || e() ? 1 : 0,
|
115
|
+
enablejsapi: 1,
|
116
|
+
fs: 1,
|
117
|
+
hl: this.language,
|
118
|
+
iv_load_policy: h ? 1 : 3,
|
119
|
+
mute: t() ? 1 : 0,
|
120
|
+
playsinline: d() ? 1 : 0
|
121
|
+
};
|
122
|
+
}
|
123
|
+
onLoad() {
|
124
|
+
window.setTimeout(() => this.postMessage({ event: "listening" }), 100);
|
125
|
+
}
|
126
|
+
onMessage({ info: e }, t) {
|
127
|
+
var c;
|
128
|
+
if (!e) return;
|
129
|
+
const { title: d, intrinsicDuration: u, playbackRate: h } = s(this, a).$state;
|
130
|
+
if (W(e.videoData) && e.videoData.title !== d() && s(this, a).notify("title-change", e.videoData.title, t), $(e.duration) && e.duration !== u()) {
|
131
|
+
if ($(e.videoLoadedFraction)) {
|
132
|
+
const g = ((c = e.progressState) == null ? void 0 : c.loaded) ?? e.videoLoadedFraction * e.duration, w = new C(0, e.duration);
|
133
|
+
o(this, i, I).call(this, g, w, t);
|
134
|
+
}
|
135
|
+
s(this, a).notify("duration-change", e.duration, t);
|
136
|
+
}
|
137
|
+
if ($(e.playbackRate) && e.playbackRate !== h() && s(this, a).notify("rate-change", e.playbackRate, t), e.progressState) {
|
138
|
+
const { current: g, seekableStart: w, seekableEnd: E, loaded: J, duration: _ } = e.progressState;
|
139
|
+
o(this, i, F).call(this, g, t), o(this, i, I).call(this, J, new C(w, E), t), _ !== u() && s(this, a).notify("duration-change", _, t);
|
140
|
+
}
|
141
|
+
if ($(e.volume) && X(e.muted) && !s(this, m)) {
|
142
|
+
const g = {
|
143
|
+
muted: e.muted,
|
144
|
+
volume: e.volume / 100
|
145
|
+
};
|
146
|
+
s(this, a).notify("volume-change", g, t);
|
147
|
+
}
|
148
|
+
$(e.playerState) && e.playerState !== s(this, v) && o(this, i, L).call(this, e.playerState, t);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
a = new WeakMap(), k = new WeakMap(), v = new WeakMap(), S = new WeakMap(), P = new WeakMap(), m = new WeakMap(), y = new WeakMap(), i = new WeakSet(), te = function(e) {
|
152
|
+
var t;
|
153
|
+
(t = o(this, i, V).call(this, "playVideo")) == null || t.reject(e);
|
154
|
+
}, se = function(e) {
|
155
|
+
var t;
|
156
|
+
(t = o(this, i, V).call(this, "pauseVideo")) == null || t.reject(e);
|
157
|
+
}, D = function() {
|
158
|
+
o(this, i, O).call(this);
|
159
|
+
const e = s(this, k).call(this);
|
160
|
+
if (!e) {
|
161
|
+
this.src.set("");
|
162
|
+
return;
|
163
|
+
}
|
164
|
+
this.src.set(`${this.getOrigin()}/embed/${e}`), s(this, a).notify("load-start");
|
165
|
+
}, f = function(e, t) {
|
166
|
+
let d = Q(), u = s(this, y).get(e);
|
167
|
+
return u || s(this, y).set(e, u = []), u.push(d), this.postMessage({
|
168
|
+
event: "command",
|
169
|
+
func: e,
|
170
|
+
args: t ? [t] : void 0
|
171
|
+
}), d.promise;
|
172
|
+
}, j = function(e) {
|
173
|
+
s(this, a).notify("loaded-metadata"), s(this, a).notify("loaded-data"), s(this, a).delegate.ready(void 0, e);
|
174
|
+
}, Y = function(e) {
|
175
|
+
var t;
|
176
|
+
(t = o(this, i, V).call(this, "pauseVideo")) == null || t.resolve(), s(this, a).notify("pause", void 0, e);
|
177
|
+
}, F = function(e, t) {
|
178
|
+
const { duration: d, realCurrentTime: u } = s(this, a).$state, h = s(this, v) === b.Ended, c = h ? d() : e;
|
179
|
+
s(this, a).notify("time-change", c, t), !h && Math.abs(c - u()) > 1 && s(this, a).notify("seeking", c, t);
|
180
|
+
}, I = function(e, t, d) {
|
181
|
+
const u = {
|
182
|
+
buffered: new C(0, e),
|
183
|
+
seekable: t
|
184
|
+
};
|
185
|
+
s(this, a).notify("progress", u, d);
|
186
|
+
const { seeking: h, realCurrentTime: c } = s(this, a).$state;
|
187
|
+
h() && e > c() && o(this, i, M).call(this, d);
|
188
|
+
}, M = function(e) {
|
189
|
+
const { paused: t, realCurrentTime: d } = s(this, a).$state;
|
190
|
+
window.clearTimeout(s(this, P)), l(this, P, window.setTimeout(
|
191
|
+
() => {
|
192
|
+
s(this, a).notify("seeked", d(), e), l(this, P, -1);
|
193
|
+
},
|
194
|
+
t() ? 100 : 0
|
195
|
+
));
|
196
|
+
}, x = function(e) {
|
197
|
+
const { seeking: t } = s(this, a).$state;
|
198
|
+
t() && o(this, i, M).call(this, e), s(this, a).notify("pause", void 0, e), s(this, a).notify("end", void 0, e);
|
199
|
+
}, L = function(e, t) {
|
200
|
+
var E;
|
201
|
+
const { paused: d, seeking: u } = s(this, a).$state, h = e === b.Playing, c = e === b.Buffering, g = o(this, i, U).call(this, "playVideo"), w = d() && (c || h);
|
202
|
+
if (c && s(this, a).notify("waiting", void 0, t), u() && h && o(this, i, M).call(this, t), s(this, m) && h) {
|
203
|
+
this.pause(), l(this, m, !1), this.setMuted(s(this, a).$state.muted());
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
if (!g && w) {
|
207
|
+
l(this, m, !0), this.setMuted(!0);
|
208
|
+
return;
|
209
|
+
}
|
210
|
+
switch (w && ((E = o(this, i, V).call(this, "playVideo")) == null || E.resolve(), s(this, a).notify("play", void 0, t)), e) {
|
211
|
+
case b.Cued:
|
212
|
+
o(this, i, j).call(this, t);
|
213
|
+
break;
|
214
|
+
case b.Playing:
|
215
|
+
s(this, a).notify("playing", void 0, t);
|
216
|
+
break;
|
217
|
+
case b.Paused:
|
218
|
+
o(this, i, Y).call(this, t);
|
219
|
+
break;
|
220
|
+
case b.Ended:
|
221
|
+
o(this, i, x).call(this, t);
|
222
|
+
break;
|
223
|
+
}
|
224
|
+
l(this, v, e);
|
225
|
+
}, O = function() {
|
226
|
+
l(this, v, -1), l(this, P, -1), l(this, m, !1);
|
227
|
+
}, V = function(e) {
|
228
|
+
var t;
|
229
|
+
return (t = s(this, y).get(e)) == null ? void 0 : t.shift();
|
230
|
+
}, U = function(e) {
|
231
|
+
var t;
|
232
|
+
return !!((t = s(this, y).get(e)) != null && t.length);
|
233
|
+
};
|
234
|
+
export {
|
235
|
+
ne as YouTubeProvider
|
236
|
+
};
|