@videojs/html 10.0.0-beta.10 → 10.0.0-beta.11
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/cdn/audio-minimal.dev.js +4 -3
- package/cdn/audio-minimal.dev.js.map +1 -1
- package/cdn/audio-minimal.js +1 -1
- package/cdn/audio-minimal.js.map +1 -1
- package/cdn/audio.dev.js +4 -3
- package/cdn/audio.dev.js.map +1 -1
- package/cdn/audio.js +1 -1
- package/cdn/audio.js.map +1 -1
- package/cdn/background.dev.js +3 -2
- package/cdn/background.dev.js.map +1 -1
- package/cdn/background.js +1 -1
- package/cdn/background.js.map +1 -1
- package/cdn/{context-DTY0nOpS.js → context-Be8C5kVd.js} +70 -2
- package/cdn/context-Be8C5kVd.js.map +1 -0
- package/cdn/context-CUBywtsB.js +14 -0
- package/cdn/context-CUBywtsB.js.map +1 -0
- package/cdn/{create-player-Cwxvswyv.js → create-player-AcfnN3li.js} +3 -3
- package/cdn/{create-player-Cwxvswyv.js.map → create-player-AcfnN3li.js.map} +1 -1
- package/cdn/create-player-s_qISCpw.js +7 -0
- package/cdn/{create-player-BTIU8EwT.js.map → create-player-s_qISCpw.js.map} +1 -1
- package/cdn/{proxy-2oO2ph3m.js → custom-media-element-DqevSVgS.js} +6 -6
- package/cdn/custom-media-element-DqevSVgS.js.map +1 -0
- package/cdn/{proxy-dR7IDk37.js → custom-media-element-moFa3UZp.js} +2 -48
- package/cdn/custom-media-element-moFa3UZp.js.map +1 -0
- package/cdn/delegate-CzAcT1xm.js +44 -0
- package/cdn/delegate-CzAcT1xm.js.map +1 -0
- package/cdn/delegate-Uc-6tQDR.js +2 -0
- package/cdn/delegate-Uc-6tQDR.js.map +1 -0
- package/cdn/{listen-DX5vU4s4.js → listen-4jqsRSKo.js} +1 -1
- package/cdn/{listen-DX5vU4s4.js.map → listen-4jqsRSKo.js.map} +1 -1
- package/cdn/{listen-BXAYCbZA.js → listen-YSH3Jfyk.js} +1 -1
- package/cdn/{listen-BXAYCbZA.js.map → listen-YSH3Jfyk.js.map} +1 -1
- package/cdn/media/dash-video.dev.js +4 -2
- package/cdn/media/dash-video.dev.js.map +1 -1
- package/cdn/media/dash-video.js +2 -2
- package/cdn/media/dash-video.js.map +1 -1
- package/cdn/media/hls-video.dev.js +5 -3
- package/cdn/media/hls-video.dev.js.map +1 -1
- package/cdn/media/hls-video.js +2 -2
- package/cdn/media/hls-video.js.map +1 -1
- package/cdn/media/simple-hls-video.dev.js +684 -546
- package/cdn/media/simple-hls-video.dev.js.map +1 -1
- package/cdn/media/simple-hls-video.js +1 -1
- package/cdn/media/simple-hls-video.js.map +1 -1
- package/cdn/{media-attach-mixin-tFNcHnvo.js → media-attach-mixin-D5_nfJpa.js} +2 -2
- package/cdn/{media-attach-mixin-tFNcHnvo.js.map → media-attach-mixin-D5_nfJpa.js.map} +1 -1
- package/cdn/{media-attach-mixin-ChyNp2eK.js → media-attach-mixin-U_KQB_9O.js} +2 -2
- package/cdn/{media-attach-mixin-ChyNp2eK.js.map → media-attach-mixin-U_KQB_9O.js.map} +1 -1
- package/cdn/{player-BHhLXO-R.js → player-C46h14iP.js} +2 -2
- package/cdn/{player-BHhLXO-R.js.map → player-C46h14iP.js.map} +1 -1
- package/cdn/{player-DEfj0RU6.js → player-CvrOeLpy.js} +2 -2
- package/cdn/{player-DEfj0RU6.js.map → player-CvrOeLpy.js.map} +1 -1
- package/cdn/{poster-Dd0F1rRd.js → poster-Olv5zDI_.js} +4 -4
- package/cdn/{poster-Dd0F1rRd.js.map → poster-Olv5zDI_.js.map} +1 -1
- package/cdn/{poster-DwQ3RAch.js → poster-odJ4iwIv.js} +2 -2
- package/cdn/{poster-DwQ3RAch.js.map → poster-odJ4iwIv.js.map} +1 -1
- package/cdn/video-minimal.dev.js +4 -3
- package/cdn/video-minimal.dev.js.map +1 -1
- package/cdn/video-minimal.js +1 -1
- package/cdn/video-minimal.js.map +1 -1
- package/cdn/video.dev.js +4 -4
- package/cdn/video.js +1 -1
- package/cdn/{volume-slider-DgJ0rAfC.js → volume-slider-D7BOdSDF.js} +3 -3
- package/cdn/{volume-slider-DgJ0rAfC.js.map → volume-slider-D7BOdSDF.js.map} +1 -1
- package/cdn/{volume-slider-Pd0AMTCH.js → volume-slider-DPeFF5tt.js} +2 -2
- package/cdn/{volume-slider-Pd0AMTCH.js.map → volume-slider-DPeFF5tt.js.map} +1 -1
- package/dist/default/index.js +2 -1
- package/dist/default/ui/alert-dialog/alert-dialog-element.js +1 -1
- package/dist/default/ui/buffering-indicator/buffering-indicator-element.js +1 -1
- package/dist/default/ui/captions-button/captions-button-element.js +1 -1
- package/dist/default/ui/controls/controls-element.js +1 -1
- package/dist/default/ui/fullscreen-button/fullscreen-button-element.js +1 -1
- package/dist/default/ui/mute-button/mute-button-element.js +1 -1
- package/dist/default/ui/pip-button/pip-button-element.js +1 -1
- package/dist/default/ui/play-button/play-button-element.js +1 -1
- package/dist/default/ui/playback-rate-button/playback-rate-button-element.js +1 -1
- package/dist/default/ui/popover/popover-element.js +1 -1
- package/dist/default/ui/poster/poster-element.js +1 -1
- package/dist/default/ui/seek-button/seek-button-element.js +1 -1
- package/dist/default/ui/slider/slider-element.js +1 -1
- package/dist/default/ui/thumbnail/thumbnail-element.js +1 -1
- package/dist/default/ui/time/time-element.js +1 -1
- package/dist/default/ui/time-slider/time-slider-element.js +1 -1
- package/dist/default/ui/tooltip/tooltip-element.js +1 -1
- package/dist/default/ui/tooltip/tooltip-group-element.js +1 -1
- package/dist/default/ui/volume-slider/volume-slider-element.js +1 -1
- package/dist/dev/index.d.ts +2 -1
- package/dist/dev/index.js +2 -1
- package/dist/dev/ui/alert-dialog/alert-dialog-description-element.d.ts +1 -1
- package/dist/dev/ui/alert-dialog/alert-dialog-element.js +1 -1
- package/dist/dev/ui/alert-dialog/alert-dialog-title-element.d.ts +1 -1
- package/dist/dev/ui/buffering-indicator/buffering-indicator-element.js +1 -1
- package/dist/dev/ui/captions-button/captions-button-element.d.ts +1 -1
- package/dist/dev/ui/captions-button/captions-button-element.js +1 -1
- package/dist/dev/ui/context-part-element.d.ts +1 -1
- package/dist/dev/ui/controls/controls-element.js +1 -1
- package/dist/dev/ui/controls/controls-group-element.d.ts +1 -1
- package/dist/dev/ui/fullscreen-button/fullscreen-button-element.d.ts +1 -1
- package/dist/dev/ui/fullscreen-button/fullscreen-button-element.js +1 -1
- package/dist/dev/ui/media-button-element.d.ts +1 -1
- package/dist/dev/ui/media-ui-element.d.ts +1 -1
- package/dist/dev/ui/mute-button/mute-button-element.d.ts +1 -1
- package/dist/dev/ui/mute-button/mute-button-element.js +1 -1
- package/dist/dev/ui/pip-button/pip-button-element.d.ts +1 -1
- package/dist/dev/ui/pip-button/pip-button-element.js +1 -1
- package/dist/dev/ui/play-button/play-button-element.d.ts +1 -1
- package/dist/dev/ui/play-button/play-button-element.js +1 -1
- package/dist/dev/ui/playback-rate-button/playback-rate-button-element.d.ts +1 -1
- package/dist/dev/ui/playback-rate-button/playback-rate-button-element.js +1 -1
- package/dist/dev/ui/popover/popover-element.d.ts +1 -1
- package/dist/dev/ui/popover/popover-element.js +1 -1
- package/dist/dev/ui/poster/poster-element.d.ts +1 -1
- package/dist/dev/ui/poster/poster-element.js +1 -1
- package/dist/dev/ui/seek-button/seek-button-element.d.ts +1 -1
- package/dist/dev/ui/seek-button/seek-button-element.js +1 -1
- package/dist/dev/ui/slider/context.d.ts +1 -1
- package/dist/dev/ui/slider/slider-buffer-element.d.ts +1 -1
- package/dist/dev/ui/slider/slider-element.d.ts +1 -1
- package/dist/dev/ui/slider/slider-element.js +1 -1
- package/dist/dev/ui/slider/slider-fill-element.d.ts +1 -1
- package/dist/dev/ui/slider/slider-track-element.d.ts +1 -1
- package/dist/dev/ui/thumbnail/thumbnail-element.d.ts +1 -1
- package/dist/dev/ui/thumbnail/thumbnail-element.js +1 -1
- package/dist/dev/ui/time/time-element.d.ts +1 -1
- package/dist/dev/ui/time/time-element.js +1 -1
- package/dist/dev/ui/time-slider/time-slider-element.d.ts +1 -1
- package/dist/dev/ui/time-slider/time-slider-element.js +1 -1
- package/dist/dev/ui/tooltip/tooltip-element.d.ts +1 -1
- package/dist/dev/ui/tooltip/tooltip-element.js +1 -1
- package/dist/dev/ui/tooltip/tooltip-group-element.js +1 -1
- package/dist/dev/ui/volume-slider/volume-slider-element.d.ts +1 -1
- package/dist/dev/ui/volume-slider/volume-slider-element.js +1 -1
- package/package.json +10 -10
- package/cdn/context-C_e06fGU.js +0 -13
- package/cdn/context-C_e06fGU.js.map +0 -1
- package/cdn/context-DTY0nOpS.js.map +0 -1
- package/cdn/create-player-BTIU8EwT.js +0 -7
- package/cdn/proxy-2oO2ph3m.js.map +0 -1
- package/cdn/proxy-6KS6wy69.js +0 -2
- package/cdn/proxy-6KS6wy69.js.map +0 -1
- package/cdn/proxy-XzDf9gyk.js +0 -66
- package/cdn/proxy-XzDf9gyk.js.map +0 -1
- package/cdn/proxy-dR7IDk37.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const e=`abort.canplay.canplaythrough.durationchange.emptied.encrypted.ended.error.loadeddata.loadedmetadata.loadstart.pause.play.playing.progress.ratechange.seeked.seeking.stalled.suspend.timeupdate.volumechange.waiting.waitingforkey.resize.enterpictureinpicture.leavepictureinpicture.webkitbeginfullscreen.webkitendfullscreen.webkitpresentationmodechanged`.split(`.`),t=[`autopictureinpicture`,`disablepictureinpicture`,`disableremoteplayback`,`autoplay`,`controls`,`controlslist`,`crossorigin`,`loop`,`muted`,`playsinline`,`poster`,`preload`,`src`];function n(e){return`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: inline-flex;
|
|
@@ -12,10 +12,10 @@ import{n as e,t}from"./proxy-6KS6wy69.js";function n(t,n){class r extends t{#e=n
|
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
14
|
<slot name="media">
|
|
15
|
-
<audio${
|
|
15
|
+
<audio${o(e)}></audio>
|
|
16
16
|
</slot>
|
|
17
17
|
<slot></slot>
|
|
18
|
-
`}function
|
|
18
|
+
`}function r(e){return`
|
|
19
19
|
<style>
|
|
20
20
|
:host {
|
|
21
21
|
display: contents;
|
|
@@ -40,8 +40,8 @@ import{n as e,t}from"./proxy-6KS6wy69.js";function n(t,n){class r extends t{#e=n
|
|
|
40
40
|
}
|
|
41
41
|
</style>
|
|
42
42
|
<slot name="media">
|
|
43
|
-
<video${
|
|
43
|
+
<video${o(e)}></video>
|
|
44
44
|
</slot>
|
|
45
45
|
<slot></slot>
|
|
46
|
-
`}function
|
|
47
|
-
//# sourceMappingURL=
|
|
46
|
+
`}function i(i,{tag:o,is:c}){let l=globalThis.document?.createElement?.(o,{is:c}),u=l?a(l):[];return class a extends i{static getTemplateHTML=o.endsWith(`audio`)?n:r;static shadowRootOptions={mode:`open`};static Events=e;static#e=!1;static#t;static get observedAttributes(){return a.#n(),[...l?.constructor?.observedAttributes??[],...t]}static#n(){if(!a.#e){a.#e=!0,a.#t=new Set(a.observedAttributes),a.#t.delete(`muted`);for(let e of u)if(!(e in a.prototype))if(typeof l[e]==`function`)a.prototype[e]=function(...t){return this.#s(),this.call(e,...t)};else{let t={get(){return this.#s(),this.get(e)}};e!==e.toUpperCase()&&(t.set=function(t){this.#s(),this.set(e,t)}),Object.defineProperty(a.prototype,e,t)}}}#r=!1;#i=null;#a=new Map;#o;get(e){let t=e.toLowerCase();if(a.#t.has(t)){let e=this.getAttribute(t);return e===null?!1:e===``?!0:e}return this.target?.[e]}set(e,t){let n=e.toLowerCase();if(a.#t.has(n)){t===!0||t===!1||t==null?this.toggleAttribute(n,!!t):this.setAttribute(n,t);return}this.target&&(this.target[e]=t)}call(e,...t){return(this.target?.[e])?.apply(this.target,t)}get target(){return this.#s(),this.#i??this.querySelector(`:scope > [slot=media]`)??this.querySelector(o)??this.shadowRoot?.querySelector(o)??null}set target(e){this.#i=e}get defaultMuted(){return this.#s(),this.get(`muted`)}set defaultMuted(e){this.#s(),this.set(`muted`,e)}#s(){this.#r||(this.#r=!0,this.init())}init(){if(!this.shadowRoot){this.attachShadow({mode:`open`});let e=s(this.attributes);c&&(e.is=c),o&&(e.part=o),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.target.muted=this.hasAttribute(`muted`);for(let e of u)this.#d(e);this.#o=new MutationObserver(this.#l.bind(this)),this.shadowRoot.addEventListener(`slotchange`,()=>this.#c()),this.#c();for(let e of this.constructor.Events)this.shadowRoot.addEventListener(e,this,!0)}handleEvent(e){e.target===this.target&&this.dispatchEvent(new CustomEvent(e.type,{detail:e.detail}))}#c(){let e=new Map(this.#a);((this.shadowRoot?.querySelector(`slot:not([name])`))?.assignedElements({flatten:!0}).filter(e=>[`track`,`source`].includes(e.localName))).forEach(t=>{e.delete(t);let n=this.#a.get(t);n||(n=t.cloneNode(),this.#a.set(t,n),this.#o?.observe(t,{attributes:!0})),this.target?.append(n),this.#u(n)}),e.forEach((e,t)=>{e.remove(),this.#a.delete(t)})}#l(e){for(let t of e)if(t.type===`attributes`){let{target:e,attributeName:n}=t,r=this.#a.get(e);r&&n&&(r.setAttribute(n,e.getAttribute(n)??``),this.#u(r))}}#u(e){e&&e.localName===`track`&&e.default&&(e.kind===`chapters`||e.kind===`metadata`)&&e.track.mode===`disabled`&&(e.track.mode=`hidden`)}#d(e){if(Object.hasOwn(this,e)){let t=this[e];delete this[e],this[e]=t}}attributeChangedCallback(e,t,n){this.#s(),this.#f(e,t,n)}#f(e,t,n){[`id`,`class`].includes(e)||!a.observedAttributes.includes(e)&&this.constructor.observedAttributes.includes(e)||(n===null?this.target?.removeAttribute(e):this.target?.getAttribute(e)!==n&&this.target?.setAttribute(e,n))}connectedCallback(){this.#s()}}}function a(e){let t=[];for(let n=Object.getPrototypeOf(e);n&&n!==HTMLElement.prototype;n=Object.getPrototypeOf(n)){let e=Object.getOwnPropertyNames(n);t.push(...e)}return t}function o(e){let n=``;for(let r in e){if(!t.includes(r))continue;let i=e[r];i===``?n+=` ${r}`:n+=` ${r}="${i}"`}return n}function s(e){let t={};for(let n of e)t[n.name]=n.value;return t}i(globalThis.HTMLElement??class{},{tag:`video`}),i(globalThis.HTMLElement??class{},{tag:`audio`});export{i as t};
|
|
47
|
+
//# sourceMappingURL=custom-media-element-DqevSVgS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-media-element-DqevSVgS.js","names":["#isDefined","#propsToAttrs","#define","#init","#target","#isInit","#upgradeProperty","#childObserver","#syncMediaChildAttribute","#syncMediaChildren","#childMap","#enableDefaultTrack","#forwardAttribute"],"sources":["../../core/dist/default/dom/media/custom-media-element/index.js"],"sourcesContent":["//#region src/dom/media/custom-media-element/index.ts\n/**\n* Custom Media Element\n* Based on https://github.com/muxinc/custom-video-element - Mux - MIT License\n*\n* The goal is to create an element that works just like the video element\n* but can be extended/sub-classed, because native elements cannot be\n* extended today across browsers.\n*/\nconst Events = [\n\t\"abort\",\n\t\"canplay\",\n\t\"canplaythrough\",\n\t\"durationchange\",\n\t\"emptied\",\n\t\"encrypted\",\n\t\"ended\",\n\t\"error\",\n\t\"loadeddata\",\n\t\"loadedmetadata\",\n\t\"loadstart\",\n\t\"pause\",\n\t\"play\",\n\t\"playing\",\n\t\"progress\",\n\t\"ratechange\",\n\t\"seeked\",\n\t\"seeking\",\n\t\"stalled\",\n\t\"suspend\",\n\t\"timeupdate\",\n\t\"volumechange\",\n\t\"waiting\",\n\t\"waitingforkey\",\n\t\"resize\",\n\t\"enterpictureinpicture\",\n\t\"leavepictureinpicture\",\n\t\"webkitbeginfullscreen\",\n\t\"webkitendfullscreen\",\n\t\"webkitpresentationmodechanged\"\n];\nconst Attributes = [\n\t\"autopictureinpicture\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"autoplay\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"crossorigin\",\n\t\"loop\",\n\t\"muted\",\n\t\"playsinline\",\n\t\"poster\",\n\t\"preload\",\n\t\"src\"\n];\n/**\n* Helper function to generate the HTML template for audio elements.\n*/\nfunction getAudioTemplateHTML(attrs) {\n\treturn `\n <style>\n :host {\n display: inline-flex;\n line-height: 0;\n flex-direction: column;\n justify-content: end;\n }\n\n audio {\n width: 100%;\n }\n </style>\n <slot name=\"media\">\n <audio${serializeAttributes(attrs)}></audio>\n </slot>\n <slot></slot>\n `;\n}\n/**\n* Helper function to generate the HTML template for video elements.\n*/\nfunction getVideoTemplateHTML(attrs) {\n\treturn `\n <style>\n :host {\n display: contents;\n }\n\n video {\n display: block;\n width: 100%;\n height: 100%;\n border-radius: var(--media-video-border-radius);\n object-fit: var(--media-object-fit, contain);\n object-position: var(--media-object-position, center);\n }\n\n video::-webkit-media-text-track-container {\n transition: translate var(--media-caption-track-duration, 0) ease-out;\n transition-delay: var(--media-caption-track-delay, 0);\n translate: 0 var(--media-caption-track-y, 0);\n scale: 0.98;\n z-index: 1;\n font-family: inherit;\n }\n </style>\n <slot name=\"media\">\n <video${serializeAttributes(attrs)}></video>\n </slot>\n <slot></slot>\n `;\n}\nfunction CustomMediaMixin(superclass, { tag, is }) {\n\tconst nativeElTest = globalThis.document?.createElement?.(tag, { is });\n\tconst nativeElProps = nativeElTest ? getNativeElProps(nativeElTest) : [];\n\treturn class CustomMedia extends superclass {\n\t\tstatic getTemplateHTML = tag.endsWith(\"audio\") ? getAudioTemplateHTML : getVideoTemplateHTML;\n\t\tstatic shadowRootOptions = { mode: \"open\" };\n\t\tstatic Events = Events;\n\t\tstatic #isDefined = false;\n\t\tstatic #propsToAttrs;\n\t\tstatic get observedAttributes() {\n\t\t\tCustomMedia.#define();\n\t\t\treturn [...nativeElTest?.constructor?.observedAttributes ?? [], ...Attributes];\n\t\t}\n\t\tstatic #define() {\n\t\t\tif (CustomMedia.#isDefined) return;\n\t\t\tCustomMedia.#isDefined = true;\n\t\t\tCustomMedia.#propsToAttrs = new Set(CustomMedia.observedAttributes);\n\t\t\tCustomMedia.#propsToAttrs.delete(\"muted\");\n\t\t\tfor (const prop of nativeElProps) {\n\t\t\t\tif (prop in CustomMedia.prototype) continue;\n\t\t\t\tif (typeof nativeElTest[prop] === \"function\") CustomMedia.prototype[prop] = function(...args) {\n\t\t\t\t\tthis.#init();\n\t\t\t\t\treturn this.call(prop, ...args);\n\t\t\t\t};\n\t\t\t\telse {\n\t\t\t\t\tconst config = { get() {\n\t\t\t\t\t\tthis.#init();\n\t\t\t\t\t\treturn this.get(prop);\n\t\t\t\t\t} };\n\t\t\t\t\tif (prop !== prop.toUpperCase()) config.set = function(val) {\n\t\t\t\t\t\tthis.#init();\n\t\t\t\t\t\tthis.set(prop, val);\n\t\t\t\t\t};\n\t\t\t\t\tObject.defineProperty(CustomMedia.prototype, prop, config);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#isInit = false;\n\t\t#target = null;\n\t\t#childMap = /* @__PURE__ */ new Map();\n\t\t#childObserver;\n\t\tget(prop) {\n\t\t\tconst attr = prop.toLowerCase();\n\t\t\tif (CustomMedia.#propsToAttrs.has(attr)) {\n\t\t\t\tconst val = this.getAttribute(attr);\n\t\t\t\treturn val === null ? false : val === \"\" ? true : val;\n\t\t\t}\n\t\t\treturn this.target?.[prop];\n\t\t}\n\t\tset(prop, val) {\n\t\t\tconst attr = prop.toLowerCase();\n\t\t\tif (CustomMedia.#propsToAttrs.has(attr)) {\n\t\t\t\tif (val === true || val === false || val == null) this.toggleAttribute(attr, Boolean(val));\n\t\t\t\telse this.setAttribute(attr, val);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.target) this.target[prop] = val;\n\t\t}\n\t\tcall(prop, ...args) {\n\t\t\treturn (this.target?.[prop])?.apply(this.target, args);\n\t\t}\n\t\tget target() {\n\t\t\tthis.#init();\n\t\t\treturn this.#target ?? this.querySelector(\":scope > [slot=media]\") ?? this.querySelector(tag) ?? this.shadowRoot?.querySelector(tag) ?? null;\n\t\t}\n\t\tset target(val) {\n\t\t\tthis.#target = val;\n\t\t}\n\t\tget defaultMuted() {\n\t\t\tthis.#init();\n\t\t\treturn this.get(\"muted\");\n\t\t}\n\t\tset defaultMuted(val) {\n\t\t\tthis.#init();\n\t\t\tthis.set(\"muted\", val);\n\t\t}\n\t\t#init() {\n\t\t\tif (this.#isInit) return;\n\t\t\tthis.#isInit = true;\n\t\t\tthis.init();\n\t\t}\n\t\tinit() {\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tthis.attachShadow({ mode: \"open\" });\n\t\t\t\tconst attrs = namedNodeMapToObject(this.attributes);\n\t\t\t\tif (is) attrs.is = is;\n\t\t\t\tif (tag) attrs.part = tag;\n\t\t\t\tthis.shadowRoot.innerHTML = this.constructor.getTemplateHTML(attrs);\n\t\t\t}\n\t\t\tthis.target.muted = this.hasAttribute(\"muted\");\n\t\t\tfor (const prop of nativeElProps) this.#upgradeProperty(prop);\n\t\t\tthis.#childObserver = new MutationObserver(this.#syncMediaChildAttribute.bind(this));\n\t\t\tthis.shadowRoot.addEventListener(\"slotchange\", () => this.#syncMediaChildren());\n\t\t\tthis.#syncMediaChildren();\n\t\t\tfor (const type of this.constructor.Events) this.shadowRoot.addEventListener(type, this, true);\n\t\t}\n\t\thandleEvent(event) {\n\t\t\tif (event.target === this.target) this.dispatchEvent(new CustomEvent(event.type, { detail: event.detail }));\n\t\t}\n\t\t#syncMediaChildren() {\n\t\t\tconst removeNativeChildren = new Map(this.#childMap);\n\t\t\t((this.shadowRoot?.querySelector(\"slot:not([name])\"))?.assignedElements({ flatten: true }).filter((el) => [\"track\", \"source\"].includes(el.localName))).forEach((el) => {\n\t\t\t\tremoveNativeChildren.delete(el);\n\t\t\t\tlet clone = this.#childMap.get(el);\n\t\t\t\tif (!clone) {\n\t\t\t\t\tclone = el.cloneNode();\n\t\t\t\t\tthis.#childMap.set(el, clone);\n\t\t\t\t\tthis.#childObserver?.observe(el, { attributes: true });\n\t\t\t\t}\n\t\t\t\tthis.target?.append(clone);\n\t\t\t\tthis.#enableDefaultTrack(clone);\n\t\t\t});\n\t\t\tremoveNativeChildren.forEach((clone, el) => {\n\t\t\t\tclone.remove();\n\t\t\t\tthis.#childMap.delete(el);\n\t\t\t});\n\t\t}\n\t\t#syncMediaChildAttribute(mutations) {\n\t\t\tfor (const mutation of mutations) if (mutation.type === \"attributes\") {\n\t\t\t\tconst { target, attributeName } = mutation;\n\t\t\t\tconst clone = this.#childMap.get(target);\n\t\t\t\tif (clone && attributeName) {\n\t\t\t\t\tclone.setAttribute(attributeName, target.getAttribute(attributeName) ?? \"\");\n\t\t\t\t\tthis.#enableDefaultTrack(clone);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#enableDefaultTrack(trackEl) {\n\t\t\tif (trackEl && trackEl.localName === \"track\" && trackEl.default && (trackEl.kind === \"chapters\" || trackEl.kind === \"metadata\") && trackEl.track.mode === \"disabled\") trackEl.track.mode = \"hidden\";\n\t\t}\n\t\t#upgradeProperty(prop) {\n\t\t\tif (Object.hasOwn(this, prop)) {\n\t\t\t\tconst value = this[prop];\n\t\t\t\tdelete this[prop];\n\t\t\t\tthis[prop] = value;\n\t\t\t}\n\t\t}\n\t\tattributeChangedCallback(attrName, oldValue, newValue) {\n\t\t\tthis.#init();\n\t\t\tthis.#forwardAttribute(attrName, oldValue, newValue);\n\t\t}\n\t\t#forwardAttribute(attrName, _oldValue, newValue) {\n\t\t\tif ([\"id\", \"class\"].includes(attrName)) return;\n\t\t\tif (!CustomMedia.observedAttributes.includes(attrName) && this.constructor.observedAttributes.includes(attrName)) return;\n\t\t\tif (newValue === null) this.target?.removeAttribute(attrName);\n\t\t\telse if (this.target?.getAttribute(attrName) !== newValue) this.target?.setAttribute(attrName, newValue);\n\t\t}\n\t\tconnectedCallback() {\n\t\t\tthis.#init();\n\t\t}\n\t};\n}\n/**\n* Helper function to get all properties from a native media element's prototype.\n*/\nfunction getNativeElProps(nativeElTest) {\n\tconst nativeElProps = [];\n\tfor (let proto = Object.getPrototypeOf(nativeElTest); proto && proto !== HTMLElement.prototype; proto = Object.getPrototypeOf(proto)) {\n\t\tconst props = Object.getOwnPropertyNames(proto);\n\t\tnativeElProps.push(...props);\n\t}\n\treturn nativeElProps;\n}\n/**\n* Helper function to serialize attributes into a string.\n*/\nfunction serializeAttributes(attrs) {\n\tlet html = \"\";\n\tfor (const key in attrs) {\n\t\tif (!Attributes.includes(key)) continue;\n\t\tconst value = attrs[key];\n\t\tif (value === \"\") html += ` ${key}`;\n\t\telse html += ` ${key}=\"${value}\"`;\n\t}\n\treturn html;\n}\n/**\n* Helper function to convert NamedNodeMap to a plain object.\n*/\nfunction namedNodeMapToObject(namedNodeMap) {\n\tconst obj = {};\n\tfor (const attr of namedNodeMap) obj[attr.name] = attr.value;\n\treturn obj;\n}\nconst CustomVideoElement = CustomMediaMixin(globalThis.HTMLElement ?? class {}, { tag: \"video\" });\nconst CustomAudioElement = CustomMediaMixin(globalThis.HTMLElement ?? class {}, { tag: \"audio\" });\n\n//#endregion\nexport { Attributes, CustomAudioElement, CustomMediaMixin, CustomVideoElement, Events };\n//# sourceMappingURL=index.js.map"],"mappings":"AASA,MAAM,EAAS,yWA+Bd,CACK,EAAa,CAClB,uBACA,0BACA,wBACA,WACA,WACA,eACA,cACA,OACA,QACA,cACA,SACA,UACA,MACA,CAID,SAAS,EAAqB,EAAO,CACpC,MAAO;;;;;;;;;;;;;;cAcM,EAAoB,EAAM,CAAC;;;IAQzC,SAAS,EAAqB,EAAO,CACpC,MAAO;;;;;;;;;;;;;;;;;;;;;;;;;cAyBM,EAAoB,EAAM,CAAC;;;IAKzC,SAAS,EAAiB,EAAY,CAAE,MAAK,MAAM,CAClD,IAAM,EAAe,WAAW,UAAU,gBAAgB,EAAK,CAAE,KAAI,CAAC,CAChE,EAAgB,EAAe,EAAiB,EAAa,CAAG,EAAE,CACxE,OAAO,MAAM,UAAoB,CAAW,CAC3C,OAAO,gBAAkB,EAAI,SAAS,QAAQ,CAAG,EAAuB,EACxE,OAAO,kBAAoB,CAAE,KAAM,OAAQ,CAC3C,OAAO,OAAS,EAChB,OAAA,EAA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aAAa,EAAS,GAAK,GAAU,KAAK,QAAQ,aAAa,EAAU,EAAS,EAEzG,mBAAoB,CACnB,MAAA,GAAY,GAOf,SAAS,EAAiB,EAAc,CACvC,IAAM,EAAgB,EAAE,CACxB,IAAK,IAAI,EAAQ,OAAO,eAAe,EAAa,CAAE,GAAS,IAAU,YAAY,UAAW,EAAQ,OAAO,eAAe,EAAM,CAAE,CACrI,IAAM,EAAQ,OAAO,oBAAoB,EAAM,CAC/C,EAAc,KAAK,GAAG,EAAM,CAE7B,OAAO,EAKR,SAAS,EAAoB,EAAO,CACnC,IAAI,EAAO,GACX,IAAK,IAAM,KAAO,EAAO,CACxB,GAAI,CAAC,EAAW,SAAS,EAAI,CAAE,SAC/B,IAAM,EAAQ,EAAM,GAChB,IAAU,GAAI,GAAQ,IAAI,IACzB,GAAQ,IAAI,EAAI,IAAI,EAAM,GAEhC,OAAO,EAKR,SAAS,EAAqB,EAAc,CAC3C,IAAM,EAAM,EAAE,CACd,IAAK,IAAM,KAAQ,EAAc,EAAI,EAAK,MAAQ,EAAK,MACvD,OAAO,EAEmB,EAAiB,WAAW,aAAe,KAAM,GAAI,CAAE,IAAK,QAAS,CAAC,CACtE,EAAiB,WAAW,aAAe,KAAM,GAAI,CAAE,IAAK,QAAS,CAAC"}
|
|
@@ -1,45 +1,3 @@
|
|
|
1
|
-
import { n as defineClassPropHooks, t as ProxyMixin } from "./proxy-XzDf9gyk.js";
|
|
2
|
-
|
|
3
|
-
//#region ../core/dist/dev/core/media/delegate.js
|
|
4
|
-
/**
|
|
5
|
-
* Mixin that intercepts `get`, `set`, and `call` to delegate property access
|
|
6
|
-
* and method calls to an instance of `DelegateClass` before falling through
|
|
7
|
-
* to the base class implementation.
|
|
8
|
-
*
|
|
9
|
-
* Works with both `CustomMediaMixin` and `ProxyMixin`.
|
|
10
|
-
*/
|
|
11
|
-
function DelegateMixin(BaseClass, DelegateClass) {
|
|
12
|
-
class DelegateImpl extends BaseClass {
|
|
13
|
-
#delegate = new DelegateClass();
|
|
14
|
-
get(prop) {
|
|
15
|
-
if (prop in this.#delegate) return this.#delegate[prop];
|
|
16
|
-
return super.get?.(prop);
|
|
17
|
-
}
|
|
18
|
-
set(prop, val) {
|
|
19
|
-
if (prop in this.#delegate) {
|
|
20
|
-
this.#delegate[prop] = val;
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
super.set?.(prop, val);
|
|
24
|
-
}
|
|
25
|
-
call(prop, ...args) {
|
|
26
|
-
if (prop in this.#delegate) return this.#delegate[prop](...args);
|
|
27
|
-
return super.call?.(prop, ...args);
|
|
28
|
-
}
|
|
29
|
-
attach(target) {
|
|
30
|
-
super.attach?.(target);
|
|
31
|
-
this.#delegate.attach?.(target);
|
|
32
|
-
}
|
|
33
|
-
detach() {
|
|
34
|
-
this.#delegate.detach?.();
|
|
35
|
-
super.detach?.();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
for (let proto = DelegateClass.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) defineClassPropHooks(DelegateImpl, proto);
|
|
39
|
-
return DelegateImpl;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
1
|
//#region ../core/dist/dev/dom/media/custom-media-element/index.js
|
|
44
2
|
/**
|
|
45
3
|
* Custom Media Element
|
|
@@ -341,9 +299,5 @@ const CustomVideoElement = CustomMediaMixin(globalThis.HTMLElement ?? class {},
|
|
|
341
299
|
const CustomAudioElement = CustomMediaMixin(globalThis.HTMLElement ?? class {}, { tag: "audio" });
|
|
342
300
|
|
|
343
301
|
//#endregion
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
//#endregion
|
|
348
|
-
export { DelegateMixin as n, CustomMediaMixin as t };
|
|
349
|
-
//# sourceMappingURL=proxy-dR7IDk37.js.map
|
|
302
|
+
export { CustomMediaMixin as t };
|
|
303
|
+
//# sourceMappingURL=custom-media-element-moFa3UZp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-media-element-moFa3UZp.js","names":["#isDefined","#propsToAttrs","#define","#init","#target","#isInit","#upgradeProperty","#childObserver","#syncMediaChildAttribute","#syncMediaChildren","#childMap","#enableDefaultTrack","#forwardAttribute"],"sources":["../../core/dist/dev/dom/media/custom-media-element/index.js"],"sourcesContent":["//#region src/dom/media/custom-media-element/index.ts\n/**\n* Custom Media Element\n* Based on https://github.com/muxinc/custom-video-element - Mux - MIT License\n*\n* The goal is to create an element that works just like the video element\n* but can be extended/sub-classed, because native elements cannot be\n* extended today across browsers.\n*/\nconst Events = [\n\t\"abort\",\n\t\"canplay\",\n\t\"canplaythrough\",\n\t\"durationchange\",\n\t\"emptied\",\n\t\"encrypted\",\n\t\"ended\",\n\t\"error\",\n\t\"loadeddata\",\n\t\"loadedmetadata\",\n\t\"loadstart\",\n\t\"pause\",\n\t\"play\",\n\t\"playing\",\n\t\"progress\",\n\t\"ratechange\",\n\t\"seeked\",\n\t\"seeking\",\n\t\"stalled\",\n\t\"suspend\",\n\t\"timeupdate\",\n\t\"volumechange\",\n\t\"waiting\",\n\t\"waitingforkey\",\n\t\"resize\",\n\t\"enterpictureinpicture\",\n\t\"leavepictureinpicture\",\n\t\"webkitbeginfullscreen\",\n\t\"webkitendfullscreen\",\n\t\"webkitpresentationmodechanged\"\n];\nconst Attributes = [\n\t\"autopictureinpicture\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"autoplay\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"crossorigin\",\n\t\"loop\",\n\t\"muted\",\n\t\"playsinline\",\n\t\"poster\",\n\t\"preload\",\n\t\"src\"\n];\n/**\n* Helper function to generate the HTML template for audio elements.\n*/\nfunction getAudioTemplateHTML(attrs) {\n\treturn `\n <style>\n :host {\n display: inline-flex;\n line-height: 0;\n flex-direction: column;\n justify-content: end;\n }\n\n audio {\n width: 100%;\n }\n </style>\n <slot name=\"media\">\n <audio${serializeAttributes(attrs)}></audio>\n </slot>\n <slot></slot>\n `;\n}\n/**\n* Helper function to generate the HTML template for video elements.\n*/\nfunction getVideoTemplateHTML(attrs) {\n\treturn `\n <style>\n :host {\n display: contents;\n }\n\n video {\n display: block;\n width: 100%;\n height: 100%;\n border-radius: var(--media-video-border-radius);\n object-fit: var(--media-object-fit, contain);\n object-position: var(--media-object-position, center);\n }\n\n video::-webkit-media-text-track-container {\n transition: translate var(--media-caption-track-duration, 0) ease-out;\n transition-delay: var(--media-caption-track-delay, 0);\n translate: 0 var(--media-caption-track-y, 0);\n scale: 0.98;\n z-index: 1;\n font-family: inherit;\n }\n </style>\n <slot name=\"media\">\n <video${serializeAttributes(attrs)}></video>\n </slot>\n <slot></slot>\n `;\n}\nfunction CustomMediaMixin(superclass, { tag, is }) {\n\tconst nativeElTest = globalThis.document?.createElement?.(tag, { is });\n\tconst nativeElProps = nativeElTest ? getNativeElProps(nativeElTest) : [];\n\treturn class CustomMedia extends superclass {\n\t\tstatic getTemplateHTML = tag.endsWith(\"audio\") ? getAudioTemplateHTML : getVideoTemplateHTML;\n\t\tstatic shadowRootOptions = { mode: \"open\" };\n\t\tstatic Events = Events;\n\t\tstatic #isDefined = false;\n\t\tstatic #propsToAttrs;\n\t\tstatic get observedAttributes() {\n\t\t\tCustomMedia.#define();\n\t\t\treturn [...nativeElTest?.constructor?.observedAttributes ?? [], ...Attributes];\n\t\t}\n\t\tstatic #define() {\n\t\t\tif (CustomMedia.#isDefined) return;\n\t\t\tCustomMedia.#isDefined = true;\n\t\t\tCustomMedia.#propsToAttrs = new Set(CustomMedia.observedAttributes);\n\t\t\tCustomMedia.#propsToAttrs.delete(\"muted\");\n\t\t\tfor (const prop of nativeElProps) {\n\t\t\t\tif (prop in CustomMedia.prototype) continue;\n\t\t\t\tif (typeof nativeElTest[prop] === \"function\") CustomMedia.prototype[prop] = function(...args) {\n\t\t\t\t\tthis.#init();\n\t\t\t\t\treturn this.call(prop, ...args);\n\t\t\t\t};\n\t\t\t\telse {\n\t\t\t\t\tconst config = { get() {\n\t\t\t\t\t\tthis.#init();\n\t\t\t\t\t\treturn this.get(prop);\n\t\t\t\t\t} };\n\t\t\t\t\tif (prop !== prop.toUpperCase()) config.set = function(val) {\n\t\t\t\t\t\tthis.#init();\n\t\t\t\t\t\tthis.set(prop, val);\n\t\t\t\t\t};\n\t\t\t\t\tObject.defineProperty(CustomMedia.prototype, prop, config);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#isInit = false;\n\t\t#target = null;\n\t\t#childMap = /* @__PURE__ */ new Map();\n\t\t#childObserver;\n\t\tget(prop) {\n\t\t\tconst attr = prop.toLowerCase();\n\t\t\tif (CustomMedia.#propsToAttrs.has(attr)) {\n\t\t\t\tconst val = this.getAttribute(attr);\n\t\t\t\treturn val === null ? false : val === \"\" ? true : val;\n\t\t\t}\n\t\t\treturn this.target?.[prop];\n\t\t}\n\t\tset(prop, val) {\n\t\t\tconst attr = prop.toLowerCase();\n\t\t\tif (CustomMedia.#propsToAttrs.has(attr)) {\n\t\t\t\tif (val === true || val === false || val == null) this.toggleAttribute(attr, Boolean(val));\n\t\t\t\telse this.setAttribute(attr, val);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.target) this.target[prop] = val;\n\t\t}\n\t\tcall(prop, ...args) {\n\t\t\treturn (this.target?.[prop])?.apply(this.target, args);\n\t\t}\n\t\tget target() {\n\t\t\tthis.#init();\n\t\t\treturn this.#target ?? this.querySelector(\":scope > [slot=media]\") ?? this.querySelector(tag) ?? this.shadowRoot?.querySelector(tag) ?? null;\n\t\t}\n\t\tset target(val) {\n\t\t\tthis.#target = val;\n\t\t}\n\t\tget defaultMuted() {\n\t\t\tthis.#init();\n\t\t\treturn this.get(\"muted\");\n\t\t}\n\t\tset defaultMuted(val) {\n\t\t\tthis.#init();\n\t\t\tthis.set(\"muted\", val);\n\t\t}\n\t\t#init() {\n\t\t\tif (this.#isInit) return;\n\t\t\tthis.#isInit = true;\n\t\t\tthis.init();\n\t\t}\n\t\tinit() {\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tthis.attachShadow({ mode: \"open\" });\n\t\t\t\tconst attrs = namedNodeMapToObject(this.attributes);\n\t\t\t\tif (is) attrs.is = is;\n\t\t\t\tif (tag) attrs.part = tag;\n\t\t\t\tthis.shadowRoot.innerHTML = this.constructor.getTemplateHTML(attrs);\n\t\t\t}\n\t\t\tthis.target.muted = this.hasAttribute(\"muted\");\n\t\t\tfor (const prop of nativeElProps) this.#upgradeProperty(prop);\n\t\t\tthis.#childObserver = new MutationObserver(this.#syncMediaChildAttribute.bind(this));\n\t\t\tthis.shadowRoot.addEventListener(\"slotchange\", () => this.#syncMediaChildren());\n\t\t\tthis.#syncMediaChildren();\n\t\t\tfor (const type of this.constructor.Events) this.shadowRoot.addEventListener(type, this, true);\n\t\t}\n\t\thandleEvent(event) {\n\t\t\tif (event.target === this.target) this.dispatchEvent(new CustomEvent(event.type, { detail: event.detail }));\n\t\t}\n\t\t#syncMediaChildren() {\n\t\t\tconst removeNativeChildren = new Map(this.#childMap);\n\t\t\t((this.shadowRoot?.querySelector(\"slot:not([name])\"))?.assignedElements({ flatten: true }).filter((el) => [\"track\", \"source\"].includes(el.localName))).forEach((el) => {\n\t\t\t\tremoveNativeChildren.delete(el);\n\t\t\t\tlet clone = this.#childMap.get(el);\n\t\t\t\tif (!clone) {\n\t\t\t\t\tclone = el.cloneNode();\n\t\t\t\t\tthis.#childMap.set(el, clone);\n\t\t\t\t\tthis.#childObserver?.observe(el, { attributes: true });\n\t\t\t\t}\n\t\t\t\tthis.target?.append(clone);\n\t\t\t\tthis.#enableDefaultTrack(clone);\n\t\t\t});\n\t\t\tremoveNativeChildren.forEach((clone, el) => {\n\t\t\t\tclone.remove();\n\t\t\t\tthis.#childMap.delete(el);\n\t\t\t});\n\t\t}\n\t\t#syncMediaChildAttribute(mutations) {\n\t\t\tfor (const mutation of mutations) if (mutation.type === \"attributes\") {\n\t\t\t\tconst { target, attributeName } = mutation;\n\t\t\t\tconst clone = this.#childMap.get(target);\n\t\t\t\tif (clone && attributeName) {\n\t\t\t\t\tclone.setAttribute(attributeName, target.getAttribute(attributeName) ?? \"\");\n\t\t\t\t\tthis.#enableDefaultTrack(clone);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#enableDefaultTrack(trackEl) {\n\t\t\tif (trackEl && trackEl.localName === \"track\" && trackEl.default && (trackEl.kind === \"chapters\" || trackEl.kind === \"metadata\") && trackEl.track.mode === \"disabled\") trackEl.track.mode = \"hidden\";\n\t\t}\n\t\t#upgradeProperty(prop) {\n\t\t\tif (Object.hasOwn(this, prop)) {\n\t\t\t\tconst value = this[prop];\n\t\t\t\tdelete this[prop];\n\t\t\t\tthis[prop] = value;\n\t\t\t}\n\t\t}\n\t\tattributeChangedCallback(attrName, oldValue, newValue) {\n\t\t\tthis.#init();\n\t\t\tthis.#forwardAttribute(attrName, oldValue, newValue);\n\t\t}\n\t\t#forwardAttribute(attrName, _oldValue, newValue) {\n\t\t\tif ([\"id\", \"class\"].includes(attrName)) return;\n\t\t\tif (!CustomMedia.observedAttributes.includes(attrName) && this.constructor.observedAttributes.includes(attrName)) return;\n\t\t\tif (newValue === null) this.target?.removeAttribute(attrName);\n\t\t\telse if (this.target?.getAttribute(attrName) !== newValue) this.target?.setAttribute(attrName, newValue);\n\t\t}\n\t\tconnectedCallback() {\n\t\t\tthis.#init();\n\t\t}\n\t};\n}\n/**\n* Helper function to get all properties from a native media element's prototype.\n*/\nfunction getNativeElProps(nativeElTest) {\n\tconst nativeElProps = [];\n\tfor (let proto = Object.getPrototypeOf(nativeElTest); proto && proto !== HTMLElement.prototype; proto = Object.getPrototypeOf(proto)) {\n\t\tconst props = Object.getOwnPropertyNames(proto);\n\t\tnativeElProps.push(...props);\n\t}\n\treturn nativeElProps;\n}\n/**\n* Helper function to serialize attributes into a string.\n*/\nfunction serializeAttributes(attrs) {\n\tlet html = \"\";\n\tfor (const key in attrs) {\n\t\tif (!Attributes.includes(key)) continue;\n\t\tconst value = attrs[key];\n\t\tif (value === \"\") html += ` ${key}`;\n\t\telse html += ` ${key}=\"${value}\"`;\n\t}\n\treturn html;\n}\n/**\n* Helper function to convert NamedNodeMap to a plain object.\n*/\nfunction namedNodeMapToObject(namedNodeMap) {\n\tconst obj = {};\n\tfor (const attr of namedNodeMap) obj[attr.name] = attr.value;\n\treturn obj;\n}\nconst CustomVideoElement = CustomMediaMixin(globalThis.HTMLElement ?? class {}, { tag: \"video\" });\nconst CustomAudioElement = CustomMediaMixin(globalThis.HTMLElement ?? class {}, { tag: \"audio\" });\n\n//#endregion\nexport { Attributes, CustomAudioElement, CustomMediaMixin, CustomVideoElement, Events };\n//# sourceMappingURL=index.js.map"],"mappings":";;;;;;;;;AASA,MAAM,SAAS;CACd;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,aAAa;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;AAID,SAAS,qBAAqB,OAAO;AACpC,QAAO;;;;;;;;;;;;;;cAcM,oBAAoB,MAAM,CAAC;;;;;;;;AAQzC,SAAS,qBAAqB,OAAO;AACpC,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;cAyBM,oBAAoB,MAAM,CAAC;;;;;AAKzC,SAAS,iBAAiB,YAAY,EAAE,KAAK,MAAM;CAClD,MAAM,eAAe,WAAW,UAAU,gBAAgB,KAAK,EAAE,IAAI,CAAC;CACtE,MAAM,gBAAgB,eAAe,iBAAiB,aAAa,GAAG,EAAE;AACxE,QAAO,MAAM,oBAAoB,WAAW;EAC3C,OAAO,kBAAkB,IAAI,SAAS,QAAQ,GAAG,uBAAuB;EACxE,OAAO,oBAAoB,EAAE,MAAM,QAAQ;EAC3C,OAAO,SAAS;EAChB,QAAOA,YAAa;EACpB,QA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ate.js
|
|
4
|
+
/**
|
|
5
|
+
* Mixin that intercepts `get`, `set`, and `call` to delegate property access
|
|
6
|
+
* and method calls to an instance of `DelegateClass` before falling through
|
|
7
|
+
* to the base class implementation.
|
|
8
|
+
*
|
|
9
|
+
* Works with both `CustomMediaMixin` and `ProxyMixin`.
|
|
10
|
+
*/
|
|
11
|
+
function DelegateMixin(BaseClass, DelegateClass) {
|
|
12
|
+
class DelegateImpl extends BaseClass {
|
|
13
|
+
#delegate = new DelegateClass();
|
|
14
|
+
get(prop) {
|
|
15
|
+
if (prop in this.#delegate) return this.#delegate[prop];
|
|
16
|
+
return super.get?.(prop);
|
|
17
|
+
}
|
|
18
|
+
set(prop, val) {
|
|
19
|
+
if (prop in this.#delegate) {
|
|
20
|
+
this.#delegate[prop] = val;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
super.set?.(prop, val);
|
|
24
|
+
}
|
|
25
|
+
call(prop, ...args) {
|
|
26
|
+
if (prop in this.#delegate) return this.#delegate[prop](...args);
|
|
27
|
+
return super.call?.(prop, ...args);
|
|
28
|
+
}
|
|
29
|
+
attach(target) {
|
|
30
|
+
super.attach?.(target);
|
|
31
|
+
this.#delegate.attach?.(target);
|
|
32
|
+
}
|
|
33
|
+
detach() {
|
|
34
|
+
this.#delegate.detach?.();
|
|
35
|
+
super.detach?.();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (let proto = DelegateClass.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) defineClassPropHooks(DelegateImpl, proto);
|
|
39
|
+
return DelegateImpl;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { DelegateMixin as t };
|
|
44
|
+
//# sourceMappingURL=delegate-CzAcT1xm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate-CzAcT1xm.js","names":["#delegate"],"sources":["../../core/dist/dev/core/media/delegate.js"],"sourcesContent":["import { defineClassPropHooks } from \"../utils/define-class-prop-hooks.js\";\n\n//#region src/core/media/delegate.ts\n/**\n* Mixin that intercepts `get`, `set`, and `call` to delegate property access\n* and method calls to an instance of `DelegateClass` before falling through\n* to the base class implementation.\n*\n* Works with both `CustomMediaMixin` and `ProxyMixin`.\n*/\nfunction DelegateMixin(BaseClass, DelegateClass) {\n\tclass DelegateImpl extends BaseClass {\n\t\t#delegate = new DelegateClass();\n\t\tget(prop) {\n\t\t\tif (prop in this.#delegate) return this.#delegate[prop];\n\t\t\treturn super.get?.(prop);\n\t\t}\n\t\tset(prop, val) {\n\t\t\tif (prop in this.#delegate) {\n\t\t\t\tthis.#delegate[prop] = val;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.set?.(prop, val);\n\t\t}\n\t\tcall(prop, ...args) {\n\t\t\tif (prop in this.#delegate) return this.#delegate[prop](...args);\n\t\t\treturn super.call?.(prop, ...args);\n\t\t}\n\t\tattach(target) {\n\t\t\tsuper.attach?.(target);\n\t\t\tthis.#delegate.attach?.(target);\n\t\t}\n\t\tdetach() {\n\t\t\tthis.#delegate.detach?.();\n\t\t\tsuper.detach?.();\n\t\t}\n\t}\n\tfor (let proto = DelegateClass.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) defineClassPropHooks(DelegateImpl, proto);\n\treturn DelegateImpl;\n}\n\n//#endregion\nexport { DelegateMixin };\n//# sourceMappingURL=delegate.js.map"],"mappings":";;;;;;;;;;AAUA,SAAS,cAAc,WAAW,eAAe;CAChD,MAAM,qBAAqB,UAAU;EACpC,YAAY,IAAI,eAAe;EAC/B,IAAI,MAAM;AACT,OAAI,QAAQ,MAAKA,SAAW,QAAO,MAAKA,SAAU;AAClD,UAAO,MAAM,MAAM,KAAK;;EAEzB,IAAI,MAAM,KAAK;AACd,OAAI,QAAQ,MAAKA,UAAW;AAC3B,UAAKA,SAAU,QAAQ;AACvB;;AAED,SAAM,MAAM,MAAM,IAAI;;EAEvB,KAAK,MAAM,GAAG,MAAM;AACnB,OAAI,QAAQ,MAAKA,SAAW,QAAO,MAAKA,SAAU,MAAM,GAAG,KAAK;AAChE,UAAO,MAAM,OAAO,MAAM,GAAG,KAAK;;EAEnC,OAAO,QAAQ;AACd,SAAM,SAAS,OAAO;AACtB,SAAKA,SAAU,SAAS,OAAO;;EAEhC,SAAS;AACR,SAAKA,SAAU,UAAU;AACzB,SAAM,UAAU;;;AAGlB,MAAK,IAAI,QAAQ,cAAc,WAAW,SAAS,UAAU,OAAO,WAAW,QAAQ,OAAO,eAAe,MAAM,CAAE,sBAAqB,cAAc,MAAM;AAC9J,QAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./context-CUBywtsB.js";function t(t,n){class r extends t{#e=new n;get(e){return e in this.#e?this.#e[e]:super.get?.(e)}set(e,t){if(e in this.#e){this.#e[e]=t;return}super.set?.(e,t)}call(e,...t){return e in this.#e?this.#e[e](...t):super.call?.(e,...t)}attach(e){super.attach?.(e),this.#e.attach?.(e)}detach(){this.#e.detach?.(),super.detach?.()}}for(let t=n.prototype;t&&t!==Object.prototype;t=Object.getPrototypeOf(t))e(r,t);return r}export{t};
|
|
2
|
+
//# sourceMappingURL=delegate-Uc-6tQDR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate-Uc-6tQDR.js","names":["#delegate"],"sources":["../../core/dist/default/core/media/delegate.js"],"sourcesContent":["import { defineClassPropHooks } from \"../utils/define-class-prop-hooks.js\";\n\n//#region src/core/media/delegate.ts\n/**\n* Mixin that intercepts `get`, `set`, and `call` to delegate property access\n* and method calls to an instance of `DelegateClass` before falling through\n* to the base class implementation.\n*\n* Works with both `CustomMediaMixin` and `ProxyMixin`.\n*/\nfunction DelegateMixin(BaseClass, DelegateClass) {\n\tclass DelegateImpl extends BaseClass {\n\t\t#delegate = new DelegateClass();\n\t\tget(prop) {\n\t\t\tif (prop in this.#delegate) return this.#delegate[prop];\n\t\t\treturn super.get?.(prop);\n\t\t}\n\t\tset(prop, val) {\n\t\t\tif (prop in this.#delegate) {\n\t\t\t\tthis.#delegate[prop] = val;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.set?.(prop, val);\n\t\t}\n\t\tcall(prop, ...args) {\n\t\t\tif (prop in this.#delegate) return this.#delegate[prop](...args);\n\t\t\treturn super.call?.(prop, ...args);\n\t\t}\n\t\tattach(target) {\n\t\t\tsuper.attach?.(target);\n\t\t\tthis.#delegate.attach?.(target);\n\t\t}\n\t\tdetach() {\n\t\t\tthis.#delegate.detach?.();\n\t\t\tsuper.detach?.();\n\t\t}\n\t}\n\tfor (let proto = DelegateClass.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) defineClassPropHooks(DelegateImpl, proto);\n\treturn DelegateImpl;\n}\n\n//#endregion\nexport { DelegateMixin };\n//# sourceMappingURL=delegate.js.map"],"mappings":"0CAUA,SAAS,EAAc,EAAW,EAAe,CAChD,MAAM,UAAqB,CAAU,CACpC,GAAY,IAAI,EAChB,IAAI,EAAM,CAET,OADI,KAAQ,MAAA,EAAuB,MAAA,EAAe,GAC3C,MAAM,MAAM,EAAK,CAEzB,IAAI,EAAM,EAAK,CACd,GAAI,KAAQ,MAAA,EAAgB,CAC3B,MAAA,EAAe,GAAQ,EACvB,OAED,MAAM,MAAM,EAAM,EAAI,CAEvB,KAAK,EAAM,GAAG,EAAM,CAEnB,OADI,KAAQ,MAAA,EAAuB,MAAA,EAAe,GAAM,GAAG,EAAK,CACzD,MAAM,OAAO,EAAM,GAAG,EAAK,CAEnC,OAAO,EAAQ,CACd,MAAM,SAAS,EAAO,CACtB,MAAA,EAAe,SAAS,EAAO,CAEhC,QAAS,CACR,MAAA,EAAe,UAAU,CACzB,MAAM,UAAU,EAGlB,IAAK,IAAI,EAAQ,EAAc,UAAW,GAAS,IAAU,OAAO,UAAW,EAAQ,OAAO,eAAe,EAAM,CAAE,EAAqB,EAAc,EAAM,CAC9J,OAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}export{e as t};
|
|
2
|
-
//# sourceMappingURL=listen-
|
|
2
|
+
//# sourceMappingURL=listen-4jqsRSKo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listen-
|
|
1
|
+
{"version":3,"file":"listen-4jqsRSKo.js","names":[],"sources":["../../utils/dist/dom/listen.js"],"sourcesContent":["//#region src/dom/listen.ts\nfunction listen(target, type, listener, options) {\n\ttarget.addEventListener(type, listener, options);\n\treturn () => target.removeEventListener(type, listener, options);\n}\n\n//#endregion\nexport { listen };\n//# sourceMappingURL=listen.js.map"],"mappings":"AACA,SAAS,EAAO,EAAQ,EAAM,EAAU,EAAS,CAEhD,OADA,EAAO,iBAAiB,EAAM,EAAU,EAAQ,KACnC,EAAO,oBAAoB,EAAM,EAAU,EAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listen-
|
|
1
|
+
{"version":3,"file":"listen-YSH3Jfyk.js","names":[],"sources":["../../utils/dist/dom/listen.js"],"sourcesContent":["//#region src/dom/listen.ts\nfunction listen(target, type, listener, options) {\n\ttarget.addEventListener(type, listener, options);\n\treturn () => target.removeEventListener(type, listener, options);\n}\n\n//#endregion\nexport { listen };\n//# sourceMappingURL=listen.js.map"],"mappings":";AACA,SAAS,OAAO,QAAQ,MAAM,UAAU,SAAS;AAChD,QAAO,iBAAiB,MAAM,UAAU,QAAQ;AAChD,cAAa,OAAO,oBAAoB,MAAM,UAAU,QAAQ"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import "../context-Be8C5kVd.js";
|
|
1
2
|
import { t as safeDefine } from "../safe-define-B8lHgj_K.js";
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
3
|
+
import { t as DelegateMixin } from "../delegate-CzAcT1xm.js";
|
|
4
|
+
import { t as MediaAttachMixin } from "../media-attach-mixin-U_KQB_9O.js";
|
|
5
|
+
import { t as CustomMediaMixin } from "../custom-media-element-moFa3UZp.js";
|
|
4
6
|
|
|
5
7
|
//#region ../../node_modules/.pnpm/dashjs@5.1.1_@svta+cml-cta@1.0.1_@svta+cml-structured-field-values@1.0.1_@svta+cml-util_e62e22cdd187b69d7eef3f6641da2ae0/node_modules/dashjs/dist/modern/esm/dash.all.min.js
|
|
6
8
|
/*! For license information please see dash.all.min.js.LICENSE.txt */
|