@videojs/html 10.0.0-beta.12 → 10.0.0-beta.13
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 -4
- package/cdn/audio-minimal.js +1 -1
- package/cdn/audio.dev.js +4 -4
- package/cdn/audio.js +1 -1
- package/cdn/background.dev.js +3 -3
- package/cdn/background.js +1 -1
- package/cdn/{create-player-BoPlCSNw.js → create-player-C2h3JeGl.js} +2 -2
- package/cdn/{create-player-BoPlCSNw.js.map → create-player-C2h3JeGl.js.map} +1 -1
- package/cdn/{create-player-CA3KLZMe.js → create-player-i0Q36S9_.js} +2 -2
- package/cdn/{create-player-CA3KLZMe.js.map → create-player-i0Q36S9_.js.map} +1 -1
- package/cdn/{delegate-CSc5c0ZR.js → delegate-AoR5Pt_6.js} +2 -2
- package/cdn/{delegate-CSc5c0ZR.js.map → delegate-AoR5Pt_6.js.map} +1 -1
- package/cdn/{delegate-jczJeizF.js → delegate-odoSeh7c.js} +2 -2
- package/cdn/{delegate-jczJeizF.js.map → delegate-odoSeh7c.js.map} +1 -1
- package/cdn/{hls-DQ4glyHe.js → hls-CNDMNsEo.js} +2 -2
- package/cdn/hls-CNDMNsEo.js.map +1 -0
- package/cdn/{hls-C6htsSW4.js → hls-DHwATYV2.js} +4 -2
- package/cdn/hls-DHwATYV2.js.map +1 -0
- package/cdn/media/dash-video.dev.js +3 -3
- package/cdn/media/dash-video.js +1 -1
- package/cdn/media/hls-video.dev.js +3 -3
- package/cdn/media/hls-video.js +1 -1
- package/cdn/media/mux-video.dev.js +5 -5
- package/cdn/media/mux-video.dev.js.map +1 -1
- package/cdn/media/mux-video.js +1 -1
- package/cdn/media/mux-video.js.map +1 -1
- package/cdn/media/simple-hls-video.dev.js +3 -3
- package/cdn/media/simple-hls-video.js +1 -1
- package/cdn/{media-attach-mixin-BIrlT_tz.js → media-attach-mixin-ByJOWMNT.js} +2 -2
- package/cdn/{media-attach-mixin-BIrlT_tz.js.map → media-attach-mixin-ByJOWMNT.js.map} +1 -1
- package/cdn/{media-attach-mixin-Dsn4gxJA.js → media-attach-mixin-CkU58gjb.js} +2 -2
- package/cdn/{media-attach-mixin-Dsn4gxJA.js.map → media-attach-mixin-CkU58gjb.js.map} +1 -1
- package/cdn/{player-rkxd0mpV.js → player-BWRklsUx.js} +3 -3
- package/cdn/{player-rkxd0mpV.js.map → player-BWRklsUx.js.map} +1 -1
- package/cdn/player-DOTrw60d.js +2 -0
- package/cdn/{player-Dzvu8Tzs.js.map → player-DOTrw60d.js.map} +1 -1
- package/cdn/{poster-DqjXzMK_.js → poster-CRi_NWaR.js} +2 -2
- package/cdn/{poster-DqjXzMK_.js.map → poster-CRi_NWaR.js.map} +1 -1
- package/cdn/{poster-BPMPXyn3.js → poster-Ds1EOmmU.js} +4 -4
- package/cdn/{poster-BPMPXyn3.js.map → poster-Ds1EOmmU.js.map} +1 -1
- package/cdn/{safe-define-D26LrTu4.js → safe-define-Bw8JF08z.js} +11 -2
- package/cdn/{safe-define-D26LrTu4.js.map → safe-define-Bw8JF08z.js.map} +1 -1
- package/cdn/{safe-define-EEn8NTOG.js → safe-define-t0AGOouq.js} +2 -2
- package/cdn/{safe-define-EEn8NTOG.js.map → safe-define-t0AGOouq.js.map} +1 -1
- package/cdn/video-minimal.dev.js +4 -4
- package/cdn/video-minimal.js +1 -1
- package/cdn/video.dev.js +4 -4
- package/cdn/video.js +1 -1
- package/cdn/{volume-slider-CQ0Yq947.js → volume-slider-C7rEWi11.js} +2 -2
- package/cdn/{volume-slider-CQ0Yq947.js.map → volume-slider-C7rEWi11.js.map} +1 -1
- package/cdn/{volume-slider-BEXiB6_j.js → volume-slider-Dz_ND_4U.js} +3 -3
- package/cdn/{volume-slider-BEXiB6_j.js.map → volume-slider-Dz_ND_4U.js.map} +1 -1
- package/package.json +8 -8
- package/cdn/hls-C6htsSW4.js.map +0 -1
- package/cdn/hls-DQ4glyHe.js.map +0 -1
- package/cdn/player-Dzvu8Tzs.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as anyAbortSignal } from "../abort-JT-ewLFq.js";
|
|
2
|
-
import { t as safeDefine } from "../safe-define-
|
|
2
|
+
import { t as safeDefine } from "../safe-define-Bw8JF08z.js";
|
|
3
3
|
import { t as listen } from "../listen-BkAEGXCe.js";
|
|
4
|
-
import { t as DelegateMixin } from "../delegate-
|
|
5
|
-
import { t as MediaAttachMixin } from "../media-attach-mixin-
|
|
4
|
+
import { t as DelegateMixin } from "../delegate-AoR5Pt_6.js";
|
|
5
|
+
import { t as MediaAttachMixin } from "../media-attach-mixin-CkU58gjb.js";
|
|
6
6
|
import { n as CustomVideoElement, t as MediaPropsMixin } from "../media-props-mixin-DxsM38Bx.js";
|
|
7
7
|
|
|
8
8
|
//#region ../spf/dist/dev/core/abr/ewma.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"../abort-C7q_G_dT.js";import{t}from"../safe-define-
|
|
1
|
+
import{t as e}from"../abort-C7q_G_dT.js";import{t}from"../safe-define-t0AGOouq.js";import{t as n}from"../listen-UqQNdlqV.js";import{t as r}from"../delegate-odoSeh7c.js";import{t as i}from"../media-attach-mixin-ByJOWMNT.js";import{n as a,t as o}from"../media-props-mixin-BuVUebRp.js";function s(e){return Math.exp(Math.log(.5)/e)}function c(e,t,n,r){let i=s(r)**n;return t*(1-i)+i*e}function l(e,t,n){return t===0?0:e/(1-s(n)**t)}const u={fastHalfLife:2,slowHalfLife:5,minTotalBytes:128e3,minBytes:16e3,minDuration:5};function d(e,t,n,r=u){let i=e.bytesSampled+n;if(n<r.minBytes||t<r.minDuration)return{...e,bytesSampled:i};let a=8e3*n/t,o=t/1e3;return{fastEstimate:c(e.fastEstimate,a,o,r.fastHalfLife),fastTotalWeight:e.fastTotalWeight+o,slowEstimate:c(e.slowEstimate,a,o,r.slowHalfLife),slowTotalWeight:e.slowTotalWeight+o,bytesSampled:i}}function f(e,t,n=u){if(e.bytesSampled<n.minTotalBytes)return t;let r=l(e.fastEstimate,e.fastTotalWeight,n.fastHalfLife),i=l(e.slowEstimate,e.slowTotalWeight,n.slowHalfLife);return Math.min(r,i)}const p={bufferDuration:30};function m(e,t,n=p){if(e.length===0)return 1/0;let r=t+n.bufferDuration,i=e.filter(e=>e.startTime>=r);return i.length===0?1/0:Math.min(...i.map(e=>e.startTime))}function h(e,t,n,r=p){if(e.length===0)return[];let i=n+r.bufferDuration,a=new Set(t.map(e=>e.startTime));return e.filter(e=>{let t=e.startTime+e.duration,r=e.startTime<i&&t>n,o=!a.has(e.startTime);return r&&o})}var ee=Object.defineProperty,te=(e,t,n)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t,n)=>(te(e,typeof t==`symbol`?t:t+``,n),n),ne=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},_=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},v=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},re=(e,t,n)=>(ne(e,t,`access private method`),n);
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e,r as t}from"./safe-define-
|
|
2
|
-
//# sourceMappingURL=media-attach-mixin-
|
|
1
|
+
import{o as e,r as t}from"./safe-define-t0AGOouq.js";function n(t){return n=>{class r extends n{#e=null;#t=null;getMediaTarget(){return this}connectedCallback(){super.connectedCallback?.(),this.dispatchEvent(new e(t,this,(e,t)=>{t&&(this.#t=t),this.#e=e?.setMedia??null,this.isConnected&&this.#e?.(this.getMediaTarget())},!0))}disconnectedCallback(){super.disconnectedCallback?.(),this.#e?.(null),this.#t?.(),this.#t=null,this.#e=null}}return r}}const r=n(t);export{r as t};
|
|
2
|
+
//# sourceMappingURL=media-attach-mixin-ByJOWMNT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-attach-mixin-
|
|
1
|
+
{"version":3,"file":"media-attach-mixin-ByJOWMNT.js","names":["ContextEvent","#unsubscribe","#setMedia"],"sources":["../src/store/media-attach-mixin.ts"],"sourcesContent":["import type { Media } from '@videojs/core/dom';\nimport { ContextEvent } from '@videojs/element/context';\nimport type { CustomElement } from '@videojs/utils/dom';\nimport type { AnyConstructor, Constructor } from '@videojs/utils/types';\nimport { type MediaContext, mediaContext } from '../player/context';\n\nexport type MediaAttachMixin = <Class extends AnyConstructor<HTMLElement>>(BaseClass: Class) => Class;\n\n/**\n * Create a mixin that consumes `mediaContext` and registers the\n * element as the media with the provider.\n *\n * Uses the raw context-request protocol so it works with any\n * `HTMLElement` subclass — no `ReactiveControllerHost` required.\n *\n * @param context - The media context to consume.\n */\nexport function createMediaAttachMixin(context: MediaContext): MediaAttachMixin {\n return <Class extends AnyConstructor<HTMLElement>>(BaseClass: Class) => {\n class MediaAttachElement extends (BaseClass as unknown as Constructor<CustomElement>) {\n #setMedia: ((media: Media | null) => void) | null = null;\n #unsubscribe: (() => void) | null = null;\n\n getMediaTarget(): Media | null {\n return this as unknown as Media;\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n\n this.dispatchEvent(\n new ContextEvent(\n context,\n this,\n (value, unsubscribe) => {\n if (unsubscribe) this.#unsubscribe = unsubscribe;\n this.#setMedia = value?.setMedia ?? null;\n if (this.isConnected) {\n this.#setMedia?.(this.getMediaTarget());\n }\n },\n true\n )\n );\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#setMedia?.(null);\n this.#unsubscribe?.();\n this.#unsubscribe = null;\n this.#setMedia = null;\n }\n }\n\n return MediaAttachElement as unknown as Class;\n };\n}\n\nexport const MediaAttachMixin = createMediaAttachMixin(mediaContext);\n"],"mappings":"qDAiBA,SAAgB,EAAuB,EAAyC,CAC9E,MAAmD,IAAqB,CACtE,MAAM,UAA4B,CAAoD,CACpF,GAAoD,KACpD,GAAoC,KAEpC,gBAA+B,CAC7B,OAAO,KAGT,mBAA6B,CAC3B,MAAM,qBAAqB,CAE3B,KAAK,cACH,IAAIA,EACF,EACA,MACC,EAAO,IAAgB,CAClB,IAAa,MAAA,EAAoB,GACrC,MAAA,EAAiB,GAAO,UAAY,KAChC,KAAK,aACP,MAAA,IAAiB,KAAK,gBAAgB,CAAC,EAG3C,GACD,CACF,CAGH,sBAAgC,CAC9B,MAAM,wBAAwB,CAC9B,MAAA,IAAiB,KAAK,CACtB,MAAA,KAAqB,CACrB,MAAA,EAAoB,KACpB,MAAA,EAAiB,MAIrB,OAAO,GAIX,MAAa,EAAmB,EAAuB,EAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as ContextRequestEvent, r as mediaContext } from "./safe-define-
|
|
1
|
+
import { o as ContextRequestEvent, r as mediaContext } from "./safe-define-Bw8JF08z.js";
|
|
2
2
|
|
|
3
3
|
//#region src/store/media-attach-mixin.ts
|
|
4
4
|
/**
|
|
@@ -41,4 +41,4 @@ const MediaAttachMixin = createMediaAttachMixin(mediaContext);
|
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { MediaAttachMixin as t };
|
|
44
|
-
//# sourceMappingURL=media-attach-mixin-
|
|
44
|
+
//# sourceMappingURL=media-attach-mixin-CkU58gjb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-attach-mixin-
|
|
1
|
+
{"version":3,"file":"media-attach-mixin-CkU58gjb.js","names":["ContextEvent","#unsubscribe","#setMedia"],"sources":["../src/store/media-attach-mixin.ts"],"sourcesContent":["import type { Media } from '@videojs/core/dom';\nimport { ContextEvent } from '@videojs/element/context';\nimport type { CustomElement } from '@videojs/utils/dom';\nimport type { AnyConstructor, Constructor } from '@videojs/utils/types';\nimport { type MediaContext, mediaContext } from '../player/context';\n\nexport type MediaAttachMixin = <Class extends AnyConstructor<HTMLElement>>(BaseClass: Class) => Class;\n\n/**\n * Create a mixin that consumes `mediaContext` and registers the\n * element as the media with the provider.\n *\n * Uses the raw context-request protocol so it works with any\n * `HTMLElement` subclass — no `ReactiveControllerHost` required.\n *\n * @param context - The media context to consume.\n */\nexport function createMediaAttachMixin(context: MediaContext): MediaAttachMixin {\n return <Class extends AnyConstructor<HTMLElement>>(BaseClass: Class) => {\n class MediaAttachElement extends (BaseClass as unknown as Constructor<CustomElement>) {\n #setMedia: ((media: Media | null) => void) | null = null;\n #unsubscribe: (() => void) | null = null;\n\n getMediaTarget(): Media | null {\n return this as unknown as Media;\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n\n this.dispatchEvent(\n new ContextEvent(\n context,\n this,\n (value, unsubscribe) => {\n if (unsubscribe) this.#unsubscribe = unsubscribe;\n this.#setMedia = value?.setMedia ?? null;\n if (this.isConnected) {\n this.#setMedia?.(this.getMediaTarget());\n }\n },\n true\n )\n );\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#setMedia?.(null);\n this.#unsubscribe?.();\n this.#unsubscribe = null;\n this.#setMedia = null;\n }\n }\n\n return MediaAttachElement as unknown as Class;\n };\n}\n\nexport const MediaAttachMixin = createMediaAttachMixin(mediaContext);\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,uBAAuB,SAAyC;AAC9E,SAAmD,cAAqB;EACtE,MAAM,2BAA4B,UAAoD;GACpF,YAAoD;GACpD,eAAoC;GAEpC,iBAA+B;AAC7B,WAAO;;GAGT,AAAS,oBAAoB;AAC3B,UAAM,qBAAqB;AAE3B,SAAK,cACH,IAAIA,oBACF,SACA,OACC,OAAO,gBAAgB;AACtB,SAAI,YAAa,OAAKC,cAAe;AACrC,WAAKC,WAAY,OAAO,YAAY;AACpC,SAAI,KAAK,YACP,OAAKA,WAAY,KAAK,gBAAgB,CAAC;OAG3C,KACD,CACF;;GAGH,AAAS,uBAAuB;AAC9B,UAAM,wBAAwB;AAC9B,UAAKA,WAAY,KAAK;AACtB,UAAKD,eAAgB;AACrB,UAAKA,cAAe;AACpB,UAAKC,WAAY;;;AAIrB,SAAO;;;AAIX,MAAa,mBAAmB,uBAAuB,aAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as MediaElement, i as MediaContainerElement, t as createPlayer, z as audioFeatures } from "./create-player-
|
|
2
|
-
import { t as safeDefine } from "./safe-define-
|
|
1
|
+
import { a as MediaElement, i as MediaContainerElement, t as createPlayer, z as audioFeatures } from "./create-player-C2h3JeGl.js";
|
|
2
|
+
import { t as safeDefine } from "./safe-define-Bw8JF08z.js";
|
|
3
3
|
|
|
4
4
|
//#region src/define/audio/player.ts
|
|
5
5
|
const { ProviderMixin } = createPlayer({ features: audioFeatures });
|
|
@@ -12,4 +12,4 @@ safeDefine(AudioPlayerElement);
|
|
|
12
12
|
safeDefine(MediaContainerElement);
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
|
-
//# sourceMappingURL=player-
|
|
15
|
+
//# sourceMappingURL=player-BWRklsUx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player-
|
|
1
|
+
{"version":3,"file":"player-BWRklsUx.js","names":[],"sources":["../src/define/audio/player.ts"],"sourcesContent":["import { audioFeatures } from '@videojs/core/dom';\nimport { MediaContainerElement } from '../../media/container-element';\nimport { createPlayer } from '../../player/create-player';\nimport { MediaElement } from '../../ui/media-element';\nimport { safeDefine } from '../safe-define';\n\nconst { ProviderMixin } = createPlayer({\n features: audioFeatures,\n});\n\nexport class AudioPlayerElement extends ProviderMixin(MediaElement) {\n static readonly tagName = 'audio-player';\n}\n\n// Provider must be defined before consumer for context handshake during upgrade.\nsafeDefine(AudioPlayerElement);\nsafeDefine(MediaContainerElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [AudioPlayerElement.tagName]: AudioPlayerElement;\n }\n}\n"],"mappings":";;;;AAMA,MAAM,EAAE,kBAAkB,aAAa,EACrC,UAAU,eACX,CAAC;AAEF,IAAa,qBAAb,cAAwC,cAAc,aAAa,CAAC;;iBACxC;;;AAI5B,WAAW,mBAAmB;AAC9B,WAAW,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player-
|
|
1
|
+
{"version":3,"file":"player-DOTrw60d.js","names":[],"sources":["../src/define/audio/player.ts"],"sourcesContent":["import { audioFeatures } from '@videojs/core/dom';\nimport { MediaContainerElement } from '../../media/container-element';\nimport { createPlayer } from '../../player/create-player';\nimport { MediaElement } from '../../ui/media-element';\nimport { safeDefine } from '../safe-define';\n\nconst { ProviderMixin } = createPlayer({\n features: audioFeatures,\n});\n\nexport class AudioPlayerElement extends ProviderMixin(MediaElement) {\n static readonly tagName = 'audio-player';\n}\n\n// Provider must be defined before consumer for context handshake during upgrade.\nsafeDefine(AudioPlayerElement);\nsafeDefine(MediaContainerElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [AudioPlayerElement.tagName]: AudioPlayerElement;\n }\n}\n"],"mappings":"mHAMA,KAAM,CAAE,iBAAkB,EAAa,CACrC,SAAU,EACX,CAAC,CAOF,EALA,cAAwC,EAAc,EAAa,AAAC,qBACxC,iBAIE,CAC9B,EAAW,EAAsB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{B as e,M as t,N as n,a as r,c as i,i as a,j as o,k as s,l as c,n as l,s as u,t as d}from"./create-player-
|
|
2
|
-
//# sourceMappingURL=poster-
|
|
1
|
+
import{B as e,M as t,N as n,a as r,c as i,i as a,j as o,k as s,l as c,n as l,s as u,t as d}from"./create-player-i0Q36S9_.js";import{a as f,c as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./volume-slider-C7rEWi11.js";import{a as w,i as T,t as E}from"./safe-define-t0AGOouq.js";const{ProviderMixin:D}=d({features:e});E(class extends D(r){static{this.tagName=`video-player`}}),E(a),E(class extends r{constructor(...e){super(...e),this.delay=g.defaultProps.delay}static{this.tagName=`media-buffering-indicator`}static{this.properties={delay:{type:Number}}}#e=new g;#t=new l(this,T,n);#n=null;connectedCallback(){super.connectedCallback(),this.#n=new AbortController,this.#e.state.subscribe(()=>this.requestUpdate(),{signal:this.#n.signal})}disconnectedCallback(){super.disconnectedCallback(),this.#n?.abort(),this.#n=null}willUpdate(e){super.willUpdate(e),this.#e.setProps(this)}update(e){super.update(e);let t=this.#t.value;t&&(this.#e.update(t),c(this,this.#e.state.current,y))}});const O=w(Symbol(`@videojs/controls`));var k=class extends r{static{this.tagName=`media-controls`}#e=new C;#t=new l(this,T,s);#n=new u(this,{context:O});connectedCallback(){super.connectedCallback()}update(e){super.update(e);let t=this.#t.value;if(!t)return;this.#e.setMedia(t);let n=this.#e.getState();c(this,n,h),this.#n.setValue({state:n,stateAttrMap:h})}},A=class extends S{constructor(...e){super(...e),this.consumer=new i(this,{context:O,subscribe:!0})}static{this.tagName=`media-controls-group`}connectedCallback(){super.connectedCallback(),(this.hasAttribute(`aria-label`)||this.hasAttribute(`aria-labelledby`))&&this.setAttribute(`role`,`group`)}};E(k),E(A),E(class extends _{constructor(...e){super(...e),this.core=new p,this.stateAttrMap=x,this.mediaState=new l(this,T,o)}static{this.tagName=`media-fullscreen-button`}activate(e){this.core.toggle(e)}}),E(class extends _{constructor(...e){super(...e),this.core=new v,this.stateAttrMap=f,this.mediaState=new l(this,T,t)}static{this.tagName=`media-pip-button`}activate(e){this.core.toggle(e)}});var j=class extends r{connectedCallback(){super.connectedCallback()}update(e){super.update(e);let t=this.mediaState.value;if(!t)return;this.core.setMedia(t);let n=this.core.getState();c(this,n,this.stateAttrMap)}};E(class extends j{constructor(...e){super(...e),this.core=new m,this.stateAttrMap=b,this.mediaState=new l(this,T,n)}static{this.tagName=`media-poster`}});
|
|
2
|
+
//# sourceMappingURL=poster-CRi_NWaR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poster-DqjXzMK_.js","names":["#core","#state","#disconnect","createContext","#core","#mediaState","#provider","ContextProvider","ContextConsumer"],"sources":["../src/define/video/player.ts","../src/ui/buffering-indicator/buffering-indicator-element.ts","../src/define/ui/buffering-indicator.ts","../src/ui/controls/context.ts","../src/ui/controls/controls-element.ts","../src/ui/controls/controls-group-element.ts","../src/define/ui/controls.ts","../src/ui/fullscreen-button/fullscreen-button-element.ts","../src/define/ui/fullscreen-button.ts","../src/ui/pip-button/pip-button-element.ts","../src/define/ui/pip-button.ts","../src/ui/media-ui-element.ts","../src/ui/poster/poster-element.ts","../src/define/ui/poster.ts"],"sourcesContent":["import { videoFeatures } from '@videojs/core/dom';\nimport { MediaContainerElement } from '../../media/container-element';\nimport { createPlayer } from '../../player/create-player';\nimport { MediaElement } from '../../ui/media-element';\nimport { safeDefine } from '../safe-define';\n\nconst { ProviderMixin } = createPlayer({\n features: videoFeatures,\n});\n\nexport class VideoPlayerElement extends ProviderMixin(MediaElement) {\n static readonly tagName = 'video-player';\n}\n\n// Provider must be defined before consumer for context handshake during upgrade.\nsafeDefine(VideoPlayerElement);\nsafeDefine(MediaContainerElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [VideoPlayerElement.tagName]: VideoPlayerElement;\n }\n}\n","import { BufferingIndicatorCore, BufferingIndicatorDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectPlayback } from '@videojs/core/dom';\nimport type { PropertyDeclarationMap, PropertyValues } from '@videojs/element';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\n\nexport class BufferingIndicatorElement extends MediaElement {\n static readonly tagName = 'media-buffering-indicator';\n\n static override properties = {\n delay: { type: Number },\n } satisfies PropertyDeclarationMap<keyof BufferingIndicatorCore.Props>;\n\n delay = BufferingIndicatorCore.defaultProps.delay;\n\n readonly #core = new BufferingIndicatorCore();\n readonly #state = new PlayerController(this, playerContext, selectPlayback);\n\n #disconnect: AbortController | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this.#disconnect = new AbortController();\n\n this.#core.state.subscribe(() => this.requestUpdate(), {\n signal: this.#disconnect.signal,\n });\n\n if (__DEV__ && !this.#state.value) {\n logMissingFeature(this.localName, this.#state.displayName!);\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#disconnect?.abort();\n this.#disconnect = null;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this.#core.setProps(this);\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.#state.value;\n\n if (!media) return;\n\n this.#core.update(media);\n applyStateDataAttrs(this, this.#core.state.current, BufferingIndicatorDataAttrs);\n }\n}\n","import { BufferingIndicatorElement } from '../../ui/buffering-indicator/buffering-indicator-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(BufferingIndicatorElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [BufferingIndicatorElement.tagName]: BufferingIndicatorElement;\n }\n}\n","import type { ControlsState, StateAttrMap } from '@videojs/core';\nimport { createContext } from '@videojs/element/context';\n\nexport interface ControlsContextValue {\n state: ControlsState;\n stateAttrMap: StateAttrMap<ControlsState>;\n}\n\nconst CONTROLS_CONTEXT_KEY = Symbol('@videojs/controls');\n\nexport const controlsContext = createContext<ControlsContextValue>(CONTROLS_CONTEXT_KEY);\n","import { ControlsCore, ControlsDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectControls } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\nimport { ContextProvider } from '@videojs/element/context';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\nimport { controlsContext } from './context';\n\nexport class ControlsElement extends MediaElement {\n static readonly tagName = 'media-controls';\n\n readonly #core = new ControlsCore();\n readonly #mediaState = new PlayerController(this, playerContext, selectControls);\n readonly #provider = new ContextProvider(this, { context: controlsContext });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.#mediaState.value && this.#mediaState.displayName) {\n logMissingFeature(this.localName, this.#mediaState.displayName);\n }\n }\n\n protected override update(_changed: PropertyValues): void {\n super.update(_changed);\n\n const media = this.#mediaState.value;\n if (!media) return;\n\n this.#core.setMedia(media);\n const state = this.#core.getState();\n\n applyStateDataAttrs(this, state, ControlsDataAttrs);\n\n this.#provider.setValue({\n state,\n stateAttrMap: ControlsDataAttrs,\n });\n }\n}\n","import type { ControlsState } from '@videojs/core';\nimport { ContextConsumer } from '@videojs/element/context';\n\nimport { ContextPartElement } from '../context-part-element';\nimport { controlsContext } from './context';\n\nexport class ControlsGroupElement extends ContextPartElement<ControlsState> {\n static readonly tagName = 'media-controls-group';\n\n protected readonly consumer = new ContextConsumer(this, { context: controlsContext, subscribe: true });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.hasAttribute('aria-label') || this.hasAttribute('aria-labelledby')) {\n this.setAttribute('role', 'group');\n }\n }\n}\n","import { ControlsElement } from '../../ui/controls/controls-element';\nimport { ControlsGroupElement } from '../../ui/controls/controls-group-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(ControlsElement);\nsafeDefine(ControlsGroupElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ControlsElement.tagName]: ControlsElement;\n }\n}\n","import { FullscreenButtonCore, FullscreenButtonDataAttrs, type MediaFullscreenState } from '@videojs/core';\nimport { selectFullscreen } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class FullscreenButtonElement extends MediaButtonElement<FullscreenButtonCore> {\n static readonly tagName = 'media-fullscreen-button';\n\n protected readonly core = new FullscreenButtonCore();\n protected readonly stateAttrMap = FullscreenButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectFullscreen);\n\n protected activate(state: MediaFullscreenState): void {\n this.core.toggle(state);\n }\n}\n","import { FullscreenButtonElement } from '../../ui/fullscreen-button/fullscreen-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(FullscreenButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [FullscreenButtonElement.tagName]: FullscreenButtonElement;\n }\n}\n","import { type MediaPictureInPictureState, PiPButtonCore, PiPButtonDataAttrs } from '@videojs/core';\nimport { selectPiP } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class PiPButtonElement extends MediaButtonElement<PiPButtonCore> {\n static readonly tagName = 'media-pip-button';\n\n protected readonly core = new PiPButtonCore();\n protected readonly stateAttrMap = PiPButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPiP);\n\n protected activate(state: MediaPictureInPictureState): void {\n this.core.toggle(state);\n }\n}\n","import { PiPButtonElement } from '../../ui/pip-button/pip-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PiPButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PiPButtonElement.tagName]: PiPButtonElement;\n }\n}\n","import type { InferComponentState, InferMediaState, MediaUIComponent, StateAttrMap } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\n\nimport type { PlayerController } from '../player/player-controller';\nimport { MediaElement } from './media-element';\n\n/** Abstract base for HTML custom elements that display media state with data attributes. */\nexport abstract class MediaUIElement<Core extends MediaUIComponent> extends MediaElement {\n protected abstract readonly core: Core;\n protected abstract readonly stateAttrMap: StateAttrMap<InferComponentState<Core>>;\n protected abstract readonly mediaState: PlayerController<any, InferMediaState<Core> | undefined>;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.mediaState.value && this.mediaState.displayName) {\n logMissingFeature(this.localName, this.mediaState.displayName);\n }\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.mediaState.value;\n\n if (!media) return;\n\n this.core.setMedia(media);\n const state = this.core.getState();\n applyStateDataAttrs(this, state, this.stateAttrMap);\n }\n}\n","import { PosterCore, PosterDataAttrs } from '@videojs/core';\nimport { selectPlayback } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaUIElement } from '../media-ui-element';\n\nexport class PosterElement extends MediaUIElement<PosterCore> {\n static readonly tagName = 'media-poster';\n\n protected readonly core = new PosterCore();\n protected readonly stateAttrMap = PosterDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPlayback);\n}\n","import { PosterElement } from '../../ui/poster/poster-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PosterElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PosterElement.tagName]: PosterElement;\n }\n}\n"],"mappings":"sTAMA,KAAM,CAAE,iBAAkB,EAAa,CACrC,SAAU,EACX,CAAC,CAOF,EALA,cAAwC,EAAc,EAAa,AAAC,qBACxC,iBAIE,CAC9B,EAAW,EAAsB,CEbjC,EDKA,cAA+C,CAAa,0CAOlD,EAAuB,aAAa,0BANlB,mDAEG,CAC3B,MAAO,CAAE,KAAM,OAAQ,CACxB,CAID,GAAiB,IAAI,EACrB,GAAkB,IAAI,EAAiB,KAAM,EAAe,EAAe,CAE3E,GAAsC,KAEtC,mBAAmC,CACjC,MAAM,mBAAmB,CAEzB,MAAA,EAAmB,IAAI,gBAEvB,MAAA,EAAW,MAAM,cAAgB,KAAK,eAAe,CAAE,CACrD,OAAQ,MAAA,EAAiB,OAC1B,CAAC,CAOJ,sBAAsC,CACpC,MAAM,sBAAsB,CAC5B,MAAA,GAAkB,OAAO,CACzB,MAAA,EAAmB,KAGrB,WAA8B,EAA+B,CAC3D,MAAM,WAAW,EAAQ,CACzB,MAAA,EAAW,SAAS,KAAK,CAG3B,OAA0B,EAA+B,CACvD,MAAM,OAAO,EAAQ,CAErB,IAAM,EAAQ,MAAA,EAAY,MAErB,IAEL,MAAA,EAAW,OAAO,EAAM,CACxB,EAAoB,KAAM,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O,EAAQ,CAErB,IAAM,EAAQ,KAAK,WAAW,MAE9B,GAAI,CAAC,EAAO,OAEZ,KAAK,KAAK,SAAS,EAAM,CACzB,IAAM,EAAQ,KAAK,KAAK,UAAU,CAClC,EAAoB,KAAM,EAAO,KAAK,aAAa,GE3BvD,EDIA,cAAmC,CAA2B,yCAGlC,IAAI,oBACI,kBACF,IAAI,EAAiB,KAAM,EAAe,EAAe,qBAJ/D,iBCLH"}
|
|
1
|
+
{"version":3,"file":"poster-CRi_NWaR.js","names":["#core","#state","#disconnect","createContext","#core","#mediaState","#provider","ContextProvider","ContextConsumer"],"sources":["../src/define/video/player.ts","../src/ui/buffering-indicator/buffering-indicator-element.ts","../src/define/ui/buffering-indicator.ts","../src/ui/controls/context.ts","../src/ui/controls/controls-element.ts","../src/ui/controls/controls-group-element.ts","../src/define/ui/controls.ts","../src/ui/fullscreen-button/fullscreen-button-element.ts","../src/define/ui/fullscreen-button.ts","../src/ui/pip-button/pip-button-element.ts","../src/define/ui/pip-button.ts","../src/ui/media-ui-element.ts","../src/ui/poster/poster-element.ts","../src/define/ui/poster.ts"],"sourcesContent":["import { videoFeatures } from '@videojs/core/dom';\nimport { MediaContainerElement } from '../../media/container-element';\nimport { createPlayer } from '../../player/create-player';\nimport { MediaElement } from '../../ui/media-element';\nimport { safeDefine } from '../safe-define';\n\nconst { ProviderMixin } = createPlayer({\n features: videoFeatures,\n});\n\nexport class VideoPlayerElement extends ProviderMixin(MediaElement) {\n static readonly tagName = 'video-player';\n}\n\n// Provider must be defined before consumer for context handshake during upgrade.\nsafeDefine(VideoPlayerElement);\nsafeDefine(MediaContainerElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [VideoPlayerElement.tagName]: VideoPlayerElement;\n }\n}\n","import { BufferingIndicatorCore, BufferingIndicatorDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectPlayback } from '@videojs/core/dom';\nimport type { PropertyDeclarationMap, PropertyValues } from '@videojs/element';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\n\nexport class BufferingIndicatorElement extends MediaElement {\n static readonly tagName = 'media-buffering-indicator';\n\n static override properties = {\n delay: { type: Number },\n } satisfies PropertyDeclarationMap<keyof BufferingIndicatorCore.Props>;\n\n delay = BufferingIndicatorCore.defaultProps.delay;\n\n readonly #core = new BufferingIndicatorCore();\n readonly #state = new PlayerController(this, playerContext, selectPlayback);\n\n #disconnect: AbortController | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this.#disconnect = new AbortController();\n\n this.#core.state.subscribe(() => this.requestUpdate(), {\n signal: this.#disconnect.signal,\n });\n\n if (__DEV__ && !this.#state.value) {\n logMissingFeature(this.localName, this.#state.displayName!);\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#disconnect?.abort();\n this.#disconnect = null;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this.#core.setProps(this);\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.#state.value;\n\n if (!media) return;\n\n this.#core.update(media);\n applyStateDataAttrs(this, this.#core.state.current, BufferingIndicatorDataAttrs);\n }\n}\n","import { BufferingIndicatorElement } from '../../ui/buffering-indicator/buffering-indicator-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(BufferingIndicatorElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [BufferingIndicatorElement.tagName]: BufferingIndicatorElement;\n }\n}\n","import type { ControlsState, StateAttrMap } from '@videojs/core';\nimport { createContext } from '@videojs/element/context';\n\nexport interface ControlsContextValue {\n state: ControlsState;\n stateAttrMap: StateAttrMap<ControlsState>;\n}\n\nconst CONTROLS_CONTEXT_KEY = Symbol('@videojs/controls');\n\nexport const controlsContext = createContext<ControlsContextValue>(CONTROLS_CONTEXT_KEY);\n","import { ControlsCore, ControlsDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectControls } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\nimport { ContextProvider } from '@videojs/element/context';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\nimport { controlsContext } from './context';\n\nexport class ControlsElement extends MediaElement {\n static readonly tagName = 'media-controls';\n\n readonly #core = new ControlsCore();\n readonly #mediaState = new PlayerController(this, playerContext, selectControls);\n readonly #provider = new ContextProvider(this, { context: controlsContext });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.#mediaState.value && this.#mediaState.displayName) {\n logMissingFeature(this.localName, this.#mediaState.displayName);\n }\n }\n\n protected override update(_changed: PropertyValues): void {\n super.update(_changed);\n\n const media = this.#mediaState.value;\n if (!media) return;\n\n this.#core.setMedia(media);\n const state = this.#core.getState();\n\n applyStateDataAttrs(this, state, ControlsDataAttrs);\n\n this.#provider.setValue({\n state,\n stateAttrMap: ControlsDataAttrs,\n });\n }\n}\n","import type { ControlsState } from '@videojs/core';\nimport { ContextConsumer } from '@videojs/element/context';\n\nimport { ContextPartElement } from '../context-part-element';\nimport { controlsContext } from './context';\n\nexport class ControlsGroupElement extends ContextPartElement<ControlsState> {\n static readonly tagName = 'media-controls-group';\n\n protected readonly consumer = new ContextConsumer(this, { context: controlsContext, subscribe: true });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.hasAttribute('aria-label') || this.hasAttribute('aria-labelledby')) {\n this.setAttribute('role', 'group');\n }\n }\n}\n","import { ControlsElement } from '../../ui/controls/controls-element';\nimport { ControlsGroupElement } from '../../ui/controls/controls-group-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(ControlsElement);\nsafeDefine(ControlsGroupElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ControlsElement.tagName]: ControlsElement;\n }\n}\n","import { FullscreenButtonCore, FullscreenButtonDataAttrs, type MediaFullscreenState } from '@videojs/core';\nimport { selectFullscreen } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class FullscreenButtonElement extends MediaButtonElement<FullscreenButtonCore> {\n static readonly tagName = 'media-fullscreen-button';\n\n protected readonly core = new FullscreenButtonCore();\n protected readonly stateAttrMap = FullscreenButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectFullscreen);\n\n protected activate(state: MediaFullscreenState): void {\n this.core.toggle(state);\n }\n}\n","import { FullscreenButtonElement } from '../../ui/fullscreen-button/fullscreen-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(FullscreenButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [FullscreenButtonElement.tagName]: FullscreenButtonElement;\n }\n}\n","import { type MediaPictureInPictureState, PiPButtonCore, PiPButtonDataAttrs } from '@videojs/core';\nimport { selectPiP } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class PiPButtonElement extends MediaButtonElement<PiPButtonCore> {\n static readonly tagName = 'media-pip-button';\n\n protected readonly core = new PiPButtonCore();\n protected readonly stateAttrMap = PiPButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPiP);\n\n protected activate(state: MediaPictureInPictureState): void {\n this.core.toggle(state);\n }\n}\n","import { PiPButtonElement } from '../../ui/pip-button/pip-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PiPButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PiPButtonElement.tagName]: PiPButtonElement;\n }\n}\n","import type { InferComponentState, InferMediaState, MediaUIComponent, StateAttrMap } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\n\nimport type { PlayerController } from '../player/player-controller';\nimport { MediaElement } from './media-element';\n\n/** Abstract base for HTML custom elements that display media state with data attributes. */\nexport abstract class MediaUIElement<Core extends MediaUIComponent> extends MediaElement {\n protected abstract readonly core: Core;\n protected abstract readonly stateAttrMap: StateAttrMap<InferComponentState<Core>>;\n protected abstract readonly mediaState: PlayerController<any, InferMediaState<Core> | undefined>;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.mediaState.value && this.mediaState.displayName) {\n logMissingFeature(this.localName, this.mediaState.displayName);\n }\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.mediaState.value;\n\n if (!media) return;\n\n this.core.setMedia(media);\n const state = this.core.getState();\n applyStateDataAttrs(this, state, this.stateAttrMap);\n }\n}\n","import { PosterCore, PosterDataAttrs } from '@videojs/core';\nimport { selectPlayback } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaUIElement } from '../media-ui-element';\n\nexport class PosterElement extends MediaUIElement<PosterCore> {\n static readonly tagName = 'media-poster';\n\n protected readonly core = new PosterCore();\n protected readonly stateAttrMap = PosterDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPlayback);\n}\n","import { PosterElement } from '../../ui/poster/poster-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PosterElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PosterElement.tagName]: PosterElement;\n }\n}\n"],"mappings":"sTAMA,KAAM,CAAE,iBAAkB,EAAa,CACrC,SAAU,EACX,CAAC,CAOF,EALA,cAAwC,EAAc,EAAa,AAAC,qBACxC,iBAIE,CAC9B,EAAW,EAAsB,CEbjC,EDKA,cAA+C,CAAa,0CAOlD,EAAuB,aAAa,0BANlB,mDAEG,CAC3B,MAAO,CAAE,KAAM,OAAQ,CACxB,CAID,GAAiB,IAAI,EACrB,GAAkB,IAAI,EAAiB,KAAM,EAAe,EAAe,CAE3E,GAAsC,KAEtC,mBAAmC,CACjC,MAAM,mBAAmB,CAEzB,MAAA,EAAmB,IAAI,gBAEvB,MAAA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,kBACF,IAAI,EAAiB,KAAM,EAAe,EAAiB,qBAJjE,0BAM1B,SAAmB,EAAmC,CACpD,KAAK,KAAK,OAAO,EAAM,GCZQ,CEAnC,EDIA,cAAsC,CAAkC,yCAG5C,IAAI,oBACI,kBACF,IAAI,EAAiB,KAAM,EAAe,EAAU,qBAJ1D,mBAM1B,SAAmB,EAAyC,CAC1D,KAAK,KAAK,OAAO,EAAM,GCZC,CCK5B,IAAsB,EAAtB,cAA4E,CAAa,CAKvF,mBAAmC,CACjC,MAAM,mBAAmB,CAO3B,OAA0B,EAA+B,CACvD,MAAM,OAAO,EAAQ,CAErB,IAAM,EAAQ,KAAK,WAAW,MAE9B,GAAI,CAAC,EAAO,OAEZ,KAAK,KAAK,SAAS,EAAM,CACzB,IAAM,EAAQ,KAAK,KAAK,UAAU,CAClC,EAAoB,KAAM,EAAO,KAAK,aAAa,GE3BvD,EDIA,cAAmC,CAA2B,yCAGlC,IAAI,oBACI,kBACF,IAAI,EAAiB,KAAM,EAAe,EAAe,qBAJ/D,iBCLH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as selectControls, M as selectFullscreen, N as selectPiP, P as selectPlayback, V as videoFeatures, a as MediaElement, c as ContextConsumer, i as MediaContainerElement, l as applyStateDataAttrs, n as PlayerController, s as ContextProvider, t as createPlayer, u as logMissingFeature } from "./create-player-
|
|
2
|
-
import { a as PiPButtonDataAttrs, c as FullscreenButtonCore, i as PosterCore, l as ControlsDataAttrs, m as BufferingIndicatorCore, n as MediaButtonElement, o as PiPButtonCore, p as BufferingIndicatorDataAttrs, r as PosterDataAttrs, s as FullscreenButtonDataAttrs, t as ContextPartElement, u as ControlsCore } from "./volume-slider-
|
|
3
|
-
import { a as createContext, i as playerContext, t as safeDefine } from "./safe-define-
|
|
1
|
+
import { A as selectControls, M as selectFullscreen, N as selectPiP, P as selectPlayback, V as videoFeatures, a as MediaElement, c as ContextConsumer, i as MediaContainerElement, l as applyStateDataAttrs, n as PlayerController, s as ContextProvider, t as createPlayer, u as logMissingFeature } from "./create-player-C2h3JeGl.js";
|
|
2
|
+
import { a as PiPButtonDataAttrs, c as FullscreenButtonCore, i as PosterCore, l as ControlsDataAttrs, m as BufferingIndicatorCore, n as MediaButtonElement, o as PiPButtonCore, p as BufferingIndicatorDataAttrs, r as PosterDataAttrs, s as FullscreenButtonDataAttrs, t as ContextPartElement, u as ControlsCore } from "./volume-slider-Dz_ND_4U.js";
|
|
3
|
+
import { a as createContext, i as playerContext, t as safeDefine } from "./safe-define-Bw8JF08z.js";
|
|
4
4
|
|
|
5
5
|
//#region src/define/video/player.ts
|
|
6
6
|
const { ProviderMixin } = createPlayer({ features: videoFeatures });
|
|
@@ -191,4 +191,4 @@ var PosterElement = class extends MediaUIElement {
|
|
|
191
191
|
safeDefine(PosterElement);
|
|
192
192
|
|
|
193
193
|
//#endregion
|
|
194
|
-
//# sourceMappingURL=poster-
|
|
194
|
+
//# sourceMappingURL=poster-Ds1EOmmU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poster-BPMPXyn3.js","names":["#core","#state","#disconnect","#core","#mediaState","#provider"],"sources":["../src/define/video/player.ts","../src/ui/buffering-indicator/buffering-indicator-element.ts","../src/define/ui/buffering-indicator.ts","../src/ui/controls/context.ts","../src/ui/controls/controls-element.ts","../src/ui/controls/controls-group-element.ts","../src/define/ui/controls.ts","../src/ui/fullscreen-button/fullscreen-button-element.ts","../src/define/ui/fullscreen-button.ts","../src/ui/pip-button/pip-button-element.ts","../src/define/ui/pip-button.ts","../src/ui/media-ui-element.ts","../src/ui/poster/poster-element.ts","../src/define/ui/poster.ts"],"sourcesContent":["import { videoFeatures } from '@videojs/core/dom';\nimport { MediaContainerElement } from '../../media/container-element';\nimport { createPlayer } from '../../player/create-player';\nimport { MediaElement } from '../../ui/media-element';\nimport { safeDefine } from '../safe-define';\n\nconst { ProviderMixin } = createPlayer({\n features: videoFeatures,\n});\n\nexport class VideoPlayerElement extends ProviderMixin(MediaElement) {\n static readonly tagName = 'video-player';\n}\n\n// Provider must be defined before consumer for context handshake during upgrade.\nsafeDefine(VideoPlayerElement);\nsafeDefine(MediaContainerElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [VideoPlayerElement.tagName]: VideoPlayerElement;\n }\n}\n","import { BufferingIndicatorCore, BufferingIndicatorDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectPlayback } from '@videojs/core/dom';\nimport type { PropertyDeclarationMap, PropertyValues } from '@videojs/element';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\n\nexport class BufferingIndicatorElement extends MediaElement {\n static readonly tagName = 'media-buffering-indicator';\n\n static override properties = {\n delay: { type: Number },\n } satisfies PropertyDeclarationMap<keyof BufferingIndicatorCore.Props>;\n\n delay = BufferingIndicatorCore.defaultProps.delay;\n\n readonly #core = new BufferingIndicatorCore();\n readonly #state = new PlayerController(this, playerContext, selectPlayback);\n\n #disconnect: AbortController | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this.#disconnect = new AbortController();\n\n this.#core.state.subscribe(() => this.requestUpdate(), {\n signal: this.#disconnect.signal,\n });\n\n if (__DEV__ && !this.#state.value) {\n logMissingFeature(this.localName, this.#state.displayName!);\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#disconnect?.abort();\n this.#disconnect = null;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this.#core.setProps(this);\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.#state.value;\n\n if (!media) return;\n\n this.#core.update(media);\n applyStateDataAttrs(this, this.#core.state.current, BufferingIndicatorDataAttrs);\n }\n}\n","import { BufferingIndicatorElement } from '../../ui/buffering-indicator/buffering-indicator-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(BufferingIndicatorElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [BufferingIndicatorElement.tagName]: BufferingIndicatorElement;\n }\n}\n","import type { ControlsState, StateAttrMap } from '@videojs/core';\nimport { createContext } from '@videojs/element/context';\n\nexport interface ControlsContextValue {\n state: ControlsState;\n stateAttrMap: StateAttrMap<ControlsState>;\n}\n\nconst CONTROLS_CONTEXT_KEY = Symbol('@videojs/controls');\n\nexport const controlsContext = createContext<ControlsContextValue>(CONTROLS_CONTEXT_KEY);\n","import { ControlsCore, ControlsDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectControls } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\nimport { ContextProvider } from '@videojs/element/context';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\nimport { controlsContext } from './context';\n\nexport class ControlsElement extends MediaElement {\n static readonly tagName = 'media-controls';\n\n readonly #core = new ControlsCore();\n readonly #mediaState = new PlayerController(this, playerContext, selectControls);\n readonly #provider = new ContextProvider(this, { context: controlsContext });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.#mediaState.value && this.#mediaState.displayName) {\n logMissingFeature(this.localName, this.#mediaState.displayName);\n }\n }\n\n protected override update(_changed: PropertyValues): void {\n super.update(_changed);\n\n const media = this.#mediaState.value;\n if (!media) return;\n\n this.#core.setMedia(media);\n const state = this.#core.getState();\n\n applyStateDataAttrs(this, state, ControlsDataAttrs);\n\n this.#provider.setValue({\n state,\n stateAttrMap: ControlsDataAttrs,\n });\n }\n}\n","import type { ControlsState } from '@videojs/core';\nimport { ContextConsumer } from '@videojs/element/context';\n\nimport { ContextPartElement } from '../context-part-element';\nimport { controlsContext } from './context';\n\nexport class ControlsGroupElement extends ContextPartElement<ControlsState> {\n static readonly tagName = 'media-controls-group';\n\n protected readonly consumer = new ContextConsumer(this, { context: controlsContext, subscribe: true });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.hasAttribute('aria-label') || this.hasAttribute('aria-labelledby')) {\n this.setAttribute('role', 'group');\n }\n }\n}\n","import { ControlsElement } from '../../ui/controls/controls-element';\nimport { ControlsGroupElement } from '../../ui/controls/controls-group-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(ControlsElement);\nsafeDefine(ControlsGroupElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ControlsElement.tagName]: ControlsElement;\n }\n}\n","import { FullscreenButtonCore, FullscreenButtonDataAttrs, type MediaFullscreenState } from '@videojs/core';\nimport { selectFullscreen } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class FullscreenButtonElement extends MediaButtonElement<FullscreenButtonCore> {\n static readonly tagName = 'media-fullscreen-button';\n\n protected readonly core = new FullscreenButtonCore();\n protected readonly stateAttrMap = FullscreenButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectFullscreen);\n\n protected activate(state: MediaFullscreenState): void {\n this.core.toggle(state);\n }\n}\n","import { FullscreenButtonElement } from '../../ui/fullscreen-button/fullscreen-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(FullscreenButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [FullscreenButtonElement.tagName]: FullscreenButtonElement;\n }\n}\n","import { type MediaPictureInPictureState, PiPButtonCore, PiPButtonDataAttrs } from '@videojs/core';\nimport { selectPiP } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class PiPButtonElement extends MediaButtonElement<PiPButtonCore> {\n static readonly tagName = 'media-pip-button';\n\n protected readonly core = new PiPButtonCore();\n protected readonly stateAttrMap = PiPButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPiP);\n\n protected activate(state: MediaPictureInPictureState): void {\n this.core.toggle(state);\n }\n}\n","import { PiPButtonElement } from '../../ui/pip-button/pip-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PiPButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PiPButtonElement.tagName]: PiPButtonElement;\n }\n}\n","import type { InferComponentState, InferMediaState, MediaUIComponent, StateAttrMap } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\n\nimport type { PlayerController } from '../player/player-controller';\nimport { MediaElement } from './media-element';\n\n/** Abstract base for HTML custom elements that display media state with data attributes. */\nexport abstract class MediaUIElement<Core extends MediaUIComponent> extends MediaElement {\n protected abstract readonly core: Core;\n protected abstract readonly stateAttrMap: StateAttrMap<InferComponentState<Core>>;\n protected abstract readonly mediaState: PlayerController<any, InferMediaState<Core> | undefined>;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.mediaState.value && this.mediaState.displayName) {\n logMissingFeature(this.localName, this.mediaState.displayName);\n }\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.mediaState.value;\n\n if (!media) return;\n\n this.core.setMedia(media);\n const state = this.core.getState();\n applyStateDataAttrs(this, state, this.stateAttrMap);\n }\n}\n","import { PosterCore, PosterDataAttrs } from '@videojs/core';\nimport { selectPlayback } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaUIElement } from '../media-ui-element';\n\nexport class PosterElement extends MediaUIElement<PosterCore> {\n static readonly tagName = 'media-poster';\n\n protected readonly core = new PosterCore();\n protected readonly stateAttrMap = PosterDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPlayback);\n}\n","import { PosterElement } from '../../ui/poster/poster-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PosterElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PosterElement.tagName]: PosterElement;\n }\n}\n"],"mappings":";;;;;AAMA,MAAM,EAAE,kBAAkB,aAAa,EACrC,UAAU,e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EzB,MAAe,CAAC,KAAK,WAAW,SAAS,KAAK,WAAW,YACvD,mBAAkB,KAAK,WAAW,KAAK,WAAW,YAAY;;CAIlE,AAAmB,OAAO,SAA+B;AACvD,QAAM,OAAO,QAAQ;EAErB,MAAM,QAAQ,KAAK,WAAW;AAE9B,MAAI,CAAC,MAAO;AAEZ,OAAK,KAAK,SAAS,MAAM;EACzB,MAAM,QAAQ,KAAK,KAAK,UAAU;AAClC,sBAAoB,MAAM,OAAO,KAAK,aAAa;;;;;;ACvBvD,IAAa,gBAAb,cAAmC,eAA2B;;;cAGlC,IAAI,YAAY;sBACR;oBACF,IAAI,iBAAiB,MAAM,eAAe,eAAe;;;iBAJ/D;;;;;;ACL5B,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"poster-Ds1EOmmU.js","names":["#core","#state","#disconnect","#core","#mediaState","#provider"],"sources":["../src/define/video/player.ts","../src/ui/buffering-indicator/buffering-indicator-element.ts","../src/define/ui/buffering-indicator.ts","../src/ui/controls/context.ts","../src/ui/controls/controls-element.ts","../src/ui/controls/controls-group-element.ts","../src/define/ui/controls.ts","../src/ui/fullscreen-button/fullscreen-button-element.ts","../src/define/ui/fullscreen-button.ts","../src/ui/pip-button/pip-button-element.ts","../src/define/ui/pip-button.ts","../src/ui/media-ui-element.ts","../src/ui/poster/poster-element.ts","../src/define/ui/poster.ts"],"sourcesContent":["import { videoFeatures } from '@videojs/core/dom';\nimport { MediaContainerElement } from '../../media/container-element';\nimport { createPlayer } from '../../player/create-player';\nimport { MediaElement } from '../../ui/media-element';\nimport { safeDefine } from '../safe-define';\n\nconst { ProviderMixin } = createPlayer({\n features: videoFeatures,\n});\n\nexport class VideoPlayerElement extends ProviderMixin(MediaElement) {\n static readonly tagName = 'video-player';\n}\n\n// Provider must be defined before consumer for context handshake during upgrade.\nsafeDefine(VideoPlayerElement);\nsafeDefine(MediaContainerElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [VideoPlayerElement.tagName]: VideoPlayerElement;\n }\n}\n","import { BufferingIndicatorCore, BufferingIndicatorDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectPlayback } from '@videojs/core/dom';\nimport type { PropertyDeclarationMap, PropertyValues } from '@videojs/element';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\n\nexport class BufferingIndicatorElement extends MediaElement {\n static readonly tagName = 'media-buffering-indicator';\n\n static override properties = {\n delay: { type: Number },\n } satisfies PropertyDeclarationMap<keyof BufferingIndicatorCore.Props>;\n\n delay = BufferingIndicatorCore.defaultProps.delay;\n\n readonly #core = new BufferingIndicatorCore();\n readonly #state = new PlayerController(this, playerContext, selectPlayback);\n\n #disconnect: AbortController | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this.#disconnect = new AbortController();\n\n this.#core.state.subscribe(() => this.requestUpdate(), {\n signal: this.#disconnect.signal,\n });\n\n if (__DEV__ && !this.#state.value) {\n logMissingFeature(this.localName, this.#state.displayName!);\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#disconnect?.abort();\n this.#disconnect = null;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this.#core.setProps(this);\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.#state.value;\n\n if (!media) return;\n\n this.#core.update(media);\n applyStateDataAttrs(this, this.#core.state.current, BufferingIndicatorDataAttrs);\n }\n}\n","import { BufferingIndicatorElement } from '../../ui/buffering-indicator/buffering-indicator-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(BufferingIndicatorElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [BufferingIndicatorElement.tagName]: BufferingIndicatorElement;\n }\n}\n","import type { ControlsState, StateAttrMap } from '@videojs/core';\nimport { createContext } from '@videojs/element/context';\n\nexport interface ControlsContextValue {\n state: ControlsState;\n stateAttrMap: StateAttrMap<ControlsState>;\n}\n\nconst CONTROLS_CONTEXT_KEY = Symbol('@videojs/controls');\n\nexport const controlsContext = createContext<ControlsContextValue>(CONTROLS_CONTEXT_KEY);\n","import { ControlsCore, ControlsDataAttrs } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature, selectControls } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\nimport { ContextProvider } from '@videojs/element/context';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\nimport { controlsContext } from './context';\n\nexport class ControlsElement extends MediaElement {\n static readonly tagName = 'media-controls';\n\n readonly #core = new ControlsCore();\n readonly #mediaState = new PlayerController(this, playerContext, selectControls);\n readonly #provider = new ContextProvider(this, { context: controlsContext });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.#mediaState.value && this.#mediaState.displayName) {\n logMissingFeature(this.localName, this.#mediaState.displayName);\n }\n }\n\n protected override update(_changed: PropertyValues): void {\n super.update(_changed);\n\n const media = this.#mediaState.value;\n if (!media) return;\n\n this.#core.setMedia(media);\n const state = this.#core.getState();\n\n applyStateDataAttrs(this, state, ControlsDataAttrs);\n\n this.#provider.setValue({\n state,\n stateAttrMap: ControlsDataAttrs,\n });\n }\n}\n","import type { ControlsState } from '@videojs/core';\nimport { ContextConsumer } from '@videojs/element/context';\n\nimport { ContextPartElement } from '../context-part-element';\nimport { controlsContext } from './context';\n\nexport class ControlsGroupElement extends ContextPartElement<ControlsState> {\n static readonly tagName = 'media-controls-group';\n\n protected readonly consumer = new ContextConsumer(this, { context: controlsContext, subscribe: true });\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.hasAttribute('aria-label') || this.hasAttribute('aria-labelledby')) {\n this.setAttribute('role', 'group');\n }\n }\n}\n","import { ControlsElement } from '../../ui/controls/controls-element';\nimport { ControlsGroupElement } from '../../ui/controls/controls-group-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(ControlsElement);\nsafeDefine(ControlsGroupElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ControlsElement.tagName]: ControlsElement;\n }\n}\n","import { FullscreenButtonCore, FullscreenButtonDataAttrs, type MediaFullscreenState } from '@videojs/core';\nimport { selectFullscreen } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class FullscreenButtonElement extends MediaButtonElement<FullscreenButtonCore> {\n static readonly tagName = 'media-fullscreen-button';\n\n protected readonly core = new FullscreenButtonCore();\n protected readonly stateAttrMap = FullscreenButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectFullscreen);\n\n protected activate(state: MediaFullscreenState): void {\n this.core.toggle(state);\n }\n}\n","import { FullscreenButtonElement } from '../../ui/fullscreen-button/fullscreen-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(FullscreenButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [FullscreenButtonElement.tagName]: FullscreenButtonElement;\n }\n}\n","import { type MediaPictureInPictureState, PiPButtonCore, PiPButtonDataAttrs } from '@videojs/core';\nimport { selectPiP } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaButtonElement } from '../media-button-element';\n\nexport class PiPButtonElement extends MediaButtonElement<PiPButtonCore> {\n static readonly tagName = 'media-pip-button';\n\n protected readonly core = new PiPButtonCore();\n protected readonly stateAttrMap = PiPButtonDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPiP);\n\n protected activate(state: MediaPictureInPictureState): void {\n this.core.toggle(state);\n }\n}\n","import { PiPButtonElement } from '../../ui/pip-button/pip-button-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PiPButtonElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PiPButtonElement.tagName]: PiPButtonElement;\n }\n}\n","import type { InferComponentState, InferMediaState, MediaUIComponent, StateAttrMap } from '@videojs/core';\nimport { applyStateDataAttrs, logMissingFeature } from '@videojs/core/dom';\nimport type { PropertyValues } from '@videojs/element';\n\nimport type { PlayerController } from '../player/player-controller';\nimport { MediaElement } from './media-element';\n\n/** Abstract base for HTML custom elements that display media state with data attributes. */\nexport abstract class MediaUIElement<Core extends MediaUIComponent> extends MediaElement {\n protected abstract readonly core: Core;\n protected abstract readonly stateAttrMap: StateAttrMap<InferComponentState<Core>>;\n protected abstract readonly mediaState: PlayerController<any, InferMediaState<Core> | undefined>;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (__DEV__ && !this.mediaState.value && this.mediaState.displayName) {\n logMissingFeature(this.localName, this.mediaState.displayName);\n }\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n const media = this.mediaState.value;\n\n if (!media) return;\n\n this.core.setMedia(media);\n const state = this.core.getState();\n applyStateDataAttrs(this, state, this.stateAttrMap);\n }\n}\n","import { PosterCore, PosterDataAttrs } from '@videojs/core';\nimport { selectPlayback } from '@videojs/core/dom';\n\nimport { playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaUIElement } from '../media-ui-element';\n\nexport class PosterElement extends MediaUIElement<PosterCore> {\n static readonly tagName = 'media-poster';\n\n protected readonly core = new PosterCore();\n protected readonly stateAttrMap = PosterDataAttrs;\n protected readonly mediaState = new PlayerController(this, playerContext, selectPlayback);\n}\n","import { PosterElement } from '../../ui/poster/poster-element';\nimport { safeDefine } from '../safe-define';\n\nsafeDefine(PosterElement);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [PosterElement.tagName]: PosterElement;\n }\n}\n"],"mappings":";;;;;AAMA,MAAM,EAAE,kBAAkB,aAAa,EACrC,UAAU,eACX,CAAC;AAEF,IAAa,qBAAb,cAAwC,cAAc,aAAa,CAAC;;iBACxC;;;AAI5B,WAAW,mBAAmB;AAC9B,WAAW,sBAAsB;;;;ACRjC,IAAa,4BAAb,cAA+C,aAAa;;;eAOlD,uBAAuB,aAAa;;;i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AW;AAE9B,MAAI,CAAC,MAAO;AAEZ,OAAK,KAAK,SAAS,MAAM;EACzB,MAAM,QAAQ,KAAK,KAAK,UAAU;AAClC,sBAAoB,MAAM,OAAO,KAAK,aAAa;;;;;;ACvBvD,IAAa,gBAAb,cAAmC,eAA2B;;;cAGlC,IAAI,YAAY;sBACR;oBACF,IAAI,iBAAiB,MAAM,eAAe,eAAe;;;iBAJ/D;;;;;;ACL5B,WAAW,cAAc"}
|
|
@@ -34,7 +34,7 @@ function defineClassPropHooks(Class, BaseClassProto) {
|
|
|
34
34
|
* The `get`, `set`, and `call` methods can be overridden to provide catch-all custom behavior.
|
|
35
35
|
*/
|
|
36
36
|
const ProxyMixin = (PrimaryClass, ...AdditionalClasses) => {
|
|
37
|
-
class MediaProxy
|
|
37
|
+
class MediaProxy {
|
|
38
38
|
#target = null;
|
|
39
39
|
get target() {
|
|
40
40
|
return this.#target;
|
|
@@ -56,6 +56,15 @@ const ProxyMixin = (PrimaryClass, ...AdditionalClasses) => {
|
|
|
56
56
|
if (!this.#target) return;
|
|
57
57
|
this.#target = null;
|
|
58
58
|
}
|
|
59
|
+
addEventListener(type, listener, options) {
|
|
60
|
+
this.#target?.addEventListener(type, listener, options);
|
|
61
|
+
}
|
|
62
|
+
removeEventListener(type, listener, options) {
|
|
63
|
+
this.#target?.removeEventListener(type, listener, options);
|
|
64
|
+
}
|
|
65
|
+
dispatchEvent(event) {
|
|
66
|
+
return this.#target?.dispatchEvent(event) ?? false;
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
for (const Class of [PrimaryClass, ...AdditionalClasses]) defineClassPropHooks(MediaProxy, Class.prototype);
|
|
61
70
|
return MediaProxy;
|
|
@@ -172,4 +181,4 @@ function safeDefine(element) {
|
|
|
172
181
|
|
|
173
182
|
//#endregion
|
|
174
183
|
export { createContext as a, playerContext as i, containerContext as n, ContextRequestEvent as o, mediaContext as r, defineClassPropHooks as s, safeDefine as t };
|
|
175
|
-
//# sourceMappingURL=safe-define-
|
|
184
|
+
//# sourceMappingURL=safe-define-Bw8JF08z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-define-D26LrTu4.js","names":["#target"],"sources":["../../core/dist/dev/core/utils/define-class-prop-hooks.js","../../core/dist/dev/core/media/proxy.js","../../core/dist/dev/dom/media/proxy.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/create-context.js","../src/player/context.ts","../src/define/safe-define.ts"],"sourcesContent":["//#region src/core/utils/define-class-prop-hooks.ts\nfunction defineClassPropHooks(Class, BaseClassProto) {\n\tfor (const prop of Object.getOwnPropertyNames(BaseClassProto)) {\n\t\tif (prop in Class.prototype || prop.startsWith(\"_\")) continue;\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(BaseClassProto, prop);\n\t\tif (!descriptor) continue;\n\t\tconst config = {};\n\t\tif (typeof descriptor.value === \"function\") config.value = function(...args) {\n\t\t\treturn this.call?.(prop, ...args);\n\t\t};\n\t\telse if (descriptor.get) {\n\t\t\tconfig.get = function() {\n\t\t\t\treturn this.get?.(prop);\n\t\t\t};\n\t\t\tif (descriptor.set) config.set = function(val) {\n\t\t\t\tthis.set?.(prop, val);\n\t\t\t};\n\t\t}\n\t\tObject.defineProperty(Class.prototype, prop, config);\n\t}\n}\n//#endregion\nexport { defineClassPropHooks };\n\n//# sourceMappingURL=define-class-prop-hooks.js.map","import { defineClassPropHooks } from \"../utils/define-class-prop-hooks.js\";\n//#region src/core/media/proxy.ts\n/**\n* This mixin creates an API from the passed classes and proxies the methods and properties to the attached target.\n*\n* Many methods and properties will need no translation and are proxied directly to the attached target.\n* For example, the `play` and `pause` methods are proxied directly to the attached target.\n*\n* Child classes can override the proxied methods and properties to provide custom behavior.\n* For example, the `src` property for HLS media is proxied to the HLS engine, not the target itself.\n*\n* The `get`, `set`, and `call` methods can be overridden to provide catch-all custom behavior.\n*/\nconst ProxyMixin = (PrimaryClass, ...AdditionalClasses) => {\n\tclass MediaProxy extends EventTarget {\n\t\t#target = null;\n\t\tget target() {\n\t\t\treturn this.#target;\n\t\t}\n\t\tget(prop) {\n\t\t\treturn this.target?.[prop];\n\t\t}\n\t\tset(prop, val) {\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\tattach(target) {\n\t\t\tif (!target || this.#target === target) return;\n\t\t\tthis.#target = target;\n\t\t}\n\t\tdetach() {\n\t\t\tif (!this.#target) return;\n\t\t\tthis.#target = null;\n\t\t}\n\t}\n\tfor (const Class of [PrimaryClass, ...AdditionalClasses]) defineClassPropHooks(MediaProxy, Class.prototype);\n\treturn MediaProxy;\n};\n//#endregion\nexport { ProxyMixin };\n\n//# sourceMappingURL=proxy.js.map","import { ProxyMixin } from \"../../core/media/proxy.js\";\n//#region src/dom/media/proxy.ts\nconst VideoProxy = ProxyMixin(globalThis.HTMLVideoElement ?? class {}, globalThis.HTMLMediaElement ?? class {}, globalThis.EventTarget ?? class {});\n//#endregion\nexport { VideoProxy };\n\n//# sourceMappingURL=proxy.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n/**\n * An event fired by a context requester to signal it desires a specified context with the given key.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * method to the callback which consumers can invoke to indicate they no longer wish to receive these updates.\n *\n * If no `subscribe` value is present in the event, then the provider can assume that this is a 'one time'\n * request for the context and can therefore not track the consumer.\n */\nexport class ContextRequestEvent extends Event {\n /**\n *\n * @param context the context key to request\n * @param contextTarget the original context target of the requester\n * @param callback the callback that should be invoked when the context with the specified key is available\n * @param subscribe when, true indicates we want to subscribe to future updates\n */\n constructor(context, contextTarget, callback, subscribe) {\n super('context-request', { bubbles: true, composed: true });\n this.context = context;\n this.contextTarget = contextTarget;\n this.callback = callback;\n this.subscribe = subscribe ?? false;\n }\n}\n//# sourceMappingURL=context-request-event.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext(key) {\n return key;\n}\n//# sourceMappingURL=create-context.js.map","import type { AnyPlayerStore, Media, MediaContainer, PlayerStore } from '@videojs/core/dom';\nimport { type Context, createContext } from '@videojs/element/context';\n\n// ----------------------------------------\n// Player Context\n// ----------------------------------------\n\nexport const PLAYER_CONTEXT_KEY = Symbol.for('@videojs/player');\n\nexport type PlayerContextValue<Store extends PlayerStore = AnyPlayerStore> = Store;\n\nexport type PlayerContext<Store extends PlayerStore = AnyPlayerStore> = Context<\n typeof PLAYER_CONTEXT_KEY,\n PlayerContextValue<Store>\n>;\n\n/**\n * The default player context instance for consuming the player store in controllers.\n *\n * @public\n */\nexport const playerContext = createContext<PlayerContextValue, typeof PLAYER_CONTEXT_KEY>(PLAYER_CONTEXT_KEY);\n\n// ----------------------------------------\n// Media Context\n// ----------------------------------------\n\nexport const MEDIA_CONTEXT_KEY = Symbol.for('@videojs/media');\n\nexport interface MediaContextValue {\n media: Media | null;\n setMedia: (media: Media | null) => void;\n}\n\nexport type MediaContext = Context<typeof MEDIA_CONTEXT_KEY, MediaContextValue>;\n\nexport const mediaContext = createContext<MediaContextValue, typeof MEDIA_CONTEXT_KEY>(MEDIA_CONTEXT_KEY);\n\n// ----------------------------------------\n// Container Context\n// ----------------------------------------\n\nexport const CONTAINER_CONTEXT_KEY = Symbol.for('@videojs/container');\n\nexport interface ContainerContextValue {\n container: MediaContainer | null;\n setContainer: (container: MediaContainer | null) => void;\n}\n\nexport type ContainerContext = Context<typeof CONTAINER_CONTEXT_KEY, ContainerContextValue>;\n\nexport const containerContext = createContext<ContainerContextValue, typeof CONTAINER_CONTEXT_KEY>(\n CONTAINER_CONTEXT_KEY\n);\n","type DefinableElement = CustomElementConstructor & { tagName: string };\n\n/** Define a custom element only if not already registered. */\nexport function safeDefine(element: DefinableElement): void {\n const registry = globalThis.customElements;\n if (!registry || registry.get(element.tagName)) return;\n\n registry.define(element.tagName, element);\n}\n"],"x_google_ignoreList":[3,4],"mappings":";AACA,SAAS,qBAAqB,OAAO,gBAAgB;AACpD,MAAK,MAAM,QAAQ,OAAO,oBAAoB,eAAe,EAAE;AAC9D,MAAI,QAAQ,MAAM,aAAa,KAAK,WAAW,IAAI,CAAE;EACrD,MAAM,aAAa,OAAO,yBAAyB,gBAAgB,KAAK;AACxE,MAAI,CAAC,WAAY;EACjB,MAAM,SAAS,EAAE;AACjB,MAAI,OAAO,WAAW,UAAU,WAAY,QAAO,QAAQ,SAAS,GAAG,MAAM;AAC5E,UAAO,KAAK,OAAO,MAAM,GAAG,KAAK;;WAEzB,WAAW,KAAK;AACxB,UAAO,MAAM,WAAW;AACvB,WAAO,KAAK,MAAM,KAAK;;AAExB,OAAI,WAAW,IAAK,QAAO,MAAM,SAAS,KAAK;AAC9C,SAAK,MAAM,MAAM,IAAI;;;AAGvB,SAAO,eAAe,MAAM,WAAW,MAAM,OAAO;;;;;;;;;;;;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a,mBAAmB,cAC9B,sBACD;;;;;AClDD,SAAgB,WAAW,SAAiC;CAC1D,MAAM,WAAW,WAAW;AAC5B,KAAI,CAAC,YAAY,SAAS,IAAI,QAAQ,QAAQ,CAAE;AAEhD,UAAS,OAAO,QAAQ,SAAS,QAAQ"}
|
|
1
|
+
{"version":3,"file":"safe-define-Bw8JF08z.js","names":["#target"],"sources":["../../core/dist/dev/core/utils/define-class-prop-hooks.js","../../core/dist/dev/core/media/proxy.js","../../core/dist/dev/dom/media/proxy.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/create-context.js","../src/player/context.ts","../src/define/safe-define.ts"],"sourcesContent":["//#region src/core/utils/define-class-prop-hooks.ts\nfunction defineClassPropHooks(Class, BaseClassProto) {\n\tfor (const prop of Object.getOwnPropertyNames(BaseClassProto)) {\n\t\tif (prop in Class.prototype || prop.startsWith(\"_\")) continue;\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(BaseClassProto, prop);\n\t\tif (!descriptor) continue;\n\t\tconst config = {};\n\t\tif (typeof descriptor.value === \"function\") config.value = function(...args) {\n\t\t\treturn this.call?.(prop, ...args);\n\t\t};\n\t\telse if (descriptor.get) {\n\t\t\tconfig.get = function() {\n\t\t\t\treturn this.get?.(prop);\n\t\t\t};\n\t\t\tif (descriptor.set) config.set = function(val) {\n\t\t\t\tthis.set?.(prop, val);\n\t\t\t};\n\t\t}\n\t\tObject.defineProperty(Class.prototype, prop, config);\n\t}\n}\n//#endregion\nexport { defineClassPropHooks };\n\n//# sourceMappingURL=define-class-prop-hooks.js.map","import { defineClassPropHooks } from \"../utils/define-class-prop-hooks.js\";\n//#region src/core/media/proxy.ts\n/**\n* This mixin creates an API from the passed classes and proxies the methods and properties to the attached target.\n*\n* Many methods and properties will need no translation and are proxied directly to the attached target.\n* For example, the `play` and `pause` methods are proxied directly to the attached target.\n*\n* Child classes can override the proxied methods and properties to provide custom behavior.\n* For example, the `src` property for HLS media is proxied to the HLS engine, not the target itself.\n*\n* The `get`, `set`, and `call` methods can be overridden to provide catch-all custom behavior.\n*/\nconst ProxyMixin = (PrimaryClass, ...AdditionalClasses) => {\n\tclass MediaProxy {\n\t\t#target = null;\n\t\tget target() {\n\t\t\treturn this.#target;\n\t\t}\n\t\tget(prop) {\n\t\t\treturn this.target?.[prop];\n\t\t}\n\t\tset(prop, val) {\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\tattach(target) {\n\t\t\tif (!target || this.#target === target) return;\n\t\t\tthis.#target = target;\n\t\t}\n\t\tdetach() {\n\t\t\tif (!this.#target) return;\n\t\t\tthis.#target = null;\n\t\t}\n\t\taddEventListener(type, listener, options) {\n\t\t\tthis.#target?.addEventListener(type, listener, options);\n\t\t}\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tthis.#target?.removeEventListener(type, listener, options);\n\t\t}\n\t\tdispatchEvent(event) {\n\t\t\treturn this.#target?.dispatchEvent(event) ?? false;\n\t\t}\n\t}\n\tfor (const Class of [PrimaryClass, ...AdditionalClasses]) defineClassPropHooks(MediaProxy, Class.prototype);\n\treturn MediaProxy;\n};\n//#endregion\nexport { ProxyMixin };\n\n//# sourceMappingURL=proxy.js.map","import { ProxyMixin } from \"../../core/media/proxy.js\";\n//#region src/dom/media/proxy.ts\nconst VideoProxy = ProxyMixin(globalThis.HTMLVideoElement ?? class {}, globalThis.HTMLMediaElement ?? class {}, globalThis.EventTarget ?? class {});\n//#endregion\nexport { VideoProxy };\n\n//# sourceMappingURL=proxy.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n/**\n * An event fired by a context requester to signal it desires a specified context with the given key.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * method to the callback which consumers can invoke to indicate they no longer wish to receive these updates.\n *\n * If no `subscribe` value is present in the event, then the provider can assume that this is a 'one time'\n * request for the context and can therefore not track the consumer.\n */\nexport class ContextRequestEvent extends Event {\n /**\n *\n * @param context the context key to request\n * @param contextTarget the original context target of the requester\n * @param callback the callback that should be invoked when the context with the specified key is available\n * @param subscribe when, true indicates we want to subscribe to future updates\n */\n constructor(context, contextTarget, callback, subscribe) {\n super('context-request', { bubbles: true, composed: true });\n this.context = context;\n this.contextTarget = contextTarget;\n this.callback = callback;\n this.subscribe = subscribe ?? false;\n }\n}\n//# sourceMappingURL=context-request-event.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext(key) {\n return key;\n}\n//# sourceMappingURL=create-context.js.map","import type { AnyPlayerStore, Media, MediaContainer, PlayerStore } from '@videojs/core/dom';\nimport { type Context, createContext } from '@videojs/element/context';\n\n// ----------------------------------------\n// Player Context\n// ----------------------------------------\n\nexport const PLAYER_CONTEXT_KEY = Symbol.for('@videojs/player');\n\nexport type PlayerContextValue<Store extends PlayerStore = AnyPlayerStore> = Store;\n\nexport type PlayerContext<Store extends PlayerStore = AnyPlayerStore> = Context<\n typeof PLAYER_CONTEXT_KEY,\n PlayerContextValue<Store>\n>;\n\n/**\n * The default player context instance for consuming the player store in controllers.\n *\n * @public\n */\nexport const playerContext = createContext<PlayerContextValue, typeof PLAYER_CONTEXT_KEY>(PLAYER_CONTEXT_KEY);\n\n// ----------------------------------------\n// Media Context\n// ----------------------------------------\n\nexport const MEDIA_CONTEXT_KEY = Symbol.for('@videojs/media');\n\nexport interface MediaContextValue {\n media: Media | null;\n setMedia: (media: Media | null) => void;\n}\n\nexport type MediaContext = Context<typeof MEDIA_CONTEXT_KEY, MediaContextValue>;\n\nexport const mediaContext = createContext<MediaContextValue, typeof MEDIA_CONTEXT_KEY>(MEDIA_CONTEXT_KEY);\n\n// ----------------------------------------\n// Container Context\n// ----------------------------------------\n\nexport const CONTAINER_CONTEXT_KEY = Symbol.for('@videojs/container');\n\nexport interface ContainerContextValue {\n container: MediaContainer | null;\n setContainer: (container: MediaContainer | null) => void;\n}\n\nexport type ContainerContext = Context<typeof CONTAINER_CONTEXT_KEY, ContainerContextValue>;\n\nexport const containerContext = createContext<ContainerContextValue, typeof CONTAINER_CONTEXT_KEY>(\n CONTAINER_CONTEXT_KEY\n);\n","type DefinableElement = CustomElementConstructor & { tagName: string };\n\n/** Define a custom element only if not already registered. */\nexport function safeDefine(element: DefinableElement): void {\n const registry = globalThis.customElements;\n if (!registry || registry.get(element.tagName)) return;\n\n registry.define(element.tagName, element);\n}\n"],"x_google_ignoreList":[3,4],"mappings":";AACA,SAAS,qBAAqB,OAAO,gBAAgB;AACpD,MAAK,MAAM,QAAQ,OAAO,oBAAoB,eAAe,EAAE;AAC9D,MAAI,QAAQ,MAAM,aAAa,KAAK,WAAW,IAAI,CAAE;EACrD,MAAM,aAAa,OAAO,yBAAyB,gBAAgB,KAAK;AACxE,MAAI,CAAC,WAAY;EACjB,MAAM,SAAS,EAAE;AACjB,MAAI,OAAO,WAA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J,IAAa,sBAAb,cAAyC,MAAM;;;;;;;;CAQ3C,YAAY,SAAS,eAAe,UAAU,WAAW;AACrD,QAAM,mBAAmB;GAAE,SAAS;GAAM,UAAU;GAAM,CAAC;AAC3D,OAAK,UAAU;AACf,OAAK,gBAAgB;AACrB,OAAK,WAAW;AAChB,OAAK,YAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKtC,SAAgB,cAAc,KAAK;AAC/B,QAAO;;;;;AC9BX,MAAa,qBAAqB,OAAO,IAAI,kBAAkB;;;;;;AAc/D,MAAa,gBAAgB,cAA6D,mBAAmB;AAM7G,MAAa,oBAAoB,OAAO,IAAI,iBAAiB;AAS7D,MAAa,eAAe,cAA2D,kBAAkB;AAMzG,MAAa,wBAAwB,OAAO,IAAI,qBAAqB;AASrE,MAAa,mBAAmB,cAC9B,sBACD;;;;;AClDD,SAAgB,WAAW,SAAiC;CAC1D,MAAM,WAAW,WAAW;AAC5B,KAAI,CAAC,YAAY,SAAS,IAAI,QAAQ,QAAQ,CAAE;AAEhD,UAAS,OAAO,QAAQ,SAAS,QAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function e(e,t){for(let n of Object.getOwnPropertyNames(t)){if(n in e.prototype||n.startsWith(`_`))continue;let r=Object.getOwnPropertyDescriptor(t,n);if(!r)continue;let i={};typeof r.value==`function`?i.value=function(...e){return this.call?.(n,...e)}:r.get&&(i.get=function(){return this.get?.(n)},r.set&&(i.set=function(e){this.set?.(n,e)})),Object.defineProperty(e.prototype,n,i)}}((t,...n)=>{class r
|
|
1
|
+
function e(e,t){for(let n of Object.getOwnPropertyNames(t)){if(n in e.prototype||n.startsWith(`_`))continue;let r=Object.getOwnPropertyDescriptor(t,n);if(!r)continue;let i={};typeof r.value==`function`?i.value=function(...e){return this.call?.(n,...e)}:r.get&&(i.get=function(){return this.get?.(n)},r.set&&(i.set=function(e){this.set?.(n,e)})),Object.defineProperty(e.prototype,n,i)}}((t,...n)=>{class r{#e=null;get target(){return this.#e}get(e){return this.target?.[e]}set(e,t){this.target&&(this.target[e]=t)}call(e,...t){return(this.target?.[e])?.apply(this.target,t)}attach(e){!e||this.#e===e||(this.#e=e)}detach(){this.#e&&=null}addEventListener(e,t,n){this.#e?.addEventListener(e,t,n)}removeEventListener(e,t,n){this.#e?.removeEventListener(e,t,n)}dispatchEvent(e){return this.#e?.dispatchEvent(e)??!1}}for(let i of[t,...n])e(r,i.prototype);return r})(globalThis.HTMLVideoElement??class{},globalThis.HTMLMediaElement??class{},globalThis.EventTarget??class{});
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2021 Google LLC
|
|
@@ -11,4 +11,4 @@ var t=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:
|
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
13
|
function n(e){return e}const r=n(Symbol.for(`@videojs/player`)),i=n(Symbol.for(`@videojs/media`)),a=n(Symbol.for(`@videojs/container`));function o(e){let t=globalThis.customElements;!t||t.get(e.tagName)||t.define(e.tagName,e)}export{n as a,r as i,a as n,t as o,i as r,e as s,o as t};
|
|
14
|
-
//# sourceMappingURL=safe-define-
|
|
14
|
+
//# sourceMappingURL=safe-define-t0AGOouq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-define-
|
|
1
|
+
{"version":3,"file":"safe-define-t0AGOouq.js","names":["#target","createContext"],"sources":["../../core/dist/default/core/utils/define-class-prop-hooks.js","../../core/dist/default/core/media/proxy.js","../../core/dist/default/dom/media/proxy.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js","../src/player/context.ts","../src/define/safe-define.ts"],"sourcesContent":["//#region src/core/utils/define-class-prop-hooks.ts\nfunction defineClassPropHooks(Class, BaseClassProto) {\n\tfor (const prop of Object.getOwnPropertyNames(BaseClassProto)) {\n\t\tif (prop in Class.prototype || prop.startsWith(\"_\")) continue;\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(BaseClassProto, prop);\n\t\tif (!descriptor) continue;\n\t\tconst config = {};\n\t\tif (typeof descriptor.value === \"function\") config.value = function(...args) {\n\t\t\treturn this.call?.(prop, ...args);\n\t\t};\n\t\telse if (descriptor.get) {\n\t\t\tconfig.get = function() {\n\t\t\t\treturn this.get?.(prop);\n\t\t\t};\n\t\t\tif (descriptor.set) config.set = function(val) {\n\t\t\t\tthis.set?.(prop, val);\n\t\t\t};\n\t\t}\n\t\tObject.defineProperty(Class.prototype, prop, config);\n\t}\n}\n//#endregion\nexport { defineClassPropHooks };\n\n//# sourceMappingURL=define-class-prop-hooks.js.map","import { defineClassPropHooks } from \"../utils/define-class-prop-hooks.js\";\n//#region src/core/media/proxy.ts\n/**\n* This mixin creates an API from the passed classes and proxies the methods and properties to the attached target.\n*\n* Many methods and properties will need no translation and are proxied directly to the attached target.\n* For example, the `play` and `pause` methods are proxied directly to the attached target.\n*\n* Child classes can override the proxied methods and properties to provide custom behavior.\n* For example, the `src` property for HLS media is proxied to the HLS engine, not the target itself.\n*\n* The `get`, `set`, and `call` methods can be overridden to provide catch-all custom behavior.\n*/\nconst ProxyMixin = (PrimaryClass, ...AdditionalClasses) => {\n\tclass MediaProxy {\n\t\t#target = null;\n\t\tget target() {\n\t\t\treturn this.#target;\n\t\t}\n\t\tget(prop) {\n\t\t\treturn this.target?.[prop];\n\t\t}\n\t\tset(prop, val) {\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\tattach(target) {\n\t\t\tif (!target || this.#target === target) return;\n\t\t\tthis.#target = target;\n\t\t}\n\t\tdetach() {\n\t\t\tif (!this.#target) return;\n\t\t\tthis.#target = null;\n\t\t}\n\t\taddEventListener(type, listener, options) {\n\t\t\tthis.#target?.addEventListener(type, listener, options);\n\t\t}\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tthis.#target?.removeEventListener(type, listener, options);\n\t\t}\n\t\tdispatchEvent(event) {\n\t\t\treturn this.#target?.dispatchEvent(event) ?? false;\n\t\t}\n\t}\n\tfor (const Class of [PrimaryClass, ...AdditionalClasses]) defineClassPropHooks(MediaProxy, Class.prototype);\n\treturn MediaProxy;\n};\n//#endregion\nexport { ProxyMixin };\n\n//# sourceMappingURL=proxy.js.map","import { ProxyMixin } from \"../../core/media/proxy.js\";\n//#region src/dom/media/proxy.ts\nconst VideoProxy = ProxyMixin(globalThis.HTMLVideoElement ?? class {}, globalThis.HTMLMediaElement ?? class {}, globalThis.EventTarget ?? class {});\n//#endregion\nexport { VideoProxy };\n\n//# sourceMappingURL=proxy.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e,o){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n){return n}export{n as createContext};\n//# sourceMappingURL=create-context.js.map\n","import type { AnyPlayerStore, Media, MediaContainer, PlayerStore } from '@videojs/core/dom';\nimport { type Context, createContext } from '@videojs/element/context';\n\n// ----------------------------------------\n// Player Context\n// ----------------------------------------\n\nexport const PLAYER_CONTEXT_KEY = Symbol.for('@videojs/player');\n\nexport type PlayerContextValue<Store extends PlayerStore = AnyPlayerStore> = Store;\n\nexport type PlayerContext<Store extends PlayerStore = AnyPlayerStore> = Context<\n typeof PLAYER_CONTEXT_KEY,\n PlayerContextValue<Store>\n>;\n\n/**\n * The default player context instance for consuming the player store in controllers.\n *\n * @public\n */\nexport const playerContext = createContext<PlayerContextValue, typeof PLAYER_CONTEXT_KEY>(PLAYER_CONTEXT_KEY);\n\n// ----------------------------------------\n// Media Context\n// ----------------------------------------\n\nexport const MEDIA_CONTEXT_KEY = Symbol.for('@videojs/media');\n\nexport interface MediaContextValue {\n media: Media | null;\n setMedia: (media: Media | null) => void;\n}\n\nexport type MediaContext = Context<typeof MEDIA_CONTEXT_KEY, MediaContextValue>;\n\nexport const mediaContext = createContext<MediaContextValue, typeof MEDIA_CONTEXT_KEY>(MEDIA_CONTEXT_KEY);\n\n// ----------------------------------------\n// Container Context\n// ----------------------------------------\n\nexport const CONTAINER_CONTEXT_KEY = Symbol.for('@videojs/container');\n\nexport interface ContainerContextValue {\n container: MediaContainer | null;\n setContainer: (container: MediaContainer | null) => void;\n}\n\nexport type ContainerContext = Context<typeof CONTAINER_CONTEXT_KEY, ContainerContextValue>;\n\nexport const containerContext = createContext<ContainerContextValue, typeof CONTAINER_CONTEXT_KEY>(\n CONTAINER_CONTEXT_KEY\n);\n","type DefinableElement = CustomElementConstructor & { tagName: string };\n\n/** Define a custom element only if not already registered. */\nexport function safeDefine(element: DefinableElement): void {\n const registry = globalThis.customElements;\n if (!registry || registry.get(element.tagName)) return;\n\n registry.define(element.tagName, element);\n}\n"],"x_google_ignoreList":[3,4],"mappings":"AACA,SAAS,EAAqB,EAAO,EAAgB,CACpD,IAAK,IAAM,KAAQ,OAAO,oBAAoB,EAAe,CAAE,CAC9D,GAAI,KAAQ,EAAM,WAAa,EAAK,WAAW,IAAI,CAAE,SACrD,IAAM,EAAa,OAAO,yBAAyB,EAAgB,EAAK,CACxE,GAAI,CAAC,EAAY,SACjB,IAAM,EAAS,EAAE,CACb,OAAO,EAAW,OAAU,WAAY,EAAO,MAAQ,SAAS,GAAG,EAAM,CAC5E,OAAO,KAAK,OAAO,EAAM,GAAG,EAAK,EAEzB,EAAW,MACnB,EAAO,IAAM,UAAW,CACvB,OAAO,KAAK,MAAM,EAAK,EAEpB,EAAW,MAAK,EAAO,IAAM,SAAS,EAAK,CAC9C,KAAK,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EAAmBA,EATK,OAAO,IAAI,qBAAqB,CAWpE,CClDD,SAAgB,EAAW,EAAiC,CAC1D,IAAM,EAAW,WAAW,eACxB,CAAC,GAAY,EAAS,IAAI,EAAQ,QAAQ,EAE9C,EAAS,OAAO,EAAQ,QAAS,EAAQ"}
|
package/cdn/video-minimal.dev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as ReactiveElement } from "./create-player-
|
|
2
|
-
import { g as createStyles, h as SkinMixin } from "./volume-slider-
|
|
3
|
-
import { t as safeDefine } from "./safe-define-
|
|
4
|
-
import "./poster-
|
|
1
|
+
import { o as ReactiveElement } from "./create-player-C2h3JeGl.js";
|
|
2
|
+
import { g as createStyles, h as SkinMixin } from "./volume-slider-Dz_ND_4U.js";
|
|
3
|
+
import { t as safeDefine } from "./safe-define-Bw8JF08z.js";
|
|
4
|
+
import "./poster-Ds1EOmmU.js";
|
|
5
5
|
import { t as renderIcon } from "./minimal-fA2p2Jrn.js";
|
|
6
6
|
|
|
7
7
|
//#region inline-css:src/define/video/minimal-skin.js
|