@ix_waterford/lib 1.0.7 → 1.0.9

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 (40) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +139697 -5081
  3. package/dist/index.js.map +1 -1
  4. package/dist/static/css/index.css +537 -0
  5. package/dist/static/css/index.css.map +1 -1
  6. package/dist/types/components/index.d.ts +3 -0
  7. package/dist/types/components/index.d.ts.map +1 -1
  8. package/dist/types/index.d.ts +1 -1
  9. package/dist/types/index.d.ts.map +1 -1
  10. package/package.json +1 -1
  11. package/dist/async/reactPlayerDash.js +0 -350
  12. package/dist/async/reactPlayerDash.js.map +0 -1
  13. package/dist/async/reactPlayerHls.js +0 -429
  14. package/dist/async/reactPlayerHls.js.map +0 -1
  15. package/dist/async/reactPlayerMux.js +0 -16075
  16. package/dist/async/reactPlayerMux.js.map +0 -1
  17. package/dist/async/reactPlayerPreview.js +0 -111
  18. package/dist/async/reactPlayerPreview.js.map +0 -1
  19. package/dist/async/reactPlayerSpotify.js +0 -518
  20. package/dist/async/reactPlayerSpotify.js.map +0 -1
  21. package/dist/async/reactPlayerTiktok.js +0 -488
  22. package/dist/async/reactPlayerTiktok.js.map +0 -1
  23. package/dist/async/reactPlayerTwitch.js +0 -586
  24. package/dist/async/reactPlayerTwitch.js.map +0 -1
  25. package/dist/async/reactPlayerVimeo.js +0 -4264
  26. package/dist/async/reactPlayerVimeo.js.map +0 -1
  27. package/dist/async/reactPlayerWistia.js +0 -767
  28. package/dist/async/reactPlayerWistia.js.map +0 -1
  29. package/dist/async/reactPlayerYouTube.js +0 -738
  30. package/dist/async/reactPlayerYouTube.js.map +0 -1
  31. package/dist/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js +0 -1253
  32. package/dist/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js.map +0 -1
  33. package/dist/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js +0 -21
  34. package/dist/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js.map +0 -1
  35. package/dist/async/vendors-node_modules_hls_js_dist_hls_mjs.js +0 -36691
  36. package/dist/async/vendors-node_modules_hls_js_dist_hls_mjs.js.map +0 -1
  37. package/dist/lib-react.js +0 -1462
  38. package/dist/lib-react.js.map +0 -1
  39. package/dist/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-5eb95d.js +0 -53062
  40. package/dist/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-5eb95d.js.map +0 -1
@@ -1,429 +0,0 @@
1
- (self["webpackChunk_ix_waterford_lib"] = self["webpackChunk_ix_waterford_lib"] || []).push([["reactPlayerHls"], {
2
- "./node_modules/hls-video-element/dist/hls-video-element.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3
- __webpack_require__.r(__webpack_exports__);
4
- __webpack_require__.d(__webpack_exports__, {
5
- Hls: () => (/* reexport safe */ hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
6
- HlsVideoElement: () => (HlsVideoElement),
7
- HlsVideoMixin: () => (HlsVideoMixin),
8
- "default": () => (hls_video_element_default)
9
- });
10
- /* import */var custom_media_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/custom-media-element/dist/custom-media-element.js");
11
- /* import */var media_tracks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/media-tracks/dist/index.js");
12
- /* import */var hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/hls.js/dist/hls.mjs");
13
-
14
-
15
-
16
- const HlsVideoMixin = (superclass) => {
17
- return class HlsVideo extends superclass {
18
- static shadowRootOptions = { ...superclass.shadowRootOptions };
19
- static getTemplateHTML = (attrs, props = {}) => {
20
- const { src, ...rest } = attrs;
21
- return `
22
- <script type="application/json" id="config">
23
- ${JSON.stringify(props.config || {})}
24
- </script>
25
- ${superclass.getTemplateHTML(rest)}
26
- `;
27
- };
28
- #airplaySourceEl = null;
29
- #config = null;
30
- constructor() {
31
- super();
32
- this.#upgradeProperty("config");
33
- }
34
- get config() {
35
- return this.#config;
36
- }
37
- set config(value) {
38
- this.#config = value;
39
- }
40
- attributeChangedCallback(attrName, oldValue, newValue) {
41
- if (attrName !== "src") {
42
- super.attributeChangedCallback(attrName, oldValue, newValue);
43
- }
44
- if (attrName === "src" && oldValue != newValue) {
45
- this.load();
46
- }
47
- }
48
- #destroy() {
49
- var _a, _b;
50
- (_a = this.#airplaySourceEl) == null ? void 0 : _a.remove();
51
- (_b = this.nativeEl) == null ? void 0 : _b.removeEventListener(
52
- "webkitcurrentplaybacktargetiswirelesschanged",
53
- this.#toggleHlsLoad
54
- );
55
- if (this.api) {
56
- this.api.detachMedia();
57
- this.api.destroy();
58
- this.api = null;
59
- }
60
- }
61
- async load() {
62
- var _a, _b;
63
- const isFirstLoad = !this.api;
64
- this.#destroy();
65
- if (!this.src) {
66
- return;
67
- }
68
- if (isFirstLoad && !this.#config) {
69
- this.#config = JSON.parse(((_a = this.shadowRoot.getElementById("config")) == null ? void 0 : _a.textContent) || "{}");
70
- }
71
- if (hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].isSupported()) {
72
- await Promise.resolve();
73
- this.api = new hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]({
74
- // Mimic the media element with an Infinity duration for live streams.
75
- liveDurationInfinity: true,
76
- // Disable auto quality level/fragment loading.
77
- autoStartLoad: false,
78
- // Custom configuration for hls.js.
79
- ...this.config
80
- });
81
- this.api.loadSource(this.src);
82
- this.api.attachMedia(this.nativeEl);
83
- switch (this.nativeEl.preload) {
84
- case "none": {
85
- const loadSourceOnPlay = () => this.api.startLoad();
86
- this.nativeEl.addEventListener("play", loadSourceOnPlay, {
87
- once: true
88
- });
89
- this.api.on(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.DESTROYING, () => {
90
- this.nativeEl.removeEventListener("play", loadSourceOnPlay);
91
- });
92
- break;
93
- }
94
- case "metadata": {
95
- const originalLength = this.api.config.maxBufferLength;
96
- const originalSize = this.api.config.maxBufferSize;
97
- this.api.config.maxBufferLength = 1;
98
- this.api.config.maxBufferSize = 1;
99
- const increaseBufferOnPlay = () => {
100
- this.api.config.maxBufferLength = originalLength;
101
- this.api.config.maxBufferSize = originalSize;
102
- };
103
- this.nativeEl.addEventListener("play", increaseBufferOnPlay, {
104
- once: true
105
- });
106
- this.api.on(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.DESTROYING, () => {
107
- this.nativeEl.removeEventListener("play", increaseBufferOnPlay);
108
- });
109
- this.api.startLoad();
110
- break;
111
- }
112
- default:
113
- this.api.startLoad();
114
- }
115
- if (this.nativeEl.webkitCurrentPlaybackTargetIsWireless) {
116
- this.api.stopLoad();
117
- }
118
- this.nativeEl.addEventListener(
119
- "webkitcurrentplaybacktargetiswirelesschanged",
120
- this.#toggleHlsLoad
121
- );
122
- this.#airplaySourceEl = document.createElement("source");
123
- this.#airplaySourceEl.setAttribute("type", "application/x-mpegURL");
124
- this.#airplaySourceEl.setAttribute("src", this.src);
125
- this.nativeEl.disableRemotePlayback = false;
126
- this.nativeEl.append(this.#airplaySourceEl);
127
- const levelIdMap = /* @__PURE__ */ new WeakMap();
128
- this.api.on(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.MANIFEST_PARSED, (event, data) => {
129
- if (this.nativeEl.autoplay && this.nativeEl.paused) {
130
- this.nativeEl.play().catch((err) => {
131
- console.warn("Autoplay failed:", err);
132
- });
133
- }
134
- removeAllMediaTracks();
135
- let videoTrack = this.videoTracks.getTrackById("main");
136
- if (!videoTrack) {
137
- videoTrack = this.addVideoTrack("main");
138
- videoTrack.id = "main";
139
- videoTrack.selected = true;
140
- }
141
- for (const [id, level] of data.levels.entries()) {
142
- const videoRendition = videoTrack.addRendition(
143
- level.url[0],
144
- level.width,
145
- level.height,
146
- level.videoCodec,
147
- level.bitrate
148
- );
149
- levelIdMap.set(level, `${id}`);
150
- videoRendition.id = `${id}`;
151
- }
152
- for (let [id, a] of data.audioTracks.entries()) {
153
- const kind = a.default ? "main" : "alternative";
154
- const audioTrack = this.addAudioTrack(kind, a.name, a.lang);
155
- audioTrack.id = `${id}`;
156
- if (a.default) {
157
- audioTrack.enabled = true;
158
- }
159
- }
160
- });
161
- this.audioTracks.addEventListener("change", () => {
162
- var _a2;
163
- const audioTrackId = +((_a2 = [...this.audioTracks].find((t) => t.enabled)) == null ? void 0 : _a2.id);
164
- const availableIds = this.api.audioTracks.map((t) => t.id);
165
- if (audioTrackId != this.api.audioTrack && availableIds.includes(audioTrackId)) {
166
- this.api.audioTrack = audioTrackId;
167
- }
168
- });
169
- this.api.on(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.LEVELS_UPDATED, (event, data) => {
170
- const videoTrack = this.videoTracks[this.videoTracks.selectedIndex ?? 0];
171
- if (!videoTrack) return;
172
- const levelIds = data.levels.map((l) => levelIdMap.get(l));
173
- for (const rendition of this.videoRenditions) {
174
- if (rendition.id && !levelIds.includes(rendition.id)) {
175
- videoTrack.removeRendition(rendition);
176
- }
177
- }
178
- });
179
- let lastFailedLevel = null;
180
- this.api.on(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.ERROR, (event, data) => {
181
- if (data.type === hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].ErrorTypes.NETWORK_ERROR && data.details === hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].ErrorDetails.FRAG_LOAD_ERROR) {
182
- lastFailedLevel = data.frag.level;
183
- }
184
- });
185
- this.api.on(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.LEVEL_SWITCHED, (event, data) => {
186
- const newLevel = data.level;
187
- if (lastFailedLevel !== null && newLevel < lastFailedLevel) {
188
- console.warn(
189
- `\u26A0\uFE0F hls.js downgraded quality from level ${lastFailedLevel} to ${newLevel} due to fragment load failure.`
190
- );
191
- this.videoRenditions.selectedIndex = newLevel;
192
- lastFailedLevel = null;
193
- }
194
- });
195
- const switchRendition = (event) => {
196
- const level = event.target.selectedIndex;
197
- if (level != this.api.nextLevel) {
198
- this.api.nextLevel = level;
199
- }
200
- };
201
- (_b = this.videoRenditions) == null ? void 0 : _b.addEventListener("change", switchRendition);
202
- const removeAllMediaTracks = () => {
203
- for (const videoTrack of this.videoTracks) {
204
- this.removeVideoTrack(videoTrack);
205
- }
206
- for (const audioTrack of this.audioTracks) {
207
- this.removeAudioTrack(audioTrack);
208
- }
209
- };
210
- this.api.once(hls_js_dist_hls_mjs__WEBPACK_IMPORTED_MODULE_2__["default"].Events.DESTROYING, removeAllMediaTracks);
211
- return;
212
- }
213
- await Promise.resolve();
214
- if (this.nativeEl.canPlayType("application/vnd.apple.mpegurl")) {
215
- this.nativeEl.src = this.src;
216
- }
217
- }
218
- #toggleHlsLoad = () => {
219
- var _a, _b, _c;
220
- if ((_a = this.nativeEl) == null ? void 0 : _a.webkitCurrentPlaybackTargetIsWireless) {
221
- (_b = this.api) == null ? void 0 : _b.stopLoad();
222
- } else {
223
- (_c = this.api) == null ? void 0 : _c.startLoad();
224
- }
225
- };
226
- // This is a pattern to update property values that are set before
227
- // the custom element is upgraded.
228
- // https://web.dev/custom-elements-best-practices/#make-properties-lazy
229
- #upgradeProperty(prop) {
230
- if (Object.prototype.hasOwnProperty.call(this, prop)) {
231
- const value = this[prop];
232
- delete this[prop];
233
- this[prop] = value;
234
- }
235
- }
236
- };
237
- };
238
- const HlsVideoElement = HlsVideoMixin((0,media_tracks__WEBPACK_IMPORTED_MODULE_1__.MediaTracksMixin)(custom_media_element__WEBPACK_IMPORTED_MODULE_0__.CustomVideoElement));
239
- if (globalThis.customElements && !globalThis.customElements.get("hls-video")) {
240
- globalThis.customElements.define("hls-video", HlsVideoElement);
241
- }
242
- var hls_video_element_default = HlsVideoElement;
243
-
244
-
245
-
246
- }),
247
- "./node_modules/hls-video-element/dist/react.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
248
- __webpack_require__.r(__webpack_exports__);
249
- __webpack_require__.d(__webpack_exports__, {
250
- "default": () => (react_default)
251
- });
252
- /* import */var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("react");
253
- /* import */var _hls_video_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/hls-video-element/dist/hls-video-element.js");
254
- "use client";
255
-
256
- // dist/react.ts
257
-
258
-
259
-
260
- // ../../node_modules/ce-la-react/dist/ce-la-react.js
261
- var reservedReactProps = /* @__PURE__ */ new Set([
262
- "style",
263
- "children",
264
- "ref",
265
- "key",
266
- "suppressContentEditableWarning",
267
- "suppressHydrationWarning",
268
- "dangerouslySetInnerHTML"
269
- ]);
270
- var reactPropToAttrNameMap = {
271
- className: "class",
272
- htmlFor: "for"
273
- };
274
- function defaultToAttributeName(propName) {
275
- return propName.toLowerCase();
276
- }
277
- function defaultToAttributeValue(propValue) {
278
- if (typeof propValue === "boolean") return propValue ? "" : void 0;
279
- if (typeof propValue === "function") return void 0;
280
- if (typeof propValue === "object" && propValue !== null) return void 0;
281
- return propValue;
282
- }
283
- function createComponent({
284
- react: React2,
285
- tagName,
286
- elementClass,
287
- events,
288
- displayName,
289
- defaultProps,
290
- toAttributeName = defaultToAttributeName,
291
- toAttributeValue = defaultToAttributeValue
292
- }) {
293
- const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;
294
- const ReactComponent = React2.forwardRef((props, ref) => {
295
- var _a, _b;
296
- const elementRef = React2.useRef(null);
297
- const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());
298
- const eventProps = {};
299
- const attrs = {};
300
- const reactProps = {};
301
- const elementProps = {};
302
- for (const [k, v] of Object.entries(props)) {
303
- if (reservedReactProps.has(k)) {
304
- reactProps[k] = v;
305
- continue;
306
- }
307
- const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);
308
- 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))) {
309
- elementProps[k] = v;
310
- continue;
311
- }
312
- if (k.startsWith("on")) {
313
- eventProps[k] = v;
314
- continue;
315
- }
316
- const attrValue = toAttributeValue(v);
317
- if (attrName && attrValue != null) {
318
- attrs[attrName] = String(attrValue);
319
- if (!IS_REACT_19_OR_NEWER) {
320
- reactProps[attrName] = attrValue;
321
- }
322
- }
323
- if (attrName && IS_REACT_19_OR_NEWER) {
324
- const attrValueFromDefault = defaultToAttributeValue(v);
325
- if (attrValue !== attrValueFromDefault) {
326
- reactProps[attrName] = attrValue;
327
- } else {
328
- reactProps[attrName] = v;
329
- }
330
- }
331
- }
332
- if (typeof window !== "undefined") {
333
- for (const propName in eventProps) {
334
- const callback = eventProps[propName];
335
- const useCapture = propName.endsWith("Capture");
336
- const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(
337
- 0,
338
- useCapture ? -7 : void 0
339
- );
340
- React2.useLayoutEffect(() => {
341
- const eventTarget = elementRef == null ? void 0 : elementRef.current;
342
- if (!eventTarget || typeof callback !== "function") return;
343
- eventTarget.addEventListener(eventName, callback, useCapture);
344
- return () => {
345
- eventTarget.removeEventListener(eventName, callback, useCapture);
346
- };
347
- }, [elementRef == null ? void 0 : elementRef.current, callback]);
348
- }
349
- React2.useLayoutEffect(() => {
350
- if (elementRef.current === null) return;
351
- const newElemProps = /* @__PURE__ */ new Map();
352
- for (const key in elementProps) {
353
- setProperty(elementRef.current, key, elementProps[key]);
354
- prevElemPropsRef.current.delete(key);
355
- newElemProps.set(key, elementProps[key]);
356
- }
357
- for (const [key, _value] of prevElemPropsRef.current) {
358
- setProperty(elementRef.current, key, void 0);
359
- }
360
- prevElemPropsRef.current = newElemProps;
361
- });
362
- }
363
- if (typeof window === "undefined" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {
364
- const { mode, delegatesFocus } = elementClass.shadowRootOptions;
365
- const templateShadowRoot = React2.createElement("template", {
366
- shadowrootmode: mode,
367
- shadowrootdelegatesfocus: delegatesFocus,
368
- dangerouslySetInnerHTML: {
369
- __html: elementClass.getTemplateHTML(attrs, props)
370
- }
371
- });
372
- reactProps.children = [templateShadowRoot, reactProps.children];
373
- }
374
- return React2.createElement(tagName, {
375
- ...defaultProps,
376
- ...reactProps,
377
- ref: React2.useCallback(
378
- (node) => {
379
- elementRef.current = node;
380
- if (typeof ref === "function") {
381
- ref(node);
382
- } else if (ref !== null) {
383
- ref.current = node;
384
- }
385
- },
386
- [ref]
387
- )
388
- });
389
- });
390
- ReactComponent.displayName = displayName ?? elementClass.name;
391
- return ReactComponent;
392
- }
393
- function setProperty(node, name, value) {
394
- var _a;
395
- node[name] = value;
396
- if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {
397
- node.removeAttribute(name);
398
- }
399
- }
400
-
401
- // dist/react.ts
402
- var react_default = createComponent({
403
- react: react__WEBPACK_IMPORTED_MODULE_0__["default"],
404
- tagName: "hls-video",
405
- elementClass: _hls_video_element_js__WEBPACK_IMPORTED_MODULE_1__["default"],
406
- toAttributeName(propName) {
407
- if (propName === "muted") return "";
408
- if (propName === "defaultMuted") return "muted";
409
- return defaultToAttributeName(propName);
410
- }
411
- });
412
-
413
- /*! Bundled license information:
414
-
415
- ce-la-react/dist/ce-la-react.js:
416
- (**
417
- * @license
418
- * Copyright 2018 Google LLC
419
- * SPDX-License-Identifier: BSD-3-Clause
420
- *
421
- * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
422
- *)
423
- */
424
-
425
-
426
- }),
427
-
428
- }])
429
- //# sourceMappingURL=reactPlayerHls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async/reactPlayerHls.js","sources":["/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/hls-video-element/dist/hls-video-element.js","/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/hls-video-element/dist/react.js"],"sourcesContent":["import { CustomVideoElement } from \"custom-media-element\";\nimport { MediaTracksMixin } from \"media-tracks\";\nimport Hls from \"hls.js/dist/hls.mjs\";\nconst HlsVideoMixin = (superclass) => {\n return class HlsVideo extends superclass {\n static shadowRootOptions = { ...superclass.shadowRootOptions };\n static getTemplateHTML = (attrs, props = {}) => {\n const { src, ...rest } = attrs;\n return `\n <script type=\"application/json\" id=\"config\">\n ${JSON.stringify(props.config || {})}\n </script>\n ${superclass.getTemplateHTML(rest)}\n `;\n };\n #airplaySourceEl = null;\n #config = null;\n constructor() {\n super();\n this.#upgradeProperty(\"config\");\n }\n get config() {\n return this.#config;\n }\n set config(value) {\n this.#config = value;\n }\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName !== \"src\") {\n super.attributeChangedCallback(attrName, oldValue, newValue);\n }\n if (attrName === \"src\" && oldValue != newValue) {\n this.load();\n }\n }\n #destroy() {\n var _a, _b;\n (_a = this.#airplaySourceEl) == null ? void 0 : _a.remove();\n (_b = this.nativeEl) == null ? void 0 : _b.removeEventListener(\n \"webkitcurrentplaybacktargetiswirelesschanged\",\n this.#toggleHlsLoad\n );\n if (this.api) {\n this.api.detachMedia();\n this.api.destroy();\n this.api = null;\n }\n }\n async load() {\n var _a, _b;\n const isFirstLoad = !this.api;\n this.#destroy();\n if (!this.src) {\n return;\n }\n if (isFirstLoad && !this.#config) {\n this.#config = JSON.parse(((_a = this.shadowRoot.getElementById(\"config\")) == null ? void 0 : _a.textContent) || \"{}\");\n }\n if (Hls.isSupported()) {\n await Promise.resolve();\n this.api = new Hls({\n // Mimic the media element with an Infinity duration for live streams.\n liveDurationInfinity: true,\n // Disable auto quality level/fragment loading.\n autoStartLoad: false,\n // Custom configuration for hls.js.\n ...this.config\n });\n this.api.loadSource(this.src);\n this.api.attachMedia(this.nativeEl);\n switch (this.nativeEl.preload) {\n case \"none\": {\n const loadSourceOnPlay = () => this.api.startLoad();\n this.nativeEl.addEventListener(\"play\", loadSourceOnPlay, {\n once: true\n });\n this.api.on(Hls.Events.DESTROYING, () => {\n this.nativeEl.removeEventListener(\"play\", loadSourceOnPlay);\n });\n break;\n }\n case \"metadata\": {\n const originalLength = this.api.config.maxBufferLength;\n const originalSize = this.api.config.maxBufferSize;\n this.api.config.maxBufferLength = 1;\n this.api.config.maxBufferSize = 1;\n const increaseBufferOnPlay = () => {\n this.api.config.maxBufferLength = originalLength;\n this.api.config.maxBufferSize = originalSize;\n };\n this.nativeEl.addEventListener(\"play\", increaseBufferOnPlay, {\n once: true\n });\n this.api.on(Hls.Events.DESTROYING, () => {\n this.nativeEl.removeEventListener(\"play\", increaseBufferOnPlay);\n });\n this.api.startLoad();\n break;\n }\n default:\n this.api.startLoad();\n }\n if (this.nativeEl.webkitCurrentPlaybackTargetIsWireless) {\n this.api.stopLoad();\n }\n this.nativeEl.addEventListener(\n \"webkitcurrentplaybacktargetiswirelesschanged\",\n this.#toggleHlsLoad\n );\n this.#airplaySourceEl = document.createElement(\"source\");\n this.#airplaySourceEl.setAttribute(\"type\", \"application/x-mpegURL\");\n this.#airplaySourceEl.setAttribute(\"src\", this.src);\n this.nativeEl.disableRemotePlayback = false;\n this.nativeEl.append(this.#airplaySourceEl);\n const levelIdMap = /* @__PURE__ */ new WeakMap();\n this.api.on(Hls.Events.MANIFEST_PARSED, (event, data) => {\n if (this.nativeEl.autoplay && this.nativeEl.paused) {\n this.nativeEl.play().catch((err) => {\n console.warn(\"Autoplay failed:\", err);\n });\n }\n removeAllMediaTracks();\n let videoTrack = this.videoTracks.getTrackById(\"main\");\n if (!videoTrack) {\n videoTrack = this.addVideoTrack(\"main\");\n videoTrack.id = \"main\";\n videoTrack.selected = true;\n }\n for (const [id, level] of data.levels.entries()) {\n const videoRendition = videoTrack.addRendition(\n level.url[0],\n level.width,\n level.height,\n level.videoCodec,\n level.bitrate\n );\n levelIdMap.set(level, `${id}`);\n videoRendition.id = `${id}`;\n }\n for (let [id, a] of data.audioTracks.entries()) {\n const kind = a.default ? \"main\" : \"alternative\";\n const audioTrack = this.addAudioTrack(kind, a.name, a.lang);\n audioTrack.id = `${id}`;\n if (a.default) {\n audioTrack.enabled = true;\n }\n }\n });\n this.audioTracks.addEventListener(\"change\", () => {\n var _a2;\n const audioTrackId = +((_a2 = [...this.audioTracks].find((t) => t.enabled)) == null ? void 0 : _a2.id);\n const availableIds = this.api.audioTracks.map((t) => t.id);\n if (audioTrackId != this.api.audioTrack && availableIds.includes(audioTrackId)) {\n this.api.audioTrack = audioTrackId;\n }\n });\n this.api.on(Hls.Events.LEVELS_UPDATED, (event, data) => {\n const videoTrack = this.videoTracks[this.videoTracks.selectedIndex ?? 0];\n if (!videoTrack) return;\n const levelIds = data.levels.map((l) => levelIdMap.get(l));\n for (const rendition of this.videoRenditions) {\n if (rendition.id && !levelIds.includes(rendition.id)) {\n videoTrack.removeRendition(rendition);\n }\n }\n });\n let lastFailedLevel = null;\n this.api.on(Hls.Events.ERROR, (event, data) => {\n if (data.type === Hls.ErrorTypes.NETWORK_ERROR && data.details === Hls.ErrorDetails.FRAG_LOAD_ERROR) {\n lastFailedLevel = data.frag.level;\n }\n });\n this.api.on(Hls.Events.LEVEL_SWITCHED, (event, data) => {\n const newLevel = data.level;\n if (lastFailedLevel !== null && newLevel < lastFailedLevel) {\n console.warn(\n `\\u26A0\\uFE0F hls.js downgraded quality from level ${lastFailedLevel} to ${newLevel} due to fragment load failure.`\n );\n this.videoRenditions.selectedIndex = newLevel;\n lastFailedLevel = null;\n }\n });\n const switchRendition = (event) => {\n const level = event.target.selectedIndex;\n if (level != this.api.nextLevel) {\n this.api.nextLevel = level;\n }\n };\n (_b = this.videoRenditions) == null ? void 0 : _b.addEventListener(\"change\", switchRendition);\n const removeAllMediaTracks = () => {\n for (const videoTrack of this.videoTracks) {\n this.removeVideoTrack(videoTrack);\n }\n for (const audioTrack of this.audioTracks) {\n this.removeAudioTrack(audioTrack);\n }\n };\n this.api.once(Hls.Events.DESTROYING, removeAllMediaTracks);\n return;\n }\n await Promise.resolve();\n if (this.nativeEl.canPlayType(\"application/vnd.apple.mpegurl\")) {\n this.nativeEl.src = this.src;\n }\n }\n #toggleHlsLoad = () => {\n var _a, _b, _c;\n if ((_a = this.nativeEl) == null ? void 0 : _a.webkitCurrentPlaybackTargetIsWireless) {\n (_b = this.api) == null ? void 0 : _b.stopLoad();\n } else {\n (_c = this.api) == null ? void 0 : _c.startLoad();\n }\n };\n // This is a pattern to update property values that are set before\n // the custom element is upgraded.\n // https://web.dev/custom-elements-best-practices/#make-properties-lazy\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n };\n};\nconst HlsVideoElement = HlsVideoMixin(MediaTracksMixin(CustomVideoElement));\nif (globalThis.customElements && !globalThis.customElements.get(\"hls-video\")) {\n globalThis.customElements.define(\"hls-video\", HlsVideoElement);\n}\nvar hls_video_element_default = HlsVideoElement;\nexport {\n Hls,\n HlsVideoElement,\n HlsVideoMixin,\n hls_video_element_default as default\n};\n","\"use client\";\n\n// dist/react.ts\nimport React from \"react\";\nimport CustomMediaElement from \"./hls-video-element.js\";\n\n// ../../node_modules/ce-la-react/dist/ce-la-react.js\nvar reservedReactProps = /* @__PURE__ */ new Set([\n \"style\",\n \"children\",\n \"ref\",\n \"key\",\n \"suppressContentEditableWarning\",\n \"suppressHydrationWarning\",\n \"dangerouslySetInnerHTML\"\n]);\nvar reactPropToAttrNameMap = {\n className: \"class\",\n htmlFor: \"for\"\n};\nfunction defaultToAttributeName(propName) {\n return propName.toLowerCase();\n}\nfunction defaultToAttributeValue(propValue) {\n if (typeof propValue === \"boolean\") return propValue ? \"\" : void 0;\n if (typeof propValue === \"function\") return void 0;\n if (typeof propValue === \"object\" && propValue !== null) return void 0;\n return propValue;\n}\nfunction createComponent({\n react: React2,\n tagName,\n elementClass,\n events,\n displayName,\n defaultProps,\n toAttributeName = defaultToAttributeName,\n toAttributeValue = defaultToAttributeValue\n}) {\n const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;\n const ReactComponent = React2.forwardRef((props, ref) => {\n var _a, _b;\n const elementRef = React2.useRef(null);\n const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());\n const eventProps = {};\n const attrs = {};\n const reactProps = {};\n const elementProps = {};\n for (const [k, v] of Object.entries(props)) {\n if (reservedReactProps.has(k)) {\n reactProps[k] = v;\n continue;\n }\n const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);\n 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))) {\n elementProps[k] = v;\n continue;\n }\n if (k.startsWith(\"on\")) {\n eventProps[k] = v;\n continue;\n }\n const attrValue = toAttributeValue(v);\n if (attrName && attrValue != null) {\n attrs[attrName] = String(attrValue);\n if (!IS_REACT_19_OR_NEWER) {\n reactProps[attrName] = attrValue;\n }\n }\n if (attrName && IS_REACT_19_OR_NEWER) {\n const attrValueFromDefault = defaultToAttributeValue(v);\n if (attrValue !== attrValueFromDefault) {\n reactProps[attrName] = attrValue;\n } else {\n reactProps[attrName] = v;\n }\n }\n }\n if (typeof window !== \"undefined\") {\n for (const propName in eventProps) {\n const callback = eventProps[propName];\n const useCapture = propName.endsWith(\"Capture\");\n const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(\n 0,\n useCapture ? -7 : void 0\n );\n React2.useLayoutEffect(() => {\n const eventTarget = elementRef == null ? void 0 : elementRef.current;\n if (!eventTarget || typeof callback !== \"function\") return;\n eventTarget.addEventListener(eventName, callback, useCapture);\n return () => {\n eventTarget.removeEventListener(eventName, callback, useCapture);\n };\n }, [elementRef == null ? void 0 : elementRef.current, callback]);\n }\n React2.useLayoutEffect(() => {\n if (elementRef.current === null) return;\n const newElemProps = /* @__PURE__ */ new Map();\n for (const key in elementProps) {\n setProperty(elementRef.current, key, elementProps[key]);\n prevElemPropsRef.current.delete(key);\n newElemProps.set(key, elementProps[key]);\n }\n for (const [key, _value] of prevElemPropsRef.current) {\n setProperty(elementRef.current, key, void 0);\n }\n prevElemPropsRef.current = newElemProps;\n });\n }\n if (typeof window === \"undefined\" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {\n const { mode, delegatesFocus } = elementClass.shadowRootOptions;\n const templateShadowRoot = React2.createElement(\"template\", {\n shadowrootmode: mode,\n shadowrootdelegatesfocus: delegatesFocus,\n dangerouslySetInnerHTML: {\n __html: elementClass.getTemplateHTML(attrs, props)\n }\n });\n reactProps.children = [templateShadowRoot, reactProps.children];\n }\n return React2.createElement(tagName, {\n ...defaultProps,\n ...reactProps,\n ref: React2.useCallback(\n (node) => {\n elementRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref !== null) {\n ref.current = node;\n }\n },\n [ref]\n )\n });\n });\n ReactComponent.displayName = displayName ?? elementClass.name;\n return ReactComponent;\n}\nfunction setProperty(node, name, value) {\n var _a;\n node[name] = value;\n if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {\n node.removeAttribute(name);\n }\n}\n\n// dist/react.ts\nvar react_default = createComponent({\n react: React,\n tagName: \"hls-video\",\n elementClass: CustomMediaElement,\n toAttributeName(propName) {\n if (propName === \"muted\") return \"\";\n if (propName === \"defaultMuted\") return \"muted\";\n return defaultToAttributeName(propName);\n }\n});\nexport {\n react_default as default\n};\n/*! Bundled license information:\n\nce-la-react/dist/ce-la-react.js:\n (**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Modified version of `@lit/react` for vanilla custom elements with support for SSR.\n *)\n*/\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;;;;;;;;;;;AC3OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}