@ktt45678/vidstack
Version:
UI component library for building high-quality, accessible video and audio experiences on the web.
2 lines (1 loc) • 990 B
JavaScript
import{s as r,e as h,l as s}from"./vidstack-B1PqmCkk.js";import"./vidstack-BC0sXP__.js";class o{constructor(e,t){this.a=e,this.b=t,this.pb=r(!1),this.he()}get supported(){return this.pb()}he(){!this.a?.remote||!this.kg||(this.a.remote.watchAvailability(e=>{this.pb.set(e)}).catch(()=>{this.pb.set(!1)}),h(this.Fi.bind(this)))}Fi(){if(!this.pb())return;const e=["connecting","connect","disconnect"],t=this.ie.bind(this);t(),s(this.a,"playing",t);for(const i of e)s(this.a.remote,i,t)}async prompt(){if(!this.supported)throw Error("Not supported on this platform.");return this.la==="airplay"&&this.a.webkitShowPlaybackTargetPicker?this.a.webkitShowPlaybackTargetPicker():this.a.remote.prompt()}ie(e){const t=this.a.remote.state;if(t===this.za)return;const i={type:this.la,state:t};this.b.delegate.c("remote-playback-change",i,e),this.za=t}}class n extends o{constructor(){super(...arguments),this.la="airplay"}get kg(){return"WebKitPlaybackTargetAvailabilityEvent"in window}}export{n as H};