@ix_waterford/lib 1.0.7 → 1.0.8

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.
Files changed (34) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +121113 -5092
  3. package/dist/index.js.map +1 -1
  4. package/package.json +1 -1
  5. package/dist/async/reactPlayerDash.js +0 -350
  6. package/dist/async/reactPlayerDash.js.map +0 -1
  7. package/dist/async/reactPlayerHls.js +0 -429
  8. package/dist/async/reactPlayerHls.js.map +0 -1
  9. package/dist/async/reactPlayerMux.js +0 -16075
  10. package/dist/async/reactPlayerMux.js.map +0 -1
  11. package/dist/async/reactPlayerPreview.js +0 -111
  12. package/dist/async/reactPlayerPreview.js.map +0 -1
  13. package/dist/async/reactPlayerSpotify.js +0 -518
  14. package/dist/async/reactPlayerSpotify.js.map +0 -1
  15. package/dist/async/reactPlayerTiktok.js +0 -488
  16. package/dist/async/reactPlayerTiktok.js.map +0 -1
  17. package/dist/async/reactPlayerTwitch.js +0 -586
  18. package/dist/async/reactPlayerTwitch.js.map +0 -1
  19. package/dist/async/reactPlayerVimeo.js +0 -4264
  20. package/dist/async/reactPlayerVimeo.js.map +0 -1
  21. package/dist/async/reactPlayerWistia.js +0 -767
  22. package/dist/async/reactPlayerWistia.js.map +0 -1
  23. package/dist/async/reactPlayerYouTube.js +0 -738
  24. package/dist/async/reactPlayerYouTube.js.map +0 -1
  25. package/dist/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js +0 -1253
  26. package/dist/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js.map +0 -1
  27. package/dist/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js +0 -21
  28. package/dist/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js.map +0 -1
  29. package/dist/async/vendors-node_modules_hls_js_dist_hls_mjs.js +0 -36691
  30. package/dist/async/vendors-node_modules_hls_js_dist_hls_mjs.js.map +0 -1
  31. package/dist/lib-react.js +0 -1462
  32. package/dist/lib-react.js.map +0 -1
  33. package/dist/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-5eb95d.js +0 -53062
  34. package/dist/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-5eb95d.js.map +0 -1
@@ -1,738 +0,0 @@
1
- (self["webpackChunk_ix_waterford_lib"] = self["webpackChunk_ix_waterford_lib"] || []).push([["reactPlayerYouTube"], {
2
- "./node_modules/youtube-video-element/dist/react.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3
- __webpack_require__.r(__webpack_exports__);
4
- __webpack_require__.d(__webpack_exports__, {
5
- "default": () => (react_default)
6
- });
7
- /* import */var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("react");
8
- /* import */var _youtube_video_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/youtube-video-element/dist/youtube-video-element.js");
9
- "use client";
10
-
11
- // dist/react.ts
12
-
13
-
14
-
15
- // ../../node_modules/ce-la-react/dist/ce-la-react.js
16
- var reservedReactProps = /* @__PURE__ */ new Set([
17
- "style",
18
- "children",
19
- "ref",
20
- "key",
21
- "suppressContentEditableWarning",
22
- "suppressHydrationWarning",
23
- "dangerouslySetInnerHTML"
24
- ]);
25
- var reactPropToAttrNameMap = {
26
- className: "class",
27
- htmlFor: "for"
28
- };
29
- function defaultToAttributeName(propName) {
30
- return propName.toLowerCase();
31
- }
32
- function defaultToAttributeValue(propValue) {
33
- if (typeof propValue === "boolean") return propValue ? "" : void 0;
34
- if (typeof propValue === "function") return void 0;
35
- if (typeof propValue === "object" && propValue !== null) return void 0;
36
- return propValue;
37
- }
38
- function createComponent({
39
- react: React2,
40
- tagName,
41
- elementClass,
42
- events,
43
- displayName,
44
- defaultProps,
45
- toAttributeName = defaultToAttributeName,
46
- toAttributeValue = defaultToAttributeValue
47
- }) {
48
- const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;
49
- const ReactComponent = React2.forwardRef((props, ref) => {
50
- var _a, _b;
51
- const elementRef = React2.useRef(null);
52
- const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());
53
- const eventProps = {};
54
- const attrs = {};
55
- const reactProps = {};
56
- const elementProps = {};
57
- for (const [k, v] of Object.entries(props)) {
58
- if (reservedReactProps.has(k)) {
59
- reactProps[k] = v;
60
- continue;
61
- }
62
- const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);
63
- if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {
64
- elementProps[k] = v;
65
- continue;
66
- }
67
- if (k.startsWith("on")) {
68
- eventProps[k] = v;
69
- continue;
70
- }
71
- const attrValue = toAttributeValue(v);
72
- if (attrName && attrValue != null) {
73
- attrs[attrName] = String(attrValue);
74
- if (!IS_REACT_19_OR_NEWER) {
75
- reactProps[attrName] = attrValue;
76
- }
77
- }
78
- if (attrName && IS_REACT_19_OR_NEWER) {
79
- const attrValueFromDefault = defaultToAttributeValue(v);
80
- if (attrValue !== attrValueFromDefault) {
81
- reactProps[attrName] = attrValue;
82
- } else {
83
- reactProps[attrName] = v;
84
- }
85
- }
86
- }
87
- if (typeof window !== "undefined") {
88
- for (const propName in eventProps) {
89
- const callback = eventProps[propName];
90
- const useCapture = propName.endsWith("Capture");
91
- const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(
92
- 0,
93
- useCapture ? -7 : void 0
94
- );
95
- React2.useLayoutEffect(() => {
96
- const eventTarget = elementRef == null ? void 0 : elementRef.current;
97
- if (!eventTarget || typeof callback !== "function") return;
98
- eventTarget.addEventListener(eventName, callback, useCapture);
99
- return () => {
100
- eventTarget.removeEventListener(eventName, callback, useCapture);
101
- };
102
- }, [elementRef == null ? void 0 : elementRef.current, callback]);
103
- }
104
- React2.useLayoutEffect(() => {
105
- if (elementRef.current === null) return;
106
- const newElemProps = /* @__PURE__ */ new Map();
107
- for (const key in elementProps) {
108
- setProperty(elementRef.current, key, elementProps[key]);
109
- prevElemPropsRef.current.delete(key);
110
- newElemProps.set(key, elementProps[key]);
111
- }
112
- for (const [key, _value] of prevElemPropsRef.current) {
113
- setProperty(elementRef.current, key, void 0);
114
- }
115
- prevElemPropsRef.current = newElemProps;
116
- });
117
- }
118
- if (typeof window === "undefined" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {
119
- const { mode, delegatesFocus } = elementClass.shadowRootOptions;
120
- const templateShadowRoot = React2.createElement("template", {
121
- shadowrootmode: mode,
122
- shadowrootdelegatesfocus: delegatesFocus,
123
- dangerouslySetInnerHTML: {
124
- __html: elementClass.getTemplateHTML(attrs, props)
125
- }
126
- });
127
- reactProps.children = [templateShadowRoot, reactProps.children];
128
- }
129
- return React2.createElement(tagName, {
130
- ...defaultProps,
131
- ...reactProps,
132
- ref: React2.useCallback(
133
- (node) => {
134
- elementRef.current = node;
135
- if (typeof ref === "function") {
136
- ref(node);
137
- } else if (ref !== null) {
138
- ref.current = node;
139
- }
140
- },
141
- [ref]
142
- )
143
- });
144
- });
145
- ReactComponent.displayName = displayName ?? elementClass.name;
146
- return ReactComponent;
147
- }
148
- function setProperty(node, name, value) {
149
- var _a;
150
- node[name] = value;
151
- if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {
152
- node.removeAttribute(name);
153
- }
154
- }
155
-
156
- // dist/react.ts
157
- var react_default = createComponent({
158
- react: react__WEBPACK_IMPORTED_MODULE_0__["default"],
159
- tagName: "youtube-video",
160
- elementClass: _youtube_video_element_js__WEBPACK_IMPORTED_MODULE_1__["default"],
161
- toAttributeName(propName) {
162
- if (propName === "muted") return "";
163
- if (propName === "defaultMuted") return "muted";
164
- return defaultToAttributeName(propName);
165
- }
166
- });
167
-
168
- /*! Bundled license information:
169
-
170
- ce-la-react/dist/ce-la-react.js:
171
- (**
172
- * @license
173
- * Copyright 2018 Google LLC
174
- * SPDX-License-Identifier: BSD-3-Clause
175
- *
176
- * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
177
- *)
178
- */
179
-
180
-
181
- }),
182
- "./node_modules/youtube-video-element/dist/youtube-video-element.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
183
- __webpack_require__.r(__webpack_exports__);
184
- __webpack_require__.d(__webpack_exports__, {
185
- "default": () => (youtube_video_element_default)
186
- });
187
- const EMBED_BASE = "https://www.youtube.com/embed";
188
- const EMBED_BASE_NOCOOKIE = "https://www.youtube-nocookie.com/embed";
189
- const API_URL = "https://www.youtube.com/iframe_api";
190
- const API_GLOBAL = "YT";
191
- const API_GLOBAL_READY = "onYouTubeIframeAPIReady";
192
- const VIDEO_MATCH_SRC = /(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})/;
193
- const PLAYLIST_MATCH_SRC = /(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/.*?[?&]list=)([\w_-]+)/;
194
- function getTemplateHTML(attrs, props = {}) {
195
- var _a;
196
- const iframeAttrs = {
197
- src: serializeIframeUrl(attrs, props),
198
- frameborder: 0,
199
- width: "100%",
200
- height: "100%",
201
- allow: "accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"
202
- };
203
- if ((_a = props.config) == null ? void 0 : _a.referrerpolicy) {
204
- iframeAttrs.referrerpolicy = props.config.referrerpolicy;
205
- }
206
- if (props.config) {
207
- iframeAttrs["data-config"] = JSON.stringify(props.config);
208
- }
209
- return (
210
- /*html*/
211
- `
212
- <style>
213
- :host {
214
- display: inline-block;
215
- line-height: 0;
216
- position: relative;
217
- min-width: 300px;
218
- min-height: 150px;
219
- }
220
- iframe {
221
- position: absolute;
222
- top: 0;
223
- left: 0;
224
- }
225
- </style>
226
- <iframe${serializeAttributes(iframeAttrs)}></iframe>
227
- `
228
- );
229
- }
230
- function serializeIframeUrl(attrs, props) {
231
- if (!attrs.src) return;
232
- const embedBase = attrs.src.includes("-nocookie") ? EMBED_BASE_NOCOOKIE : EMBED_BASE;
233
- const params = {
234
- // ?controls=true is enabled by default in the iframe
235
- controls: attrs.controls === "" ? null : 0,
236
- autoplay: attrs.autoplay,
237
- loop: attrs.loop,
238
- mute: attrs.muted,
239
- playsinline: attrs.playsinline,
240
- preload: attrs.preload ?? "metadata",
241
- // https://developers.google.com/youtube/player_parameters#Parameters
242
- // origin: globalThis.location?.origin,
243
- enablejsapi: 1,
244
- cc_load_policy: 1,
245
- showinfo: 0,
246
- rel: 0,
247
- iv_load_policy: 3,
248
- modestbranding: 1,
249
- ...props.config
250
- };
251
- if (VIDEO_MATCH_SRC.test(attrs.src)) {
252
- const matches2 = attrs.src.match(VIDEO_MATCH_SRC);
253
- const srcId = matches2 && matches2[1];
254
- return `${embedBase}/${srcId}?${serialize(params)}`;
255
- }
256
- const matches = attrs.src.match(PLAYLIST_MATCH_SRC);
257
- const playlistId = matches && matches[1];
258
- const extendedParams = {
259
- listType: "playlist",
260
- list: playlistId,
261
- ...params
262
- };
263
- return `${embedBase}?${serialize(extendedParams)}`;
264
- }
265
- class YoutubeVideoElement extends (globalThis.HTMLElement ?? class {
266
- }) {
267
- static getTemplateHTML = getTemplateHTML;
268
- static shadowRootOptions = { mode: "open" };
269
- static observedAttributes = [
270
- "autoplay",
271
- "controls",
272
- "crossorigin",
273
- "loop",
274
- "muted",
275
- "playsinline",
276
- "poster",
277
- "preload",
278
- "src"
279
- ];
280
- loadComplete = new PublicPromise();
281
- #loadRequested;
282
- #hasLoaded;
283
- #readyState = 0;
284
- #seeking = false;
285
- #seekComplete;
286
- isLoaded = false;
287
- #error = null;
288
- #config = null;
289
- #textTracksVideo = null;
290
- #initialVolume = 1;
291
- constructor() {
292
- super();
293
- this.#upgradeProperty("config");
294
- }
295
- get config() {
296
- return this.#config;
297
- }
298
- set config(value) {
299
- this.#config = value;
300
- }
301
- async load() {
302
- if (this.#loadRequested) return;
303
- if (!this.shadowRoot) {
304
- this.attachShadow({ mode: "open" });
305
- }
306
- const isFirstLoad = !this.#hasLoaded;
307
- if (this.#hasLoaded) {
308
- this.loadComplete = new PublicPromise();
309
- this.isLoaded = false;
310
- }
311
- this.#hasLoaded = true;
312
- await (this.#loadRequested = Promise.resolve());
313
- this.#loadRequested = null;
314
- this.#readyState = 0;
315
- this.dispatchEvent(new Event("emptied"));
316
- let oldApi = this.api;
317
- this.api = null;
318
- if (!this.src) {
319
- oldApi == null ? void 0 : oldApi.destroy();
320
- return;
321
- }
322
- this.#textTracksVideo = document.createElement("video");
323
- this.textTracks = this.#textTracksVideo.textTracks;
324
- this.textTracks.addEventListener("change", () => {
325
- var _a;
326
- const active = Array.from(this.textTracks).find((t) => t.mode === "showing");
327
- (_a = this.api) == null ? void 0 : _a.setOption("captions", "track", active ? { languageCode: active.language } : {});
328
- });
329
- this.dispatchEvent(new Event("loadstart"));
330
- let iframe = this.shadowRoot.querySelector("iframe");
331
- let attrs = namedNodeMapToObject(this.attributes);
332
- if (isFirstLoad && iframe) {
333
- this.#config = JSON.parse(iframe.getAttribute("data-config") || "{}");
334
- }
335
- if (!(iframe == null ? void 0 : iframe.src) || iframe.src !== serializeIframeUrl(attrs, this)) {
336
- this.shadowRoot.innerHTML = getTemplateHTML(attrs, this);
337
- iframe = this.shadowRoot.querySelector("iframe");
338
- }
339
- const YT = await loadScript(API_URL, API_GLOBAL, API_GLOBAL_READY);
340
- this.api = new YT.Player(iframe, {
341
- events: {
342
- onReady: () => {
343
- var _a;
344
- this.#readyState = 1;
345
- this.dispatchEvent(new Event("loadedmetadata"));
346
- this.dispatchEvent(new Event("durationchange"));
347
- if (this.#initialVolume !== 1) {
348
- (_a = this.api) == null ? void 0 : _a.setVolume(this.#initialVolume * 100);
349
- }
350
- this.dispatchEvent(new Event("volumechange"));
351
- this.dispatchEvent(new Event("loadcomplete"));
352
- this.isLoaded = true;
353
- this.loadComplete.resolve();
354
- },
355
- onError: (error) => {
356
- console.error(error);
357
- this.#error = {
358
- code: error.data,
359
- message: `YouTube iframe player error #${error.data}; visit https://developers.google.com/youtube/iframe_api_reference#onError for the full error message.`
360
- };
361
- this.dispatchEvent(new Event("error"));
362
- }
363
- }
364
- });
365
- let playFired = false;
366
- this.api.addEventListener("onStateChange", (event) => {
367
- var _a;
368
- const state = event.data;
369
- if (state === YT.PlayerState.PLAYING || state === YT.PlayerState.BUFFERING) {
370
- if (!playFired) {
371
- playFired = true;
372
- this.dispatchEvent(new Event("play"));
373
- }
374
- const captionList = this.api.getOption("captions", "tracklist") || [];
375
- captionList.forEach((t) => {
376
- if (![...this.textTracks].some((tt) => tt.language === t.languageCode)) {
377
- this.#textTracksVideo.addTextTrack("subtitles", t.displayName, t.languageCode);
378
- }
379
- this.textTracks = this.#textTracksVideo.textTracks;
380
- });
381
- this.dispatchEvent(new Event("loadstart"));
382
- }
383
- if (state === YT.PlayerState.PLAYING) {
384
- if (this.seeking) {
385
- this.#seeking = false;
386
- (_a = this.#seekComplete) == null ? void 0 : _a.resolve();
387
- this.dispatchEvent(new Event("seeked"));
388
- }
389
- this.#readyState = 3;
390
- this.dispatchEvent(new Event("playing"));
391
- } else if (state === YT.PlayerState.PAUSED) {
392
- const diff = Math.abs(this.currentTime - lastCurrentTime);
393
- if (!this.seeking && diff > 0.1) {
394
- this.#seeking = true;
395
- this.dispatchEvent(new Event("seeking"));
396
- }
397
- playFired = false;
398
- this.dispatchEvent(new Event("pause"));
399
- }
400
- if (state === YT.PlayerState.ENDED) {
401
- playFired = false;
402
- this.dispatchEvent(new Event("pause"));
403
- this.dispatchEvent(new Event("ended"));
404
- if (this.loop) {
405
- this.play();
406
- }
407
- }
408
- });
409
- this.api.addEventListener("onPlaybackRateChange", () => {
410
- this.dispatchEvent(new Event("ratechange"));
411
- });
412
- this.api.addEventListener("onVolumeChange", () => {
413
- var _a;
414
- const apiVolume = ((_a = this.api) == null ? void 0 : _a.getVolume()) / 100;
415
- this.#initialVolume = apiVolume;
416
- this.dispatchEvent(new Event("volumechange"));
417
- });
418
- this.api.addEventListener("onVideoProgress", () => {
419
- this.dispatchEvent(new Event("timeupdate"));
420
- });
421
- await this.loadComplete;
422
- let lastCurrentTime = 0;
423
- setInterval(() => {
424
- var _a;
425
- const diff = Math.abs(this.currentTime - lastCurrentTime);
426
- const bufferedEnd = this.buffered.end(this.buffered.length - 1);
427
- if (this.seeking && bufferedEnd > 0.1) {
428
- this.#seeking = false;
429
- (_a = this.#seekComplete) == null ? void 0 : _a.resolve();
430
- this.dispatchEvent(new Event("seeked"));
431
- } else if (!this.seeking && diff > 0.1) {
432
- this.#seeking = true;
433
- this.dispatchEvent(new Event("seeking"));
434
- }
435
- lastCurrentTime = this.currentTime;
436
- }, 50);
437
- let lastBufferedEnd;
438
- const progressInterval = setInterval(() => {
439
- const bufferedEnd = this.buffered.end(this.buffered.length - 1);
440
- if (bufferedEnd >= this.duration) {
441
- clearInterval(progressInterval);
442
- this.#readyState = 4;
443
- }
444
- if (lastBufferedEnd != bufferedEnd) {
445
- lastBufferedEnd = bufferedEnd;
446
- this.dispatchEvent(new Event("progress"));
447
- }
448
- }, 100);
449
- }
450
- async attributeChangedCallback(attrName, oldValue, newValue) {
451
- if (oldValue === newValue) return;
452
- switch (attrName) {
453
- case "src":
454
- case "autoplay":
455
- case "controls":
456
- case "loop":
457
- case "playsinline": {
458
- this.load();
459
- }
460
- }
461
- }
462
- async play() {
463
- var _a;
464
- this.#seekComplete = null;
465
- await this.loadComplete;
466
- (_a = this.api) == null ? void 0 : _a.playVideo();
467
- return createPlayPromise(this);
468
- }
469
- async pause() {
470
- var _a;
471
- await this.loadComplete;
472
- return (_a = this.api) == null ? void 0 : _a.pauseVideo();
473
- }
474
- get seeking() {
475
- return this.#seeking;
476
- }
477
- get readyState() {
478
- return this.#readyState;
479
- }
480
- get src() {
481
- return this.getAttribute("src");
482
- }
483
- set src(val) {
484
- if (this.src == val) return;
485
- this.setAttribute("src", val);
486
- }
487
- get error() {
488
- return this.#error;
489
- }
490
- /* onStateChange
491
- -1 (unstarted)
492
- 0 (ended)
493
- 1 (playing)
494
- 2 (paused)
495
- 3 (buffering)
496
- 5 (video cued).
497
- */
498
- get paused() {
499
- var _a, _b;
500
- if (!this.isLoaded) return !this.autoplay;
501
- return [-1, 0, 2, 5].includes((_b = (_a = this.api) == null ? void 0 : _a.getPlayerState) == null ? void 0 : _b.call(_a));
502
- }
503
- get duration() {
504
- var _a, _b;
505
- return ((_b = (_a = this.api) == null ? void 0 : _a.getDuration) == null ? void 0 : _b.call(_a)) ?? NaN;
506
- }
507
- get autoplay() {
508
- return this.hasAttribute("autoplay");
509
- }
510
- set autoplay(val) {
511
- if (this.autoplay == val) return;
512
- this.toggleAttribute("autoplay", Boolean(val));
513
- }
514
- get buffered() {
515
- var _a, _b;
516
- if (!this.isLoaded) return createTimeRanges();
517
- const progress = ((_a = this.api) == null ? void 0 : _a.getVideoLoadedFraction()) * ((_b = this.api) == null ? void 0 : _b.getDuration());
518
- if (progress > 0) {
519
- return createTimeRanges(0, progress);
520
- }
521
- return createTimeRanges();
522
- }
523
- get controls() {
524
- return this.hasAttribute("controls");
525
- }
526
- set controls(val) {
527
- if (this.controls == val) return;
528
- this.toggleAttribute("controls", Boolean(val));
529
- }
530
- get currentTime() {
531
- var _a, _b;
532
- return ((_b = (_a = this.api) == null ? void 0 : _a.getCurrentTime) == null ? void 0 : _b.call(_a)) ?? 0;
533
- }
534
- set currentTime(val) {
535
- if (this.currentTime == val) return;
536
- this.#seekComplete = new PublicPromise();
537
- this.loadComplete.then(() => {
538
- var _a, _b;
539
- (_a = this.api) == null ? void 0 : _a.seekTo(val, true);
540
- if (this.paused) {
541
- (_b = this.#seekComplete) == null ? void 0 : _b.then(() => {
542
- var _a2;
543
- if (!this.#seekComplete) return;
544
- (_a2 = this.api) == null ? void 0 : _a2.pauseVideo();
545
- });
546
- }
547
- });
548
- }
549
- set defaultMuted(val) {
550
- if (this.defaultMuted == val) return;
551
- this.toggleAttribute("muted", Boolean(val));
552
- }
553
- get defaultMuted() {
554
- return this.hasAttribute("muted");
555
- }
556
- get loop() {
557
- return this.hasAttribute("loop");
558
- }
559
- set loop(val) {
560
- if (this.loop == val) return;
561
- this.toggleAttribute("loop", Boolean(val));
562
- }
563
- set muted(val) {
564
- if (this.muted == val) return;
565
- this.loadComplete.then(() => {
566
- var _a, _b;
567
- val ? (_a = this.api) == null ? void 0 : _a.mute() : (_b = this.api) == null ? void 0 : _b.unMute();
568
- });
569
- }
570
- get muted() {
571
- var _a, _b;
572
- if (!this.isLoaded) return this.defaultMuted;
573
- return (_b = (_a = this.api) == null ? void 0 : _a.isMuted) == null ? void 0 : _b.call(_a);
574
- }
575
- get playbackRate() {
576
- var _a, _b;
577
- return ((_b = (_a = this.api) == null ? void 0 : _a.getPlaybackRate) == null ? void 0 : _b.call(_a)) ?? 1;
578
- }
579
- set playbackRate(val) {
580
- if (this.playbackRate == val) return;
581
- this.loadComplete.then(() => {
582
- var _a;
583
- (_a = this.api) == null ? void 0 : _a.setPlaybackRate(val);
584
- });
585
- }
586
- get playsInline() {
587
- return this.hasAttribute("playsinline");
588
- }
589
- set playsInline(val) {
590
- if (this.playsInline == val) return;
591
- this.toggleAttribute("playsinline", Boolean(val));
592
- }
593
- get poster() {
594
- return this.getAttribute("poster");
595
- }
596
- set poster(val) {
597
- if (this.poster == val) return;
598
- this.setAttribute("poster", `${val}`);
599
- }
600
- set volume(val) {
601
- if (this.volume == val) return;
602
- this.#initialVolume = val;
603
- this.loadComplete.then(() => {
604
- var _a;
605
- (_a = this.api) == null ? void 0 : _a.setVolume(val * 100);
606
- });
607
- }
608
- get volume() {
609
- var _a;
610
- if (!this.isLoaded) {
611
- return this.#initialVolume;
612
- }
613
- return ((_a = this.api) == null ? void 0 : _a.getVolume()) / 100;
614
- }
615
- // This is a pattern to update property values that are set before
616
- // the custom element is upgraded.
617
- // https://web.dev/custom-elements-best-practices/#make-properties-lazy
618
- #upgradeProperty(prop) {
619
- if (Object.prototype.hasOwnProperty.call(this, prop)) {
620
- const value = this[prop];
621
- delete this[prop];
622
- this[prop] = value;
623
- }
624
- }
625
- }
626
- function serializeAttributes(attrs) {
627
- let html = "";
628
- for (const key in attrs) {
629
- const value = attrs[key];
630
- if (value === "") html += ` ${escapeHtml(key)}`;
631
- else html += ` ${escapeHtml(key)}="${escapeHtml(`${value}`)}"`;
632
- }
633
- return html;
634
- }
635
- function escapeHtml(str) {
636
- return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/`/g, "&#x60;");
637
- }
638
- function serialize(props) {
639
- return String(new URLSearchParams(boolToBinary(props)));
640
- }
641
- function boolToBinary(props) {
642
- let p = {};
643
- for (let key in props) {
644
- let val = props[key];
645
- if (val === true || val === "") p[key] = 1;
646
- else if (val === false) p[key] = 0;
647
- else if (val != null) p[key] = val;
648
- }
649
- return p;
650
- }
651
- function namedNodeMapToObject(namedNodeMap) {
652
- let obj = {};
653
- for (let attr of namedNodeMap) {
654
- obj[attr.name] = attr.value;
655
- }
656
- return obj;
657
- }
658
- const loadScriptCache = {};
659
- async function loadScript(src, globalName, readyFnName) {
660
- if (loadScriptCache[src]) return loadScriptCache[src];
661
- if (globalName && self[globalName]) {
662
- await delay(0);
663
- return self[globalName];
664
- }
665
- return loadScriptCache[src] = new Promise(function(resolve, reject) {
666
- const script = document.createElement("script");
667
- script.src = src;
668
- const ready = () => resolve(self[globalName]);
669
- if (readyFnName) self[readyFnName] = ready;
670
- script.onload = () => !readyFnName && ready();
671
- script.onerror = reject;
672
- document.head.append(script);
673
- });
674
- }
675
- const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
676
- function promisify(fn) {
677
- return (...args) => new Promise((resolve) => {
678
- fn(...args, (...res) => {
679
- if (res.length > 1) resolve(res);
680
- else resolve(res[0]);
681
- });
682
- });
683
- }
684
- function createPlayPromise(player) {
685
- return promisify((event, cb) => {
686
- let fn;
687
- player.addEventListener(
688
- event,
689
- fn = () => {
690
- player.removeEventListener(event, fn);
691
- cb();
692
- }
693
- );
694
- })("playing");
695
- }
696
- class PublicPromise extends Promise {
697
- constructor(executor = () => {
698
- }) {
699
- let res, rej;
700
- super((resolve, reject) => {
701
- executor(resolve, reject);
702
- res = resolve;
703
- rej = reject;
704
- });
705
- this.resolve = res;
706
- this.reject = rej;
707
- }
708
- }
709
- function createTimeRanges(start, end) {
710
- if (Array.isArray(start)) {
711
- return createTimeRangesObj(start);
712
- } else if (start == null || end == null || start === 0 && end === 0) {
713
- return createTimeRangesObj([[0, 0]]);
714
- }
715
- return createTimeRangesObj([[start, end]]);
716
- }
717
- function createTimeRangesObj(ranges) {
718
- Object.defineProperties(ranges, {
719
- start: {
720
- value: (i) => ranges[i][0]
721
- },
722
- end: {
723
- value: (i) => ranges[i][1]
724
- }
725
- });
726
- return ranges;
727
- }
728
- if (globalThis.customElements && !globalThis.customElements.get("youtube-video")) {
729
- globalThis.customElements.define("youtube-video", YoutubeVideoElement);
730
- }
731
- var youtube_video_element_default = YoutubeVideoElement;
732
-
733
-
734
-
735
- }),
736
-
737
- }])
738
- //# sourceMappingURL=reactPlayerYouTube.js.map