@glitchlab/vue-video-player 1.2.0 → 1.3.0
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/README.md +12 -2
- package/dist/VideoPlayer.vue.d.ts +1 -1
- package/dist/VideoPlayer.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/utils/types.d.ts +5 -4
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ Then use the component anywhere — no manual import required:
|
|
|
99
99
|
| `class` | `string` | `""` | Extra class added to the outer container (alongside `.gvp-root`). |
|
|
100
100
|
| `muted` | `boolean` | `true` | Mute the video. Required for autoplay in most browsers. |
|
|
101
101
|
| `loop` | `boolean` | `false` | Loop playback. |
|
|
102
|
-
| `controls` | `boolean \| "custom"`
|
|
102
|
+
| `controls` | `boolean \| "custom" \| "native"` | `true` | `true` (default) / `"custom"` — branded control bar (play/seek/time/speed/captions/volume/PiP/fullscreen) that auto-hides during playback. `"native"` — native browser controls. `false` — no controls (just the play overlay). See [Custom controls](#custom-controls). |
|
|
103
103
|
| `autoPlay` | `boolean` | `false` | Start playback as soon as the source is ready. Works for HLS (after `MANIFEST_PARSED`), native MP4/WebM (after `loadedmetadata`), and YouTube embeds. Browsers block sound-on autoplay, so this only fires when `muted` is also `true` (the default). |
|
|
104
104
|
| `frameMaxWidth` | `{ desktop?: string; mobile?: string }` | `{ desktop: "960px", mobile: "420px" }` | Max width of the player in each device mode. |
|
|
105
105
|
| `aspectRatio` | `{ desktop?: AspectRatio; mobile?: AspectRatio }` | `{ desktop: "16/9", mobile: "9/16" }` | Aspect ratio per device mode. `AspectRatio` is `` `${number}/${number}` ``. |
|
|
@@ -124,10 +124,20 @@ Then use the component anywhere — no manual import required:
|
|
|
124
124
|
|
|
125
125
|
## Custom controls
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
The branded control bar is **on by default** — it looks and behaves the same across every browser and OS, no inconsistent native chrome:
|
|
128
128
|
|
|
129
129
|
```vue
|
|
130
|
+
<!-- Custom control bar — this is the default, :controls="true" -->
|
|
131
|
+
<VueVideoPlayer src="/videos/movie.m3u8" />
|
|
132
|
+
|
|
133
|
+
<!-- Same thing, explicit -->
|
|
130
134
|
<VueVideoPlayer src="/videos/movie.m3u8" controls="custom" />
|
|
135
|
+
|
|
136
|
+
<!-- Native browser controls instead -->
|
|
137
|
+
<VueVideoPlayer src="/videos/movie.m3u8" controls="native" />
|
|
138
|
+
|
|
139
|
+
<!-- No controls at all -->
|
|
140
|
+
<VueVideoPlayer src="/videos/movie.m3u8" :controls="false" />
|
|
131
141
|
```
|
|
132
142
|
|
|
133
143
|
The bar includes, left to right:
|
|
@@ -40,7 +40,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
40
40
|
}>, {
|
|
41
41
|
muted: boolean;
|
|
42
42
|
loop: boolean;
|
|
43
|
-
controls: boolean | "custom";
|
|
43
|
+
controls: boolean | "custom" | "native";
|
|
44
44
|
autoPlay: boolean;
|
|
45
45
|
class: string;
|
|
46
46
|
showDeviceToggle: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPlayer.vue.d.ts","sourceRoot":"","sources":["../src/VideoPlayer.vue"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"VideoPlayer.vue.d.ts","sourceRoot":"","sources":["../src/VideoPlayer.vue"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAmPlE,iBAAS,cAAc;qBAqbO,GAAG;EAGhC;AA8CD,QAAA,MAAM,eAAe;YAKsE,MAAM;eAAa,OAAO;;;;;;;;;;;;;;;;YAA1B,MAAM;eAAa,OAAO;;;;;;;;;;;;;;;;;;;;WAA1B,MAAM;;;;cAAa,OAAO;4EAEnH,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("hls.js");function Q(n,a,r){const t=n==null?void 0:n.trim();if(t)return t;if(a){try{const p=new Intl.DisplayNames(void 0,{type:"language"}).of(a);if(p&&p!==a)return p}catch{}return a}return`Audio ${r+1}`}const ce=["muted","loop","controls","autoplay","playsinline","preload","poster"],te=e.defineComponent({__name:"HLSPlayer",props:{src:{},hlsConfig:{},isHls:{type:Boolean},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},playsInline:{type:Boolean,default:!0},preload:{default:"metadata"},poster:{},class:{},audioTrackIndex:{default:-1}},emits:["play","pause","audio-tracks"],setup(n,{expose:a,emit:r}){const t=n,l=r,p=e.ref(null),f=e.ref(null);let d,b;const B=globalThis.window!==void 0&&R.isSupported(),C=s=>!!t.isHls||B&&s.endsWith(".m3u8");function y(){b==null||b(),b=void 0,d==null||d(),d=void 0,f.value&&(f.value.destroy(),f.value=null);const s=p.value;if(s){for(s.pause(),s.removeAttribute("src");s.firstChild;)s.firstChild.remove();s.load(),l("audio-tracks",[])}}function k(s){var M,V,L;const g=p.value;if(!g||!s)return;y();const E=()=>{t.autoPlay&&g.play().catch(()=>{})};if(C(s)){const h=new R(t.hlsConfig);f.value=h;const x=()=>{const P=h.audioTracks.map((N,S)=>({index:S,label:Q(N.name,N.lang,S),lang:N.lang||void 0}));l("audio-tracks",P)};h.on(R.Events.MANIFEST_PARSED,E),h.on(R.Events.AUDIO_TRACKS_UPDATED,x),h.on(R.Events.AUDIO_TRACK_SWITCHED,x),h.on(R.Events.ERROR,(P,N)=>{N.fatal&&(h.destroy(),f.value=null)}),h.attachMedia(g),h.loadSource(s)}else{g.src=s,g.load(),g.addEventListener("loadedmetadata",E,{once:!0}),b=()=>{g.removeEventListener("loadedmetadata",E)};const h=g.audioTracks;if(h){const x=()=>{const P=[];for(let N=0;N<h.length;N++){const S=h[N];P.push({index:N,label:Q(S.label,S.language,N),lang:S.language||void 0})}l("audio-tracks",P)};(M=h.addEventListener)==null||M.call(h,"addtrack",x),(V=h.addEventListener)==null||V.call(h,"removetrack",x),(L=h.addEventListener)==null||L.call(h,"change",x),h.length>0&&x(),d=()=>{var P,N,S;(P=h.removeEventListener)==null||P.call(h,"addtrack",x),(N=h.removeEventListener)==null||N.call(h,"removetrack",x),(S=h.removeEventListener)==null||S.call(h,"change",x)}}}}function m(s){var M;if(s==null||s<0)return;const g=f.value;if(g){g.audioTrack!==s&&(g.audioTrack=s);return}const E=(M=p.value)==null?void 0:M.audioTracks;if(E)for(let V=0;V<E.length;V++)E[V].enabled=V===s}return e.onMounted(()=>{t.src&&k(t.src)}),e.watch(()=>t.src,s=>{s&&k(s)}),e.watch(()=>t.audioTrackIndex,s=>m(s)),e.onBeforeUnmount(y),a({videoEl:p}),(s,g)=>(e.openBlock(),e.createElementBlock("video",{ref_key:"videoEl",ref:p,muted:n.muted,loop:n.loop,controls:n.controls,autoplay:n.autoPlay,playsinline:n.playsInline,preload:n.preload,poster:n.poster,class:e.normalizeClass(t.class),onPlay:g[0]||(g[0]=E=>l("play")),onPause:g[1]||(g[1]=E=>l("pause"))},[e.renderSlot(s.$slots,"default")],42,ce))}}),ue={name:"IconAudio"},de=e.defineComponent({...ue,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),ve={name:"IconChevron"},ne=e.defineComponent({...ve,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6 9L12 15L18 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),pe=["aria-expanded"],me={class:"gvp-audio-label"},fe={key:0,class:"gvp-audio-menu",role:"listbox","aria-label":"Audio tracks"},ke=["aria-selected","onClick"],he=e.defineComponent({__name:"AudioTrackSwitcher",props:{tracks:{},activeIndex:{}},emits:["select"],setup(n,{emit:a}){const r=n,t=a,l=e.ref(!1),p=e.ref(null),f=e.computed(()=>r.tracks.find(C=>C.index===r.activeIndex)??r.tracks[0]);function d(C){p.value&&!p.value.contains(C.target)&&(l.value=!1)}function b(C){C.key==="Escape"&&(l.value=!1)}e.watch(l,C=>{C?(document.addEventListener("mousedown",d),document.addEventListener("keydown",b)):(document.removeEventListener("mousedown",d),document.removeEventListener("keydown",b))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",b)});function B(C){t("select",C),l.value=!1}return(C,y)=>{var k;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-audio"},[e.createElementVNode("button",{type:"button",class:"gvp-audio-btn","aria-haspopup":"listbox","aria-expanded":l.value,"aria-label":"Audio track",onClick:y[0]||(y[0]=m=>l.value=!l.value)},[e.createVNode(de),e.createElementVNode("span",me,e.toDisplayString((k=f.value)==null?void 0:k.label),1),e.createVNode(ne)],8,pe),l.value?(e.openBlock(),e.createElementBlock("ul",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tracks,m=>(e.openBlock(),e.createElementBlock("li",{key:m.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":m.index===n.activeIndex,class:e.normalizeClass(["gvp-audio-menu-item",{"is-active":m.index===n.activeIndex}]),onClick:s=>B(m.index)},e.toDisplayString(m.label),11,ke)]))),128))])):e.createCommentVNode("",!0)],512)}}}),ge={name:"IconSpeed"},oe=e.defineComponent({...ge,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M12 8V12L14.5 14.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Ce=["aria-expanded"],ye={class:"gvp-speed-label"},Ee={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},we=["aria-selected","onClick"],be=e.defineComponent({__name:"SpeedSwitcher",props:{speed:{}},emits:["select"],setup(n,{emit:a}){const r=[.5,.75,1,1.25,1.5,2],t=a,l=e.ref(!1),p=e.ref(null);function f(B){p.value&&!p.value.contains(B.target)&&(l.value=!1)}function d(B){B.key==="Escape"&&(l.value=!1)}e.watch(l,B=>{B?(document.addEventListener("mousedown",f),document.addEventListener("keydown",d)):(document.removeEventListener("mousedown",f),document.removeEventListener("keydown",d))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",d)});function b(B){t("select",B),l.value=!1}return(B,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":l.value,"aria-label":"`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",onClick:C[0]||(C[0]=y=>l.value=!l.value)},[e.createVNode(oe),e.createElementVNode("span",ye,e.toDisplayString(n.speed===1?"1×":`${n.speed}×`),1),e.createVNode(ne)],8,Ce),l.value?(e.openBlock(),e.createElementBlock("ul",Ee,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,y=>e.createElementVNode("li",{key:y},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":y===n.speed,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":y===n.speed}]),onClick:k=>b(y)},e.toDisplayString(y===1?"Normal":`${y}×`),11,we)])),64))])):e.createCommentVNode("",!0)],512))}}),Be={name:"IconCaptions"},le=e.defineComponent({...Be,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),xe=["aria-expanded","aria-pressed"],_e={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},Ve=["aria-selected"],Ne=["aria-selected","onClick"],$e=e.defineComponent({__name:"CaptionsSwitcher",props:{video:{}},setup(n){const a=n,r=e.ref([]),t=e.ref(-1),l=e.ref(!1),p=e.ref(null);function f(k){const m=[];for(let g=0;g<k.length;g++){const E=k[g];(E.kind==="subtitles"||E.kind==="captions")&&m.push({index:g,label:E.label||E.language||`Track ${g+1}`})}r.value=m;let s=-1;for(let g=0;g<k.length;g++)if(k[g].mode==="showing"){s=g;break}t.value=s}let d=null;e.watch(()=>a.video,k=>{if(d==null||d(),d=null,!k){r.value=[],t.value=-1;return}const m=k.textTracks;f(m);const s=()=>f(m);typeof m.addEventListener=="function"&&(m.addEventListener("addtrack",s),m.addEventListener("removetrack",s),m.addEventListener("change",s),d=()=>{m.removeEventListener("addtrack",s),m.removeEventListener("removetrack",s),m.removeEventListener("change",s)})},{immediate:!0}),e.onBeforeUnmount(()=>{d==null||d(),document.removeEventListener("mousedown",b),document.removeEventListener("keydown",B)});function b(k){p.value&&!p.value.contains(k.target)&&(l.value=!1)}function B(k){k.key==="Escape"&&(l.value=!1)}e.watch(l,k=>{k?(document.addEventListener("mousedown",b),document.addEventListener("keydown",B)):(document.removeEventListener("mousedown",b),document.removeEventListener("keydown",B))});function C(){if(!a.video)return;const k=a.video.textTracks;for(let m=0;m<k.length;m++)k[m].mode="hidden";t.value=-1,l.value=!1}function y(k){if(!a.video)return;const m=a.video.textTracks;for(let s=0;s<m.length;s++)m[s].mode=s===k?"showing":"hidden";t.value=k,l.value=!1}return(k,m)=>r.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootEl",ref:p,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-captions-btn",{"is-active":t.value>=0}]),"aria-haspopup":"listbox","aria-expanded":l.value,"aria-pressed":t.value>=0,"aria-label":"Captions",onClick:m[0]||(m[0]=s=>l.value=!l.value)},[e.createVNode(le)],10,xe),l.value?(e.openBlock(),e.createElementBlock("ul",_e,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":t.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":t.value===-1}]),onClick:C}," Off ",10,Ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,s=>(e.openBlock(),e.createElementBlock("li",{key:s.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":s.index===t.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":s.index===t.value}]),onClick:g=>y(s.index)},e.toDisplayString(s.label),11,Ne)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}}),Le={name:"IconPause"},Pe=e.defineComponent({...Le,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Me={name:"IconPlaySolid"},Se=e.defineComponent({...Me,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",fill:"currentColor"},null,-1)])],2))}}),Te={name:"IconVolumeHigh"},Ie=e.defineComponent({...Te,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),He={name:"IconVolumeLow"},ze=e.defineComponent({...He,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),De={name:"IconVolumeMuted"},Ae=e.defineComponent({...De,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16 9L22 15M22 9L16 15",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Fe={name:"IconPiP"},ae=e.defineComponent({...Fe,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("rect",{x:"12",y:"12",width:"8",height:"5",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Re={name:"IconFullscreen"},Ue=e.defineComponent({...Re,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Oe={name:"IconFullscreenExit"},je=e.defineComponent({...Oe,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}});function ee(n){if(!Number.isFinite(n)||n<0)return"--:--";const a=Math.floor(n),r=Math.floor(a/3600),t=Math.floor(a%3600/60),p=(a%60).toString().padStart(2,"0");if(r>0){const f=t.toString().padStart(2,"0");return`${r}:${f}:${p}`}return`${t}:${p}`}const Ze={class:"gvp-controls-row"},qe=["aria-label","aria-pressed"],We={class:"gvp-seek"},Ye={class:"gvp-seek-track"},Ke=["value","disabled","aria-valuemax","aria-valuenow"],Je={class:"gvp-time","aria-live":"off"},Xe=["aria-expanded","aria-label"],Ge={class:"gvp-speed-label"},Qe={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},et=["aria-selected","onClick"],tt=["aria-expanded","aria-pressed"],nt={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},ot=["aria-selected"],lt=["aria-selected","onClick"],at=["aria-label","aria-pressed"],rt={key:0,class:"gvp-volume-slider-wrap"},st={class:"gvp-volume-track"},it=["value","aria-valuenow"],ct=["aria-label","aria-pressed"],ut=["aria-label","aria-pressed"],dt=3e3,vt=e.defineComponent({__name:"ControlBar",props:{video:{},isPlaying:{type:Boolean},container:{},onTogglePlay:{type:Function}},setup(n){const a=(()=>{if(typeof navigator>"u")return!1;const o=navigator.userAgent;return/iPad|iPhone|iPod/.test(o)||o.includes("Mac")&&navigator.maxTouchPoints>1})(),r=typeof navigator>"u"?!1:/iPhone|iPod/.test(navigator.userAgent),t=[.5,.75,1,1.25,1.5,2],l=n,p=e.ref(!0);let f=null;function d(){f!==null&&(clearTimeout(f),f=null)}function b(){d(),l.isPlaying&&(f=setTimeout(()=>{p.value=!1},dt))}function B(){p.value=!0,b()}e.watch(()=>l.isPlaying,o=>{o?b():(d(),p.value=!0)},{immediate:!0}),e.watch(()=>l.container,o=>{if(!o)return;const i=()=>B();o.addEventListener("mousemove",i),o.addEventListener("touchstart",i),o.addEventListener("focusin",i)},{immediate:!0});const C=e.ref(0),y=e.ref(0),k=e.ref(0);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{C.value=o.currentTime},v=()=>{y.value=Number.isFinite(o.duration)?o.duration:0},w=()=>{const $=o.buffered;if(!$||$.length===0){k.value=0;return}let G=$.end($.length-1);for(let O=0;O<$.length;O++)if($.start(O)<=o.currentTime&&o.currentTime<=$.end(O)){G=$.end(O);break}k.value=G};i(),v(),w(),o.addEventListener("timeupdate",i),o.addEventListener("durationchange",v),o.addEventListener("loadedmetadata",v),o.addEventListener("progress",w),o.addEventListener("timeupdate",w)},{immediate:!0});const m=()=>y.value>0,s=()=>m()?C.value/y.value*100:0,g=()=>m()?k.value/y.value*100:0;function E(o){const i=l.video;if(!i||!m())return;const v=Number(o.target.value)/100*y.value;i.currentTime=v,C.value=v}const M=e.ref(1),V=e.ref(!1);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{M.value=o.volume,V.value=o.muted};i(),o.addEventListener("volumechange",i)},{immediate:!0});function L(){l.video&&(l.video.muted=!l.video.muted)}function h(o){const i=l.video;if(!i)return;const v=Number(o.target.value)/100;i.volume=v,v>0&&i.muted&&(i.muted=!1)}const x=e.ref(1),P=e.ref(!1),N=e.ref(null);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{x.value=o.playbackRate};i(),o.addEventListener("ratechange",i)},{immediate:!0});function S(o){l.video&&(l.video.playbackRate=o),x.value=o,P.value=!1}const A=e.ref([]),_=e.ref(-1),I=e.ref(!1),U=e.ref(null);function j(o){const i=[];for(let w=0;w<o.length;w++){const $=o[w];($.kind==="subtitles"||$.kind==="captions")&&i.push({index:w,label:$.label||$.language||`Track ${w+1}`})}A.value=i;let v=-1;for(let w=0;w<o.length;w++)if(o[w].mode==="showing"){v=w;break}_.value=v}e.watch(()=>l.video,o=>{if(!o){A.value=[],_.value=-1;return}const i=o.textTracks;j(i);const v=()=>j(i);typeof i.addEventListener=="function"&&(i.addEventListener("addtrack",v),i.addEventListener("removetrack",v),i.addEventListener("change",v))},{immediate:!0});function K(o){var v;const i=(v=l.video)==null?void 0:v.textTracks;if(i){for(let w=0;w<i.length;w++)i[w].mode=w===o?"showing":"hidden";_.value=o,I.value=!1}}function F(){var i;const o=(i=l.video)==null?void 0:i.textTracks;if(o){for(let v=0;v<o.length;v++)o[v].mode="hidden";_.value=-1,I.value=!1}}const z=e.ref(!1),J=typeof document<"u"&&!!document.pictureInPictureEnabled;e.watch(()=>l.video,o=>{o&&(o.addEventListener("enterpictureinpicture",()=>{z.value=!0}),o.addEventListener("leavepictureinpicture",()=>{z.value=!1}))},{immediate:!0});function X(){l.video&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):l.video.requestPictureInPicture().catch(()=>{}))}const H=e.ref(!1),Z=typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled);function u(){return document.fullscreenElement??document.webkitFullscreenElement??null}function c(o){const i=o.requestFullscreen??o.webkitRequestFullscreen;return i?i.call(o):Promise.reject(new Error("unsupported"))}function T(){const o=document.exitFullscreen??document.webkitExitFullscreen;return o?o.call(document):Promise.reject(new Error("unsupported"))}function D(){H.value=u()===l.container}e.onMounted(()=>{document.addEventListener("fullscreenchange",D),document.addEventListener("webkitfullscreenchange",D)}),e.onBeforeUnmount(()=>{d(),document.removeEventListener("fullscreenchange",D),document.removeEventListener("webkitfullscreenchange",D)});function q(){var o,i;if(r){(i=(o=l.video)==null?void 0:o.webkitEnterFullscreen)==null||i.call(o);return}H.value?T().catch(()=>{}):l.container&&c(l.container).catch(()=>{})}const W=Z||r&&l.video!==null&&typeof l.video.webkitEnterFullscreen=="function";function Y(o,i){function v($){i.value&&!i.value.contains($.target)&&(o.value=!1)}function w($){$.key==="Escape"&&(o.value=!1)}e.watch(o,$=>{$?(document.addEventListener("mousedown",v),document.addEventListener("keydown",w)):(document.removeEventListener("mousedown",v),document.removeEventListener("keydown",w))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",w)})}return Y(P,N),Y(I,U),(o,i)=>(e.openBlock(),e.createElementBlock("div",{role:"toolbar","aria-label":"Video controls",class:e.normalizeClass(["gvp-controls",!p.value&&"is-hidden"]),onMouseenter:d,onMouseleave:b},[e.createElementVNode("div",Ze,[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":n.isPlaying?"Pause":"Play","aria-pressed":n.isPlaying,onClick:i[0]||(i[0]=(...v)=>n.onTogglePlay&&n.onTogglePlay(...v))},[n.isPlaying?(e.openBlock(),e.createBlock(Pe,{key:0})):(e.openBlock(),e.createBlock(Se,{key:1}))],8,qe),e.createElementVNode("div",We,[e.createElementVNode("div",Ye,[e.createElementVNode("div",{class:"gvp-seek-buffered",style:e.normalizeStyle({width:`${g()}%`})},null,4),e.createElementVNode("div",{class:"gvp-seek-progress",style:e.normalizeStyle({width:`${s()}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-seek-input",min:0,max:100,step:.1,value:s(),disabled:!m(),"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(y.value),"aria-valuenow":Math.floor(C.value),onInput:E},null,40,Ke)]),e.createElementVNode("span",Je,e.toDisplayString(e.unref(ee)(C.value))+" / "+e.toDisplayString(e.unref(ee)(y.value)),1),e.createElementVNode("div",{ref_key:"speedRootEl",ref:N,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":P.value,"aria-label":`Playback speed: ${x.value===1?"1×":x.value+"×"}`,onClick:i[1]||(i[1]=v=>P.value=!P.value)},[e.createVNode(oe),e.createElementVNode("span",Ge,e.toDisplayString(x.value===1?"1×":`${x.value}×`),1)],8,Xe),P.value?(e.openBlock(),e.createElementBlock("ul",Qe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(t,v=>e.createElementVNode("li",{key:v},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":v===x.value,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":v===x.value}]),onClick:w=>S(v)},e.toDisplayString(v===1?"Normal":`${v}×`),11,et)])),64))])):e.createCommentVNode("",!0)],512),A.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"captionsRootEl",ref:U,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-ctrl-btn",_.value>=0&&"is-active"]),"aria-haspopup":"listbox","aria-expanded":I.value,"aria-label":"Captions","aria-pressed":_.value>=0,onClick:i[2]||(i[2]=v=>I.value=!I.value)},[e.createVNode(le)],10,tt),I.value?(e.openBlock(),e.createElementBlock("ul",nt,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":_.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":_.value===-1}]),onClick:F},"Off",10,ot)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,v=>(e.openBlock(),e.createElementBlock("li",{key:v.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":v.index===_.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":v.index===_.value}]),onClick:w=>K(v.index)},e.toDisplayString(v.label),11,lt)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["gvp-volume",!e.unref(a)&&"is-expandable"])},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":V.value?"Unmute":"Mute","aria-pressed":V.value,onClick:L},[V.value||M.value===0?(e.openBlock(),e.createBlock(Ae,{key:0})):M.value<.5?(e.openBlock(),e.createBlock(ze,{key:1})):(e.openBlock(),e.createBlock(Ie,{key:2}))],8,at),e.unref(a)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("div",{class:"gvp-volume-fill",style:e.normalizeStyle({width:`${V.value?0:Math.round(M.value*100)}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-volume-input",min:0,max:100,step:1,value:V.value?0:Math.round(M.value*100),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":V.value?0:Math.round(M.value*100),onInput:h},null,40,it)]))],2),e.unref(J)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",z.value&&"is-active"]),"aria-label":z.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":z.value,onClick:X},[e.createVNode(ae)],10,ct)):e.createCommentVNode("",!0),e.unref(W)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",H.value&&"is-active"]),"aria-label":H.value?"Exit fullscreen":"Enter fullscreen","aria-pressed":H.value,onClick:q},[H.value?(e.openBlock(),e.createBlock(je,{key:0})):(e.openBlock(),e.createBlock(Ue,{key:1}))],10,ut)):e.createCommentVNode("",!0)])],34))}}),pt={name:"IconDesktop"},mt=e.defineComponent({...pt,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 15H13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M7 22H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),ft={name:"IconMobile"},kt=e.defineComponent({...ft,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 19H13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"},null,-1)])],2))}}),ht={name:"IconPlay"},gt=e.defineComponent({...ht,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"22",height:"22",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",fill:"currentColor"},null,-1)])],2))}}),Ct={name:"IconX"},yt=e.defineComponent({...Ct,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",fill:"currentColor"},null,-1)])],2))}});function re(n){if(!n)return null;if(/^[A-Za-z0-9_-]{11}$/.test(n))return n;let a;try{a=new URL(n)}catch{return null}const r=a.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=a.pathname.slice(1).split("/")[0];return/^[A-Za-z0-9_-]{11}$/.test(t)?t:null}if(r==="youtube.com"||r==="m.youtube.com"||r==="music.youtube.com"||r==="youtube-nocookie.com"){const t=a.searchParams.get("v");if(t&&/^[A-Za-z0-9_-]{11}$/.test(t))return t;const l=/^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(a.pathname);if(l)return l[1]}return null}function se(n){try{const a=new URL(n),r=a.searchParams.get("t")??a.searchParams.get("start");if(!r)return null;if(/^\d+s?$/.test(r))return Number.parseInt(r,10);const t=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(r);if(t){const l=Number.parseInt(t[1]??"0",10),p=Number.parseInt(t[2]??"0",10),f=Number.parseInt(t[3]??"0",10),d=l*3600+p*60+f;return d>0?d:null}}catch{}return null}function ie(n,a={}){const{autoPlay:r=!1,muted:t=!0,loop:l=!1,controls:p=!0,startSeconds:f}=a,d=new URLSearchParams({rel:"0",modestbranding:"1",playsinline:"1",controls:p?"1":"0"});return r?(d.set("autoplay","1"),d.set("mute","1")):t&&d.set("mute","1"),l&&(d.set("loop","1"),d.set("playlist",n)),f&&f>0&&d.set("start",String(f)),`https://www.youtube-nocookie.com/embed/${n}?${d.toString()}`}const Et=["src"],wt={key:2,class:"gvp-vignette"},bt={key:3,class:"gvp-toggle"},Bt={class:"gvp-toggle-pill"},xt=["aria-pressed"],_t=["aria-pressed"],Vt=["aria-label","aria-pressed"],Nt=["aria-label"],$t={key:10,class:"gvp-play-wrap"},Lt={key:0,class:"gvp-tooltip",role:"tooltip"},Pt={key:12,class:"gvp-bottom-fade"},Mt=e.defineComponent({__name:"VideoPlayer",props:{src:{},poster:{},showDeviceToggle:{type:Boolean,default:!0},defaultDevice:{default:"desktop"},hoverPlay:{type:Boolean,default:!1},tooltipText:{},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:[Boolean,String],default:!1},autoPlay:{type:Boolean,default:!1},frameMaxWidth:{},aspectRatio:{},hlsConfig:{},isHls:{type:Boolean},class:{default:""},closable:{type:Boolean,default:!1}},emits:["close","play","pause"],setup(n,{emit:a}){const r=n,t=a,l=e.ref(null),p=e.ref(r.defaultDevice),f=e.ref(!1),d=e.ref(!1),b=e.ref(null),B=e.ref([]),C=e.ref(-1),y=e.ref(1),k=e.ref(!1),m=e.ref(!1),s=e.ref(null),g=typeof document<"u"&&!!document.pictureInPictureEnabled,E=e.computed(()=>r.controls==="custom"),M=e.computed(()=>r.controls===!0),V=e.computed(()=>re(r.src)),L=e.computed(()=>V.value!==null),h=e.computed(()=>V.value?ie(V.value,{autoPlay:r.autoPlay,muted:r.muted,loop:r.loop,controls:E.value?!0:M.value,startSeconds:se(r.src)}):null);function x(u){B.value=u,C.value=-1}const P=e.computed(()=>!L.value&&B.value.length>1),N=e.computed(()=>{var u;return C.value>=0?C.value:((u=B.value[0])==null?void 0:u.index)??-1}),S=e.computed(()=>{var u,c;return p.value==="mobile"?((u=r.aspectRatio)==null?void 0:u.mobile)??"9/16":((c=r.aspectRatio)==null?void 0:c.desktop)??"16/9"}),A=e.computed(()=>{var u,c;return p.value==="mobile"?((u=r.frameMaxWidth)==null?void 0:u.mobile)??"420px":((c=r.frameMaxWidth)==null?void 0:c.desktop)??"960px"}),_=e.computed(()=>{var u;return((u=l.value)==null?void 0:u.videoEl)??null});async function I(){const u=_.value;if(u)try{u.readyState<2&&u.load();const c=u.play();b.value=c,await c,f.value=!0}catch{f.value=!1}finally{b.value=null}}async function U(){const u=_.value;if(u){if(b.value)try{await b.value}catch{}u.pause()}}async function j(){!r.hoverPlay||L.value||await I()}async function K(){!r.hoverPlay||L.value||(await U(),f.value=!1)}async function F(){const u=_.value;u&&(u.paused?await I():(await U(),f.value=!1))}function z(){d.value=!0,j()}function J(){d.value=!1,K()}function X(u){y.value=u;const c=_.value;c&&(c.playbackRate=u)}e.watch(_,u=>{u&&(u.addEventListener("ratechange",()=>{y.value=u.playbackRate}),u.addEventListener("enterpictureinpicture",()=>{k.value=!0}),u.addEventListener("leavepictureinpicture",()=>{k.value=!1}))});function H(){const u=_.value;u&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):u.requestPictureInPicture().catch(()=>{}))}function Z(u){var D,q,W;const c=_.value;if(!(!c||!m.value&&!((D=s.value)!=null&&D.contains(document.activeElement))||u.target.tagName==="INPUT"&&u.key!==" "))switch(u.key){case" ":case"k":u.preventDefault(),F();break;case"ArrowLeft":u.preventDefault(),c.currentTime=Math.max(0,c.currentTime-5);break;case"ArrowRight":u.preventDefault(),c.currentTime=Math.min(c.duration||0,c.currentTime+5);break;case"ArrowUp":u.preventDefault(),c.volume=Math.min(1,c.volume+.1),c.muted&&(c.muted=!1);break;case"ArrowDown":u.preventDefault(),c.volume=Math.max(0,c.volume-.1);break;case"m":c.muted=!c.muted;break;case"f":{const Y=document.fullscreenElement??document.webkitFullscreenElement??null,o=((q=s.value)==null?void 0:q.requestFullscreen)??((W=s.value)==null?void 0:W.webkitRequestFullscreen),i=document.exitFullscreen??document.webkitExitFullscreen;Y===s.value?i==null||i.call(document).catch(()=>{}):o&&s.value&&o.call(s.value).catch(()=>{});break}case"p":g&&H();break}}return e.onMounted(()=>{document.addEventListener("keydown",Z)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",Z)}),(u,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:e.normalizeClass(["gvp-root",r.class]),style:e.normalizeStyle({width:A.value,aspectRatio:S.value}),onMouseenter:c[8]||(c[8]=T=>{m.value=!0,z()}),onMouseleave:c[9]||(c[9]=T=>{m.value=!1,J()})},[L.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"gvp-video gvp-youtube",src:h.value??void 0,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:"",referrerpolicy:"strict-origin-when-cross-origin"},null,8,Et)):(e.openBlock(),e.createBlock(te,{key:1,ref_key:"hlsPlayerRef",ref:l,controls:M.value,"hls-config":n.hlsConfig,"is-hls":n.isHls,loop:n.loop,muted:n.muted,"auto-play":n.autoPlay,"audio-track-index":C.value,"plays-inline":!0,poster:n.poster,src:n.src,class:"gvp-video",preload:"metadata",onAudioTracks:x,onPause:c[0]||(c[0]=T=>{f.value=!1,t("pause")}),onPlay:c[1]||(c[1]=T=>{f.value=!0,t("play")})},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},8,["controls","hls-config","is-hls","loop","muted","auto-play","audio-track-index","poster","src"])),L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",wt)),n.showDeviceToggle?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("button",{"aria-pressed":p.value==="desktop",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":p.value==="desktop"}]),"aria-label":"Desktop view",type:"button",onClick:c[2]||(c[2]=T=>p.value="desktop")},[e.createVNode(mt)],10,xt),c[10]||(c[10]=e.createElementVNode("div",{class:"gvp-toggle-divider"},null,-1)),e.createElementVNode("button",{"aria-pressed":p.value==="mobile",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":p.value==="mobile"}]),"aria-label":"Mobile view",type:"button",onClick:c[3]||(c[3]=T=>p.value="mobile")},[e.createVNode(kt)],10,_t)])])):e.createCommentVNode("",!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:4,"aria-label":"Close",class:"gvp-close",type:"button",onClick:c[4]||(c[4]=T=>t("close"))},[e.createVNode(yt)])):e.createCommentVNode("",!0),P.value&&!E.value?(e.openBlock(),e.createBlock(he,{key:5,tracks:B.value,"active-index":N.value,onSelect:c[5]||(c[5]=T=>C.value=T)},null,8,["tracks","active-index"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createBlock(be,{key:6,speed:y.value,onSelect:X},null,8,["speed"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createBlock($e,{key:7,video:_.value},null,8,["video"])):e.createCommentVNode("",!0),!L.value&&e.unref(g)&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:8,type:"button",class:e.normalizeClass(["gvp-pip-btn",{"is-active":k.value}]),"aria-label":k.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":k.value,onClick:H},[e.createVNode(ae)],10,Vt)):e.createCommentVNode("",!0),!L.value&&E.value?(e.openBlock(),e.createElementBlock("button",{key:9,type:"button",class:"gvp-click-layer","aria-label":f.value?"Pause":"Play",onClick:F},null,8,Nt)):e.createCommentVNode("",!0),!L.value&&!E.value&&!f.value?(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("button",{"aria-label":"Play",class:"gvp-play",type:"button",onClick:F,onMouseenter:c[6]||(c[6]=T=>d.value=!0),onMouseleave:c[7]||(c[7]=T=>d.value=!1)},[e.createVNode(gt),n.tooltipText&&d.value?(e.openBlock(),e.createElementBlock("span",Lt,e.toDisplayString(n.tooltipText),1)):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0),!L.value&&E.value?(e.openBlock(),e.createBlock(vt,{key:11,video:_.value,"is-playing":f.value,container:s.value,"on-toggle-play":F},null,8,["video","is-playing","container"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createElementBlock("div",Pt)):e.createCommentVNode("",!0)],38))}});exports.HLSPlayer=te;exports.VueVideoPlayer=Mt;exports.parseYouTubeId=re;exports.parseYouTubeStart=se;exports.youTubeEmbedUrl=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("hls.js");function Q(n,a,r){const t=n==null?void 0:n.trim();if(t)return t;if(a){try{const p=new Intl.DisplayNames(void 0,{type:"language"}).of(a);if(p&&p!==a)return p}catch{}return a}return`Audio ${r+1}`}const ce=["muted","loop","controls","autoplay","playsinline","preload","poster"],te=e.defineComponent({__name:"HLSPlayer",props:{src:{},hlsConfig:{},isHls:{type:Boolean},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},playsInline:{type:Boolean,default:!0},preload:{default:"metadata"},poster:{},class:{},audioTrackIndex:{default:-1}},emits:["play","pause","audio-tracks"],setup(n,{expose:a,emit:r}){const t=n,l=r,p=e.ref(null),f=e.ref(null);let d,b;const B=globalThis.window!==void 0&&R.isSupported(),C=s=>!!t.isHls||B&&s.endsWith(".m3u8");function y(){b==null||b(),b=void 0,d==null||d(),d=void 0,f.value&&(f.value.destroy(),f.value=null);const s=p.value;if(s){for(s.pause(),s.removeAttribute("src");s.firstChild;)s.firstChild.remove();s.load(),l("audio-tracks",[])}}function k(s){var M,V,L;const g=p.value;if(!g||!s)return;y();const E=()=>{t.autoPlay&&g.play().catch(()=>{})};if(C(s)){const h=new R(t.hlsConfig);f.value=h;const x=()=>{const P=h.audioTracks.map((N,S)=>({index:S,label:Q(N.name,N.lang,S),lang:N.lang||void 0}));l("audio-tracks",P)};h.on(R.Events.MANIFEST_PARSED,E),h.on(R.Events.AUDIO_TRACKS_UPDATED,x),h.on(R.Events.AUDIO_TRACK_SWITCHED,x),h.on(R.Events.ERROR,(P,N)=>{N.fatal&&(h.destroy(),f.value=null)}),h.attachMedia(g),h.loadSource(s)}else{g.src=s,g.load(),g.addEventListener("loadedmetadata",E,{once:!0}),b=()=>{g.removeEventListener("loadedmetadata",E)};const h=g.audioTracks;if(h){const x=()=>{const P=[];for(let N=0;N<h.length;N++){const S=h[N];P.push({index:N,label:Q(S.label,S.language,N),lang:S.language||void 0})}l("audio-tracks",P)};(M=h.addEventListener)==null||M.call(h,"addtrack",x),(V=h.addEventListener)==null||V.call(h,"removetrack",x),(L=h.addEventListener)==null||L.call(h,"change",x),h.length>0&&x(),d=()=>{var P,N,S;(P=h.removeEventListener)==null||P.call(h,"addtrack",x),(N=h.removeEventListener)==null||N.call(h,"removetrack",x),(S=h.removeEventListener)==null||S.call(h,"change",x)}}}}function m(s){var M;if(s==null||s<0)return;const g=f.value;if(g){g.audioTrack!==s&&(g.audioTrack=s);return}const E=(M=p.value)==null?void 0:M.audioTracks;if(E)for(let V=0;V<E.length;V++)E[V].enabled=V===s}return e.onMounted(()=>{t.src&&k(t.src)}),e.watch(()=>t.src,s=>{s&&k(s)}),e.watch(()=>t.audioTrackIndex,s=>m(s)),e.onBeforeUnmount(y),a({videoEl:p}),(s,g)=>(e.openBlock(),e.createElementBlock("video",{ref_key:"videoEl",ref:p,muted:n.muted,loop:n.loop,controls:n.controls,autoplay:n.autoPlay,playsinline:n.playsInline,preload:n.preload,poster:n.poster,class:e.normalizeClass(t.class),onPlay:g[0]||(g[0]=E=>l("play")),onPause:g[1]||(g[1]=E=>l("pause"))},[e.renderSlot(s.$slots,"default")],42,ce))}}),ue={name:"IconAudio"},de=e.defineComponent({...ue,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),ve={name:"IconChevron"},ne=e.defineComponent({...ve,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6 9L12 15L18 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),pe=["aria-expanded"],me={class:"gvp-audio-label"},fe={key:0,class:"gvp-audio-menu",role:"listbox","aria-label":"Audio tracks"},ke=["aria-selected","onClick"],he=e.defineComponent({__name:"AudioTrackSwitcher",props:{tracks:{},activeIndex:{}},emits:["select"],setup(n,{emit:a}){const r=n,t=a,l=e.ref(!1),p=e.ref(null),f=e.computed(()=>r.tracks.find(C=>C.index===r.activeIndex)??r.tracks[0]);function d(C){p.value&&!p.value.contains(C.target)&&(l.value=!1)}function b(C){C.key==="Escape"&&(l.value=!1)}e.watch(l,C=>{C?(document.addEventListener("mousedown",d),document.addEventListener("keydown",b)):(document.removeEventListener("mousedown",d),document.removeEventListener("keydown",b))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",b)});function B(C){t("select",C),l.value=!1}return(C,y)=>{var k;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-audio"},[e.createElementVNode("button",{type:"button",class:"gvp-audio-btn","aria-haspopup":"listbox","aria-expanded":l.value,"aria-label":"Audio track",onClick:y[0]||(y[0]=m=>l.value=!l.value)},[e.createVNode(de),e.createElementVNode("span",me,e.toDisplayString((k=f.value)==null?void 0:k.label),1),e.createVNode(ne)],8,pe),l.value?(e.openBlock(),e.createElementBlock("ul",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tracks,m=>(e.openBlock(),e.createElementBlock("li",{key:m.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":m.index===n.activeIndex,class:e.normalizeClass(["gvp-audio-menu-item",{"is-active":m.index===n.activeIndex}]),onClick:s=>B(m.index)},e.toDisplayString(m.label),11,ke)]))),128))])):e.createCommentVNode("",!0)],512)}}}),ge={name:"IconSpeed"},oe=e.defineComponent({...ge,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M12 8V12L14.5 14.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Ce=["aria-expanded"],ye={class:"gvp-speed-label"},Ee={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},we=["aria-selected","onClick"],be=e.defineComponent({__name:"SpeedSwitcher",props:{speed:{}},emits:["select"],setup(n,{emit:a}){const r=[.5,.75,1,1.25,1.5,2],t=a,l=e.ref(!1),p=e.ref(null);function f(B){p.value&&!p.value.contains(B.target)&&(l.value=!1)}function d(B){B.key==="Escape"&&(l.value=!1)}e.watch(l,B=>{B?(document.addEventListener("mousedown",f),document.addEventListener("keydown",d)):(document.removeEventListener("mousedown",f),document.removeEventListener("keydown",d))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",d)});function b(B){t("select",B),l.value=!1}return(B,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":l.value,"aria-label":"`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",onClick:C[0]||(C[0]=y=>l.value=!l.value)},[e.createVNode(oe),e.createElementVNode("span",ye,e.toDisplayString(n.speed===1?"1×":`${n.speed}×`),1),e.createVNode(ne)],8,Ce),l.value?(e.openBlock(),e.createElementBlock("ul",Ee,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,y=>e.createElementVNode("li",{key:y},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":y===n.speed,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":y===n.speed}]),onClick:k=>b(y)},e.toDisplayString(y===1?"Normal":`${y}×`),11,we)])),64))])):e.createCommentVNode("",!0)],512))}}),Be={name:"IconCaptions"},le=e.defineComponent({...Be,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),xe=["aria-expanded","aria-pressed"],_e={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},Ve=["aria-selected"],Ne=["aria-selected","onClick"],$e=e.defineComponent({__name:"CaptionsSwitcher",props:{video:{}},setup(n){const a=n,r=e.ref([]),t=e.ref(-1),l=e.ref(!1),p=e.ref(null);function f(k){const m=[];for(let g=0;g<k.length;g++){const E=k[g];(E.kind==="subtitles"||E.kind==="captions")&&m.push({index:g,label:E.label||E.language||`Track ${g+1}`})}r.value=m;let s=-1;for(let g=0;g<k.length;g++)if(k[g].mode==="showing"){s=g;break}t.value=s}let d=null;e.watch(()=>a.video,k=>{if(d==null||d(),d=null,!k){r.value=[],t.value=-1;return}const m=k.textTracks;f(m);const s=()=>f(m);typeof m.addEventListener=="function"&&(m.addEventListener("addtrack",s),m.addEventListener("removetrack",s),m.addEventListener("change",s),d=()=>{m.removeEventListener("addtrack",s),m.removeEventListener("removetrack",s),m.removeEventListener("change",s)})},{immediate:!0}),e.onBeforeUnmount(()=>{d==null||d(),document.removeEventListener("mousedown",b),document.removeEventListener("keydown",B)});function b(k){p.value&&!p.value.contains(k.target)&&(l.value=!1)}function B(k){k.key==="Escape"&&(l.value=!1)}e.watch(l,k=>{k?(document.addEventListener("mousedown",b),document.addEventListener("keydown",B)):(document.removeEventListener("mousedown",b),document.removeEventListener("keydown",B))});function C(){if(!a.video)return;const k=a.video.textTracks;for(let m=0;m<k.length;m++)k[m].mode="hidden";t.value=-1,l.value=!1}function y(k){if(!a.video)return;const m=a.video.textTracks;for(let s=0;s<m.length;s++)m[s].mode=s===k?"showing":"hidden";t.value=k,l.value=!1}return(k,m)=>r.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootEl",ref:p,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-captions-btn",{"is-active":t.value>=0}]),"aria-haspopup":"listbox","aria-expanded":l.value,"aria-pressed":t.value>=0,"aria-label":"Captions",onClick:m[0]||(m[0]=s=>l.value=!l.value)},[e.createVNode(le)],10,xe),l.value?(e.openBlock(),e.createElementBlock("ul",_e,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":t.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":t.value===-1}]),onClick:C}," Off ",10,Ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,s=>(e.openBlock(),e.createElementBlock("li",{key:s.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":s.index===t.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":s.index===t.value}]),onClick:g=>y(s.index)},e.toDisplayString(s.label),11,Ne)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}}),Le={name:"IconPause"},Pe=e.defineComponent({...Le,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Me={name:"IconPlaySolid"},Se=e.defineComponent({...Me,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",fill:"currentColor"},null,-1)])],2))}}),Te={name:"IconVolumeHigh"},Ie=e.defineComponent({...Te,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),He={name:"IconVolumeLow"},ze=e.defineComponent({...He,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),De={name:"IconVolumeMuted"},Ae=e.defineComponent({...De,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16 9L22 15M22 9L16 15",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Fe={name:"IconPiP"},ae=e.defineComponent({...Fe,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("rect",{x:"12",y:"12",width:"8",height:"5",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Re={name:"IconFullscreen"},Ue=e.defineComponent({...Re,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Oe={name:"IconFullscreenExit"},je=e.defineComponent({...Oe,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}});function ee(n){if(!Number.isFinite(n)||n<0)return"--:--";const a=Math.floor(n),r=Math.floor(a/3600),t=Math.floor(a%3600/60),p=(a%60).toString().padStart(2,"0");if(r>0){const f=t.toString().padStart(2,"0");return`${r}:${f}:${p}`}return`${t}:${p}`}const Ze={class:"gvp-controls-row"},qe=["aria-label","aria-pressed"],We={class:"gvp-seek"},Ye={class:"gvp-seek-track"},Ke=["value","disabled","aria-valuemax","aria-valuenow"],Je={class:"gvp-time","aria-live":"off"},Xe=["aria-expanded","aria-label"],Ge={class:"gvp-speed-label"},Qe={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},et=["aria-selected","onClick"],tt=["aria-expanded","aria-pressed"],nt={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},ot=["aria-selected"],lt=["aria-selected","onClick"],at=["aria-label","aria-pressed"],rt={key:0,class:"gvp-volume-slider-wrap"},st={class:"gvp-volume-track"},it=["value","aria-valuenow"],ct=["aria-label","aria-pressed"],ut=["aria-label","aria-pressed"],dt=3e3,vt=e.defineComponent({__name:"ControlBar",props:{video:{},isPlaying:{type:Boolean},container:{},onTogglePlay:{type:Function}},setup(n){const a=(()=>{if(typeof navigator>"u")return!1;const o=navigator.userAgent;return/iPad|iPhone|iPod/.test(o)||o.includes("Mac")&&navigator.maxTouchPoints>1})(),r=typeof navigator>"u"?!1:/iPhone|iPod/.test(navigator.userAgent),t=[.5,.75,1,1.25,1.5,2],l=n,p=e.ref(!0);let f=null;function d(){f!==null&&(clearTimeout(f),f=null)}function b(){d(),l.isPlaying&&(f=setTimeout(()=>{p.value=!1},dt))}function B(){p.value=!0,b()}e.watch(()=>l.isPlaying,o=>{o?b():(d(),p.value=!0)},{immediate:!0}),e.watch(()=>l.container,o=>{if(!o)return;const i=()=>B();o.addEventListener("mousemove",i),o.addEventListener("touchstart",i),o.addEventListener("focusin",i)},{immediate:!0});const C=e.ref(0),y=e.ref(0),k=e.ref(0);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{C.value=o.currentTime},v=()=>{y.value=Number.isFinite(o.duration)?o.duration:0},w=()=>{const $=o.buffered;if(!$||$.length===0){k.value=0;return}let G=$.end($.length-1);for(let O=0;O<$.length;O++)if($.start(O)<=o.currentTime&&o.currentTime<=$.end(O)){G=$.end(O);break}k.value=G};i(),v(),w(),o.addEventListener("timeupdate",i),o.addEventListener("durationchange",v),o.addEventListener("loadedmetadata",v),o.addEventListener("progress",w),o.addEventListener("timeupdate",w)},{immediate:!0});const m=()=>y.value>0,s=()=>m()?C.value/y.value*100:0,g=()=>m()?k.value/y.value*100:0;function E(o){const i=l.video;if(!i||!m())return;const v=Number(o.target.value)/100*y.value;i.currentTime=v,C.value=v}const M=e.ref(1),V=e.ref(!1);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{M.value=o.volume,V.value=o.muted};i(),o.addEventListener("volumechange",i)},{immediate:!0});function L(){l.video&&(l.video.muted=!l.video.muted)}function h(o){const i=l.video;if(!i)return;const v=Number(o.target.value)/100;i.volume=v,v>0&&i.muted&&(i.muted=!1)}const x=e.ref(1),P=e.ref(!1),N=e.ref(null);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{x.value=o.playbackRate};i(),o.addEventListener("ratechange",i)},{immediate:!0});function S(o){l.video&&(l.video.playbackRate=o),x.value=o,P.value=!1}const A=e.ref([]),_=e.ref(-1),I=e.ref(!1),U=e.ref(null);function j(o){const i=[];for(let w=0;w<o.length;w++){const $=o[w];($.kind==="subtitles"||$.kind==="captions")&&i.push({index:w,label:$.label||$.language||`Track ${w+1}`})}A.value=i;let v=-1;for(let w=0;w<o.length;w++)if(o[w].mode==="showing"){v=w;break}_.value=v}e.watch(()=>l.video,o=>{if(!o){A.value=[],_.value=-1;return}const i=o.textTracks;j(i);const v=()=>j(i);typeof i.addEventListener=="function"&&(i.addEventListener("addtrack",v),i.addEventListener("removetrack",v),i.addEventListener("change",v))},{immediate:!0});function K(o){var v;const i=(v=l.video)==null?void 0:v.textTracks;if(i){for(let w=0;w<i.length;w++)i[w].mode=w===o?"showing":"hidden";_.value=o,I.value=!1}}function F(){var i;const o=(i=l.video)==null?void 0:i.textTracks;if(o){for(let v=0;v<o.length;v++)o[v].mode="hidden";_.value=-1,I.value=!1}}const z=e.ref(!1),J=typeof document<"u"&&!!document.pictureInPictureEnabled;e.watch(()=>l.video,o=>{o&&(o.addEventListener("enterpictureinpicture",()=>{z.value=!0}),o.addEventListener("leavepictureinpicture",()=>{z.value=!1}))},{immediate:!0});function X(){l.video&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):l.video.requestPictureInPicture().catch(()=>{}))}const H=e.ref(!1),Z=typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled);function u(){return document.fullscreenElement??document.webkitFullscreenElement??null}function c(o){const i=o.requestFullscreen??o.webkitRequestFullscreen;return i?i.call(o):Promise.reject(new Error("unsupported"))}function T(){const o=document.exitFullscreen??document.webkitExitFullscreen;return o?o.call(document):Promise.reject(new Error("unsupported"))}function D(){H.value=u()===l.container}e.onMounted(()=>{document.addEventListener("fullscreenchange",D),document.addEventListener("webkitfullscreenchange",D)}),e.onBeforeUnmount(()=>{d(),document.removeEventListener("fullscreenchange",D),document.removeEventListener("webkitfullscreenchange",D)});function q(){var o,i;if(r){(i=(o=l.video)==null?void 0:o.webkitEnterFullscreen)==null||i.call(o);return}H.value?T().catch(()=>{}):l.container&&c(l.container).catch(()=>{})}const W=Z||r&&l.video!==null&&typeof l.video.webkitEnterFullscreen=="function";function Y(o,i){function v($){i.value&&!i.value.contains($.target)&&(o.value=!1)}function w($){$.key==="Escape"&&(o.value=!1)}e.watch(o,$=>{$?(document.addEventListener("mousedown",v),document.addEventListener("keydown",w)):(document.removeEventListener("mousedown",v),document.removeEventListener("keydown",w))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",w)})}return Y(P,N),Y(I,U),(o,i)=>(e.openBlock(),e.createElementBlock("div",{role:"toolbar","aria-label":"Video controls",class:e.normalizeClass(["gvp-controls",!p.value&&"is-hidden"]),onMouseenter:d,onMouseleave:b},[e.createElementVNode("div",Ze,[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":n.isPlaying?"Pause":"Play","aria-pressed":n.isPlaying,onClick:i[0]||(i[0]=(...v)=>n.onTogglePlay&&n.onTogglePlay(...v))},[n.isPlaying?(e.openBlock(),e.createBlock(Pe,{key:0})):(e.openBlock(),e.createBlock(Se,{key:1}))],8,qe),e.createElementVNode("div",We,[e.createElementVNode("div",Ye,[e.createElementVNode("div",{class:"gvp-seek-buffered",style:e.normalizeStyle({width:`${g()}%`})},null,4),e.createElementVNode("div",{class:"gvp-seek-progress",style:e.normalizeStyle({width:`${s()}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-seek-input",min:0,max:100,step:.1,value:s(),disabled:!m(),"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(y.value),"aria-valuenow":Math.floor(C.value),onInput:E},null,40,Ke)]),e.createElementVNode("span",Je,e.toDisplayString(e.unref(ee)(C.value))+" / "+e.toDisplayString(e.unref(ee)(y.value)),1),e.createElementVNode("div",{ref_key:"speedRootEl",ref:N,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":P.value,"aria-label":`Playback speed: ${x.value===1?"1×":x.value+"×"}`,onClick:i[1]||(i[1]=v=>P.value=!P.value)},[e.createVNode(oe),e.createElementVNode("span",Ge,e.toDisplayString(x.value===1?"1×":`${x.value}×`),1)],8,Xe),P.value?(e.openBlock(),e.createElementBlock("ul",Qe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(t,v=>e.createElementVNode("li",{key:v},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":v===x.value,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":v===x.value}]),onClick:w=>S(v)},e.toDisplayString(v===1?"Normal":`${v}×`),11,et)])),64))])):e.createCommentVNode("",!0)],512),A.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"captionsRootEl",ref:U,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-ctrl-btn",_.value>=0&&"is-active"]),"aria-haspopup":"listbox","aria-expanded":I.value,"aria-label":"Captions","aria-pressed":_.value>=0,onClick:i[2]||(i[2]=v=>I.value=!I.value)},[e.createVNode(le)],10,tt),I.value?(e.openBlock(),e.createElementBlock("ul",nt,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":_.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":_.value===-1}]),onClick:F},"Off",10,ot)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,v=>(e.openBlock(),e.createElementBlock("li",{key:v.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":v.index===_.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":v.index===_.value}]),onClick:w=>K(v.index)},e.toDisplayString(v.label),11,lt)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["gvp-volume",!e.unref(a)&&"is-expandable"])},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":V.value?"Unmute":"Mute","aria-pressed":V.value,onClick:L},[V.value||M.value===0?(e.openBlock(),e.createBlock(Ae,{key:0})):M.value<.5?(e.openBlock(),e.createBlock(ze,{key:1})):(e.openBlock(),e.createBlock(Ie,{key:2}))],8,at),e.unref(a)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("div",{class:"gvp-volume-fill",style:e.normalizeStyle({width:`${V.value?0:Math.round(M.value*100)}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-volume-input",min:0,max:100,step:1,value:V.value?0:Math.round(M.value*100),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":V.value?0:Math.round(M.value*100),onInput:h},null,40,it)]))],2),e.unref(J)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",z.value&&"is-active"]),"aria-label":z.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":z.value,onClick:X},[e.createVNode(ae)],10,ct)):e.createCommentVNode("",!0),e.unref(W)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",H.value&&"is-active"]),"aria-label":H.value?"Exit fullscreen":"Enter fullscreen","aria-pressed":H.value,onClick:q},[H.value?(e.openBlock(),e.createBlock(je,{key:0})):(e.openBlock(),e.createBlock(Ue,{key:1}))],10,ut)):e.createCommentVNode("",!0)])],34))}}),pt={name:"IconDesktop"},mt=e.defineComponent({...pt,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 15H13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M7 22H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),ft={name:"IconMobile"},kt=e.defineComponent({...ft,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 19H13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"},null,-1)])],2))}}),ht={name:"IconPlay"},gt=e.defineComponent({...ht,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"22",height:"22",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",fill:"currentColor"},null,-1)])],2))}}),Ct={name:"IconX"},yt=e.defineComponent({...Ct,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",fill:"currentColor"},null,-1)])],2))}});function re(n){if(!n)return null;if(/^[A-Za-z0-9_-]{11}$/.test(n))return n;let a;try{a=new URL(n)}catch{return null}const r=a.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=a.pathname.slice(1).split("/")[0];return/^[A-Za-z0-9_-]{11}$/.test(t)?t:null}if(r==="youtube.com"||r==="m.youtube.com"||r==="music.youtube.com"||r==="youtube-nocookie.com"){const t=a.searchParams.get("v");if(t&&/^[A-Za-z0-9_-]{11}$/.test(t))return t;const l=/^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(a.pathname);if(l)return l[1]}return null}function se(n){try{const a=new URL(n),r=a.searchParams.get("t")??a.searchParams.get("start");if(!r)return null;if(/^\d+s?$/.test(r))return Number.parseInt(r,10);const t=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(r);if(t){const l=Number.parseInt(t[1]??"0",10),p=Number.parseInt(t[2]??"0",10),f=Number.parseInt(t[3]??"0",10),d=l*3600+p*60+f;return d>0?d:null}}catch{}return null}function ie(n,a={}){const{autoPlay:r=!1,muted:t=!0,loop:l=!1,controls:p=!0,startSeconds:f}=a,d=new URLSearchParams({rel:"0",modestbranding:"1",playsinline:"1",controls:p?"1":"0"});return r?(d.set("autoplay","1"),d.set("mute","1")):t&&d.set("mute","1"),l&&(d.set("loop","1"),d.set("playlist",n)),f&&f>0&&d.set("start",String(f)),`https://www.youtube-nocookie.com/embed/${n}?${d.toString()}`}const Et=["src"],wt={key:2,class:"gvp-vignette"},bt={key:3,class:"gvp-toggle"},Bt={class:"gvp-toggle-pill"},xt=["aria-pressed"],_t=["aria-pressed"],Vt=["aria-label","aria-pressed"],Nt=["aria-label"],$t={key:10,class:"gvp-play-wrap"},Lt={key:0,class:"gvp-tooltip",role:"tooltip"},Pt={key:12,class:"gvp-bottom-fade"},Mt=e.defineComponent({__name:"VideoPlayer",props:{src:{},poster:{},showDeviceToggle:{type:Boolean,default:!0},defaultDevice:{default:"desktop"},hoverPlay:{type:Boolean,default:!1},tooltipText:{},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:[Boolean,String],default:!0},autoPlay:{type:Boolean,default:!1},frameMaxWidth:{},aspectRatio:{},hlsConfig:{},isHls:{type:Boolean},class:{default:""},closable:{type:Boolean,default:!1}},emits:["close","play","pause"],setup(n,{emit:a}){const r=n,t=a,l=e.ref(null),p=e.ref(r.defaultDevice),f=e.ref(!1),d=e.ref(!1),b=e.ref(null),B=e.ref([]),C=e.ref(-1),y=e.ref(1),k=e.ref(!1),m=e.ref(!1),s=e.ref(null),g=typeof document<"u"&&!!document.pictureInPictureEnabled,E=e.computed(()=>r.controls===!0||r.controls==="custom"),M=e.computed(()=>r.controls==="native"),V=e.computed(()=>re(r.src)),L=e.computed(()=>V.value!==null),h=e.computed(()=>V.value?ie(V.value,{autoPlay:r.autoPlay,muted:r.muted,loop:r.loop,controls:E.value?!0:M.value,startSeconds:se(r.src)}):null);function x(u){B.value=u,C.value=-1}const P=e.computed(()=>!L.value&&B.value.length>1),N=e.computed(()=>{var u;return C.value>=0?C.value:((u=B.value[0])==null?void 0:u.index)??-1}),S=e.computed(()=>{var u,c;return p.value==="mobile"?((u=r.aspectRatio)==null?void 0:u.mobile)??"9/16":((c=r.aspectRatio)==null?void 0:c.desktop)??"16/9"}),A=e.computed(()=>{var u,c;return p.value==="mobile"?((u=r.frameMaxWidth)==null?void 0:u.mobile)??"420px":((c=r.frameMaxWidth)==null?void 0:c.desktop)??"960px"}),_=e.computed(()=>{var u;return((u=l.value)==null?void 0:u.videoEl)??null});async function I(){const u=_.value;if(u)try{u.readyState<2&&u.load();const c=u.play();b.value=c,await c,f.value=!0}catch{f.value=!1}finally{b.value=null}}async function U(){const u=_.value;if(u){if(b.value)try{await b.value}catch{}u.pause()}}async function j(){!r.hoverPlay||L.value||await I()}async function K(){!r.hoverPlay||L.value||(await U(),f.value=!1)}async function F(){const u=_.value;u&&(u.paused?await I():(await U(),f.value=!1))}function z(){d.value=!0,j()}function J(){d.value=!1,K()}function X(u){y.value=u;const c=_.value;c&&(c.playbackRate=u)}e.watch(_,u=>{u&&(u.addEventListener("ratechange",()=>{y.value=u.playbackRate}),u.addEventListener("enterpictureinpicture",()=>{k.value=!0}),u.addEventListener("leavepictureinpicture",()=>{k.value=!1}))});function H(){const u=_.value;u&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):u.requestPictureInPicture().catch(()=>{}))}function Z(u){var D,q,W;const c=_.value;if(!(!c||!m.value&&!((D=s.value)!=null&&D.contains(document.activeElement))||u.target.tagName==="INPUT"&&u.key!==" "))switch(u.key){case" ":case"k":u.preventDefault(),F();break;case"ArrowLeft":u.preventDefault(),c.currentTime=Math.max(0,c.currentTime-5);break;case"ArrowRight":u.preventDefault(),c.currentTime=Math.min(c.duration||0,c.currentTime+5);break;case"ArrowUp":u.preventDefault(),c.volume=Math.min(1,c.volume+.1),c.muted&&(c.muted=!1);break;case"ArrowDown":u.preventDefault(),c.volume=Math.max(0,c.volume-.1);break;case"m":c.muted=!c.muted;break;case"f":{const Y=document.fullscreenElement??document.webkitFullscreenElement??null,o=((q=s.value)==null?void 0:q.requestFullscreen)??((W=s.value)==null?void 0:W.webkitRequestFullscreen),i=document.exitFullscreen??document.webkitExitFullscreen;Y===s.value?i==null||i.call(document).catch(()=>{}):o&&s.value&&o.call(s.value).catch(()=>{});break}case"p":g&&H();break}}return e.onMounted(()=>{document.addEventListener("keydown",Z)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",Z)}),(u,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:e.normalizeClass(["gvp-root",r.class]),style:e.normalizeStyle({width:A.value,aspectRatio:S.value}),onMouseenter:c[8]||(c[8]=T=>{m.value=!0,z()}),onMouseleave:c[9]||(c[9]=T=>{m.value=!1,J()})},[L.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"gvp-video gvp-youtube",src:h.value??void 0,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:"",referrerpolicy:"strict-origin-when-cross-origin"},null,8,Et)):(e.openBlock(),e.createBlock(te,{key:1,ref_key:"hlsPlayerRef",ref:l,controls:M.value,"hls-config":n.hlsConfig,"is-hls":n.isHls,loop:n.loop,muted:n.muted,"auto-play":n.autoPlay,"audio-track-index":C.value,"plays-inline":!0,poster:n.poster,src:n.src,class:"gvp-video",preload:"metadata",onAudioTracks:x,onPause:c[0]||(c[0]=T=>{f.value=!1,t("pause")}),onPlay:c[1]||(c[1]=T=>{f.value=!0,t("play")})},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},8,["controls","hls-config","is-hls","loop","muted","auto-play","audio-track-index","poster","src"])),L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",wt)),n.showDeviceToggle?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("button",{"aria-pressed":p.value==="desktop",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":p.value==="desktop"}]),"aria-label":"Desktop view",type:"button",onClick:c[2]||(c[2]=T=>p.value="desktop")},[e.createVNode(mt)],10,xt),c[10]||(c[10]=e.createElementVNode("div",{class:"gvp-toggle-divider"},null,-1)),e.createElementVNode("button",{"aria-pressed":p.value==="mobile",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":p.value==="mobile"}]),"aria-label":"Mobile view",type:"button",onClick:c[3]||(c[3]=T=>p.value="mobile")},[e.createVNode(kt)],10,_t)])])):e.createCommentVNode("",!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:4,"aria-label":"Close",class:"gvp-close",type:"button",onClick:c[4]||(c[4]=T=>t("close"))},[e.createVNode(yt)])):e.createCommentVNode("",!0),P.value&&!E.value?(e.openBlock(),e.createBlock(he,{key:5,tracks:B.value,"active-index":N.value,onSelect:c[5]||(c[5]=T=>C.value=T)},null,8,["tracks","active-index"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createBlock(be,{key:6,speed:y.value,onSelect:X},null,8,["speed"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createBlock($e,{key:7,video:_.value},null,8,["video"])):e.createCommentVNode("",!0),!L.value&&e.unref(g)&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:8,type:"button",class:e.normalizeClass(["gvp-pip-btn",{"is-active":k.value}]),"aria-label":k.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":k.value,onClick:H},[e.createVNode(ae)],10,Vt)):e.createCommentVNode("",!0),!L.value&&E.value?(e.openBlock(),e.createElementBlock("button",{key:9,type:"button",class:"gvp-click-layer","aria-label":f.value?"Pause":"Play",onClick:F},null,8,Nt)):e.createCommentVNode("",!0),!L.value&&!E.value&&!f.value?(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("button",{"aria-label":"Play",class:"gvp-play",type:"button",onClick:F,onMouseenter:c[6]||(c[6]=T=>d.value=!0),onMouseleave:c[7]||(c[7]=T=>d.value=!1)},[e.createVNode(gt),n.tooltipText&&d.value?(e.openBlock(),e.createElementBlock("span",Lt,e.toDisplayString(n.tooltipText),1)):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0),!L.value&&E.value?(e.openBlock(),e.createBlock(vt,{key:11,video:_.value,"is-playing":f.value,container:s.value,"on-toggle-play":F},null,8,["video","is-playing","container"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createElementBlock("div",Pt)):e.createCommentVNode("",!0)],38))}});exports.HLSPlayer=te;exports.VueVideoPlayer=Mt;exports.parseYouTubeId=re;exports.parseYouTubeStart=se;exports.youTubeEmbedUrl=ie;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|