1import{s as p,u as o,v as u,w as l,x as h,l as P,D as f,E as g,T as k,f as n}from"./vidstack-BX2vFzyN.js";import{H as m,a as x}from"./vidstack-Bq6c3Bam-Bbt_eG6_.js";import"./site-BhZxlCTX.js";import"./phosphor-icons-CZMYOXP4.js";import"./swiper-CYcOCGOI.js";import"./vidstack-DqAw8m9J-DKDOzPua.js";class T{#t;#i;constructor(t,e){this.#t=t,this.#i=e,t.textTracks.onaddtrack=this.#e.bind(this),h(this.#s.bind(this))}#e(t){const e=t.track;if(!e||v(this.#t,e))return;const i=new k({id:e.id,kind:e.kind,label:e.label??"",language:e.language,type:"vtt"});i[n.native]={track:e},i[n.readyState]=2,i[n.nativeHLS]=!0;let a=0;const c=d=>{if(e.cues)for(let r=a;r<e.cues.length;r++)i.addCue(e.cues[r],d),a++};c(t),e.oncuechange=c,this.#i.textTracks.add(i,t),i.setMode(e.mode,t)}#s(){this.#t.textTracks.onaddtrack=null;for(const t of this.#i.textTracks){const e=t[n.native]?.track;e?.oncuechange&&(e.oncuechange=null)}}}function v(s,t){return Array.from(s.children).find(e=>e.track===t)}class y{#t;#i;constructor(t,e){this.#t=t,this.#i=e,new g(t).add("enterpictureinpicture",this.#e.bind(this)).add("leavepictureinpicture",this.#s.bind(this))}get active(){return document.pictureInPictureElement===this.#t}get supported(){return u(this.#t)}async enter(){return this.#t.requestPictureInPicture()}exit(){return document.exitPictureInPicture()}#e(t){this.#n(!0,t)}#s(t){this.#n(!1,t)}#n=(t,e)=>{this.#i.notify("picture-in-picture-change",t,e)}}class M{#t;#i;#e="inline";get mode(){return this.#e}constructor(t,e){this.#t=t,this.#i=e,P(t,"webkitpresentationmodechanged",this.#s.bind(this))}get supported(){return o(this.#t)}async setPresentationMode(t){this.#e!==t&&this.#t.webkitSetPresentationMode(t)}#s(t){const e=this.#e;this.#e=this.#t.webkitPresentationMode,this.#i.player?.dispatch(new f("video-presentation-change",{detail:this.#e,trigger:t})),["fullscreen","picture-in-picture"].forEach(i=>{(this.#e===i||e===i)&&this.#i.notify(`${i}-change`,this.#e===i,t)})}}class w{#t;get active(){return this.#t.mode==="fullscreen"}get supported(){return this.#t.supported}constructor(t){this.#t=t}async enter(){this.#t.setPresentationMode("fullscreen")}async exit(){this.#t.setPresentationMode("inline")}}class E{#t;get active(){return this.#t.mode==="picture-in-picture"}get supported(){return this.#t.supported}constructor(t){this.#t=t}async enter(){this.#t.setPresentationMode("picture-in-picture")}async exit(){this.#t.setPresentationMode("inline")}}class H extends m{$$PROVIDER_TYPE="VIDEO";get type(){return"video"}airPlay;fullscreen;pictureInPicture;constructor(t,e){super(t,e),p(()=>{if(this.airPlay=new x(t,e),o(t)){const i=new M(t,e);this.fullscreen=new w(i),this.pictureInPicture=new E(i)}else u(t)&&(this.pictureInPicture=new y(t,e))},this.scope)}setup(){super.setup(),l(this.video)&&new T(this.video,this.ctx),this.ctx.textRenderers.attachVideo(this.video),h(()=>{this.ctx.textRenderers.attachVideo(null)}),this.type==="video"&&this.ctx.notify("provider-setup",this)}get video(){return this.media}}export{H as VideoProvider};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.