@hanifhan1f/vidstack 1.12.18 → 1.12.24

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.
Files changed (107) hide show
  1. package/cdn/chunks/vidstack-BF7lZRtq.js +3 -0
  2. package/cdn/chunks/vidstack-BYpysj84.js +1 -0
  3. package/cdn/chunks/vidstack-C1FlyyzK.js +1 -0
  4. package/cdn/chunks/vidstack-Cj0I-Rec.js +1 -0
  5. package/cdn/chunks/vidstack-D84Fzc__.js +16 -0
  6. package/cdn/chunks/vidstack-DQvyz7Mm.js +1 -0
  7. package/cdn/chunks/vidstack-Dd9fqVv6.js +1 -0
  8. package/cdn/chunks/vidstack-uMxrPflF.js +1 -0
  9. package/cdn/chunks/vidstack-zemsqC5d.js +1 -0
  10. package/cdn/providers/vidstack-audio-BOGYlExy.js +1 -0
  11. package/cdn/providers/vidstack-dash-D4ZARr66.js +1 -0
  12. package/cdn/providers/vidstack-hls-8-552IuX.js +1 -0
  13. package/cdn/providers/vidstack-html-BvVaN2VT.js +1 -0
  14. package/cdn/providers/vidstack-video-BnwQZKER.js +1 -0
  15. package/cdn/providers/vidstack-vimeo-gJmBqtLK.js +1 -0
  16. package/cdn/providers/vidstack-youtube-Chl_dTAz.js +1 -0
  17. package/cdn/vidstack.js +1 -1
  18. package/cdn/with-layouts/chunks/vidstack-4liSokT6.js +1 -0
  19. package/cdn/with-layouts/chunks/vidstack-B97B8XDc.js +3 -0
  20. package/cdn/with-layouts/chunks/vidstack-BbFHhcVG.js +1 -0
  21. package/cdn/with-layouts/chunks/vidstack-CXEcXyBI.js +1 -0
  22. package/cdn/with-layouts/chunks/vidstack-Ciq-n5rg.js +1 -0
  23. package/cdn/with-layouts/chunks/vidstack-CmuGllcj.js +1 -0
  24. package/cdn/with-layouts/chunks/vidstack-CyNByJUW.js +912 -0
  25. package/cdn/with-layouts/chunks/vidstack-DhNpv7SU.js +1 -0
  26. package/cdn/with-layouts/providers/vidstack-audio-CwoQJvl2.js +1 -0
  27. package/cdn/with-layouts/providers/vidstack-dash-CJsKJfLI.js +1 -0
  28. package/cdn/with-layouts/providers/vidstack-hls-ji26kFdQ.js +1 -0
  29. package/cdn/with-layouts/providers/vidstack-html-BvHMxtoe.js +1 -0
  30. package/cdn/with-layouts/providers/vidstack-video-1Uj5cNP2.js +1 -0
  31. package/cdn/with-layouts/providers/vidstack-vimeo-DACTbJaQ.js +1 -0
  32. package/cdn/with-layouts/providers/vidstack-youtube-RoLp-I6u.js +1 -0
  33. package/cdn/with-layouts/vidstack.js +1 -1
  34. package/dev/chunks/vidstack-0XhA3AD_.js +5181 -0
  35. package/dev/chunks/vidstack-5oWWZmVl.js +58 -0
  36. package/dev/chunks/vidstack-BnBLcaA5.js +115 -0
  37. package/dev/chunks/vidstack-Bo8BNFJ2.js +2986 -0
  38. package/dev/chunks/vidstack-C3N4zIuV.js +254 -0
  39. package/dev/chunks/vidstack-CAL4iu_K.js +1482 -0
  40. package/dev/chunks/vidstack-CGyAjz8G.js +58 -0
  41. package/dev/chunks/vidstack-CJCnHmKE.js +104 -0
  42. package/dev/chunks/vidstack-CzCQJ29U.js +107 -0
  43. package/dev/chunks/vidstack-DD_3HszA.js +1520 -0
  44. package/dev/chunks/vidstack-DV4g4XvL.js +33 -0
  45. package/dev/chunks/vidstack-D_LvMxPr.js +204 -0
  46. package/dev/chunks/vidstack-DdTXMZro.js +66 -0
  47. package/dev/chunks/vidstack-DrczgsqN.js +297 -0
  48. package/dev/chunks/vidstack-gF_qqvCK.js +109 -0
  49. package/dev/define/plyr-layout.js +7 -7
  50. package/dev/define/templates/plyr-layout.js +2 -2
  51. package/dev/define/templates/vidstack-audio-layout.js +3 -3
  52. package/dev/define/templates/vidstack-video-layout.js +7 -9
  53. package/dev/define/vidstack-player-default-layout.js +3 -3
  54. package/dev/define/vidstack-player-layouts.js +3 -3
  55. package/dev/define/vidstack-player-ui.js +9 -9
  56. package/dev/define/vidstack-player.js +5 -5
  57. package/dev/global/plyr.js +9 -9
  58. package/dev/global/vidstack-player.js +6 -6
  59. package/dev/providers/vidstack-audio.js +2 -2
  60. package/dev/providers/vidstack-dash.js +4 -4
  61. package/dev/providers/vidstack-hls.js +4 -4
  62. package/dev/providers/vidstack-html.js +1 -1
  63. package/dev/providers/vidstack-video.js +4 -4
  64. package/dev/providers/vidstack-vimeo.js +4 -4
  65. package/dev/providers/vidstack-youtube.js +3 -3
  66. package/dev/vidstack-elements.js +12 -12
  67. package/dev/vidstack.js +9 -9
  68. package/package.json +1 -1
  69. package/player/styles/default/layouts/video.css +113 -79
  70. package/prod/chunks/vidstack-BAqdCFIm.js +4771 -0
  71. package/prod/chunks/vidstack-BRnfTkxi.js +297 -0
  72. package/prod/chunks/vidstack-BexQYZop.js +2976 -0
  73. package/prod/chunks/vidstack-Bf1Q6kqO.js +109 -0
  74. package/prod/chunks/vidstack-Bn9yLryd.js +58 -0
  75. package/prod/chunks/vidstack-C4PTiuot.js +107 -0
  76. package/prod/chunks/vidstack-DMDDSV3t.js +104 -0
  77. package/prod/chunks/vidstack-Dg71uhRc.js +58 -0
  78. package/prod/chunks/vidstack-DlLwMLBL.js +33 -0
  79. package/prod/chunks/vidstack-KShKSmYu.js +66 -0
  80. package/prod/chunks/vidstack-ShUhyBfI.js +201 -0
  81. package/prod/chunks/vidstack-V9U6gsde.js +1482 -0
  82. package/prod/chunks/vidstack-kdaDngIm.js +1520 -0
  83. package/prod/chunks/vidstack-oNEzlviH.js +246 -0
  84. package/prod/chunks/vidstack-wTTCvdqe.js +115 -0
  85. package/prod/define/plyr-layout.js +7 -7
  86. package/prod/define/templates/plyr-layout.js +2 -2
  87. package/prod/define/templates/vidstack-audio-layout.js +3 -3
  88. package/prod/define/templates/vidstack-video-layout.js +7 -9
  89. package/prod/define/vidstack-player-default-layout.js +3 -3
  90. package/prod/define/vidstack-player-layouts.js +3 -3
  91. package/prod/define/vidstack-player-ui.js +9 -9
  92. package/prod/define/vidstack-player.js +5 -5
  93. package/prod/global/plyr.js +9 -9
  94. package/prod/global/vidstack-player.js +6 -6
  95. package/prod/providers/vidstack-audio.js +2 -2
  96. package/prod/providers/vidstack-dash.js +4 -4
  97. package/prod/providers/vidstack-hls.js +4 -4
  98. package/prod/providers/vidstack-html.js +1 -1
  99. package/prod/providers/vidstack-video.js +4 -4
  100. package/prod/providers/vidstack-vimeo.js +4 -4
  101. package/prod/providers/vidstack-youtube.js +3 -3
  102. package/prod/vidstack-elements.js +12 -12
  103. package/prod/vidstack.js +9 -9
  104. package/server/chunks/vidstack-B2Bc9g7_.js +2000 -0
  105. package/server/define/vidstack-player-default-layout.js +1 -1
  106. package/server/define/vidstack-player-layouts.js +1 -1
  107. package/server/vidstack-elements.js +1 -1
@@ -0,0 +1 @@
1
+ import{a4 as y,s as l,e as c,p as u,i as b,h as d,l as m,a as k}from"../chunks/vidstack-D40FSa5B.js";import{Q as f}from"../chunks/vidstack-DRH_1tFW.js";import{T as o}from"../chunks/vidstack-CioT3Yw2.js";import{a as v}from"../chunks/vidstack-BF7lZRtq.js";import{L as r}from"../chunks/vidstack-C_AxqLKV.js";import{R as w}from"../chunks/vidstack-DfDZuHNP.js";import{p as P}from"../chunks/vidstack-uMxrPflF.js";import{E as T}from"../chunks/vidstack-C1FlyyzK.js";import{resolveVimeoVideoId as g,getVimeoVideoInfo as C}from"../chunks/vidstack-2f5gzOW6.js";import"../chunks/vidstack-DQvyz7Mm.js";const $=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"];class E extends T{$$PROVIDER_TYPE="VIMEO";scope=y();fullscreen;#e;#s=l("");#i=l(!1);#o=null;#c=null;#d=!1;#n=new o(0,0);#u=new w(this.#C.bind(this));#w=null;#r=null;#a=new Map;#l=null;constructor(e,t){super(e),this.#e=t;const s=this;this.fullscreen={get active(){return s.#d},supported:!0,enter:()=>this.#t("requestFullscreen"),exit:()=>this.#t("exitFullscreen")}}cookies=!1;title=!0;byline=!0;portrait=!0;color="00ADEF";get type(){return"vimeo"}get currentSrc(){return this.#c}get videoId(){return this.#s()}get hash(){return this.#o}get isPro(){return this.#i()}preconnect(){P(this.getOrigin())}setup(){super.setup(),c(this.#P.bind(this)),c(this.#T.bind(this)),c(this.#g.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#k(),this.fullscreen=void 0;const e="provider destroyed";for(const t of this.#a.values())for(const{reject:s}of t)s(e);this.#a.clear(),this.#t("destroy")}async play(){return this.#t("play")}async pause(){return this.#t("pause")}setMuted(e){this.#t("setMuted",e)}setCurrentTime(e){this.#t("seekTo",e),this.#e.notify("seeking",e)}setVolume(e){this.#t("setVolume",e),this.#t("setMuted",u(this.#e.$state.muted))}setPlaybackRate(e){this.#t("setPlaybackRate",e)}async loadSource(e){if(!b(e.src)){this.#c=null,this.#o=null,this.#s.set("");return}const{videoId:t,hash:s}=g(e.src);this.#s.set(t??""),this.#o=s??null,this.#c=e}#P(){this.#k();const e=this.#s();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/video/${e}`),this.#e.notify("load-start")}#T(){const e=this.#s();if(!e)return;const t=d(),s=new AbortController;return this.#l=t,C(e,s,this.#o).then(i=>{t.resolve(i)}).catch(i=>{t.reject()}),()=>{t.reject(),s.abort()}}#g(){const e=this.#i(),{$state:t,qualities:s}=this.#e;if(t.canSetPlaybackRate.set(e),s[r.setReadonly](!e),e)return m(s,"change",()=>{if(s.auto)return;const i=s.selected?.id;i&&this.#t("setQuality",i)})}getOrigin(){return"https://player.vimeo.com"}buildParams(){const{keyDisabled:e}=this.#e.$props,{playsInline:t,nativeControls:s}=this.#e.$state,i=s();return{title:this.title,byline:this.byline,color:this.color,portrait:this.portrait,controls:i,h:this.hash,keyboard:i&&!e(),transparent:!0,playsinline:t(),dnt:!this.cookies}}#C(){this.#t("getCurrentTime")}#h=!1;#$(e,t){if(this.#h&&e===0)return;const{realCurrentTime:s,paused:i,bufferedEnd:n,seekableEnd:a,live:h}=this.#e.$state;if(s()===e)return;const p=s();this.#e.notify("time-change",e,t),Math.abs(p-e)>1.5&&(this.#e.notify("seeking",e,t),!i()&&n()<e&&this.#e.notify("waiting",void 0,t)),!h()&&a()-e<.01&&(this.#e.notify("end",void 0,t),this.#h=!0,setTimeout(()=>{this.#h=!1},500))}#E(e,t){this.#e.notify("seeked",e,t)}#V(e){const t=this.#s();this.#l?.promise.then(s=>{if(!s)return;const{title:i,poster:n,duration:a,pro:h}=s;this.#i.set(h),this.#e.notify("title-change",i,e),this.#e.notify("poster-change",n,e),this.#e.notify("duration-change",a,e),this.#f(a,e)}).catch(()=>{t===this.#s()&&(this.#t("getVideoTitle"),this.#t("getDuration"))})}#f(e,t){const{nativeControls:s}=this.#e.$state,i=s();this.#n=new o(0,e);const n={buffered:new o(0,0),seekable:this.#n,duration:e};this.#e.delegate.ready(n,t),i||this.#t("_hideOverlay"),this.#t("getQualities"),this.#t("getChapters")}#I(e,t,s){switch(e){case"getVideoTitle":const i=t;this.#e.notify("title-change",i,s);break;case"getDuration":const n=t;this.#e.$state.canPlay()?this.#e.notify("duration-change",n,s):this.#f(n,s);break;case"getCurrentTime":this.#$(t,s);break;case"getBuffered":k(t)&&t.length&&this.#p(t[t.length-1][1],s);break;case"setMuted":case"getMuted":this.#y(u(this.#e.$state.volume),t,s);break;case"getChapters":this.#L(t);break;case"getQualities":this.#F(t,s);break}this.#v(e)?.resolve()}#R(){for(const e of $)this.#t("addEventListener",e)}#M(e){this.#u.stop(),this.#e.notify("pause",void 0,e)}async#A(e){this.#u.start(),await this.#t("getMuted"),this.#e.notify("play",void 0,e)}#S(e){const{paused:t}=this.#e.$state;!t()&&!this.#h&&this.#e.notify("playing",void 0,e)}#p(e,t){const s={buffered:new o(0,e),seekable:this.#n};this.#e.notify("progress",s,t)}#q(e){this.#e.notify("waiting",void 0,e)}#x(e){const{paused:t}=this.#e.$state;t()||this.#e.notify("playing",void 0,e)}async#Q(e){const{paused:t}=this.#e.$state;t()&&(await this.#t("getMuted"),this.#e.notify("play",void 0,e)),this.#e.notify("waiting",void 0,e)}#y(e,t,s){const i={volume:e,muted:t};this.#e.notify("volume-change",i,s)}#L(e){if(this.#b(),!e.length)return;const t=new v({kind:"chapters",default:!0}),{seekableEnd:s}=this.#e.$state;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];t.addCue(new window.VTTCue(n.startTime,a?.startTime??s(),n.title))}this.#r=t,this.#e.textTracks.add(t)}#b(){this.#r&&(this.#e.textTracks.remove(this.#r),this.#r=null)}#F(e,t){this.#e.qualities[f.enableAuto]=e.some(s=>s.id==="auto")?()=>this.#t("setQuality","auto"):void 0;for(const s of e){if(s.id==="auto")continue;const i=+s.id.slice(0,-1);isNaN(i)||this.#e.qualities[r.add]({id:s.id,width:i*(16/9),height:i,codec:"avc1,h.264",bitrate:-1},t)}this.#m(e.find(s=>s.active),t)}#m({id:e}={},t){if(!e)return;const s=e==="auto",i=this.#e.qualities.getById(e);s?(this.#e.qualities[f.setAuto](s,t),this.#e.qualities[r.select](void 0,!0,t)):this.#e.qualities[r.select](i??void 0,!0,t)}#O(e,t,s){switch(e){case"ready":this.#R();break;case"loaded":this.#V(s);break;case"play":this.#A(s);break;case"playProgress":this.#S(s);break;case"pause":this.#M(s);break;case"loadProgress":this.#p(t.seconds,s);break;case"waiting":this.#Q(s);break;case"bufferstart":this.#q(s);break;case"bufferend":this.#x(s);break;case"volumechange":this.#y(t.volume,u(this.#e.$state.muted),s);break;case"durationchange":this.#n=new o(0,t.duration),this.#e.notify("duration-change",t.duration,s);break;case"playbackratechange":this.#e.notify("rate-change",t.playbackRate,s);break;case"qualitychange":this.#m(t,s);break;case"fullscreenchange":this.#d=t.fullscreen,this.#e.notify("fullscreen-change",t.fullscreen,s);break;case"enterpictureinpicture":this.#e.notify("picture-in-picture-change",!0,s);break;case"leavepictureinpicture":this.#e.notify("picture-in-picture-change",!1,s);break;case"ended":this.#e.notify("end",void 0,s);break;case"error":this.#D(t,s);break;case"seek":case"seeked":this.#E(t.seconds,s);break}}#D(e,t){const{message:s,method:i}=e;i==="setPlaybackRate"&&this.#i.set(!1),i&&this.#v(i)?.reject(s)}onMessage(e,t){e.event?this.#O(e.event,e.data,t):e.method&&this.#I(e.method,e.value,t)}onLoad(){}async#t(e,t){let s=d(),i=this.#a.get(e);return i||this.#a.set(e,i=[]),i.push(s),this.postMessage({method:e,value:t}),s.promise}#k(){this.#u.stop(),this.#n=new o(0,0),this.#l=null,this.#w=null,this.#i.set(!1),this.#b()}#v(e){return this.#a.get(e)?.shift()}}export{E as VimeoProvider};
@@ -0,0 +1 @@
1
+ import{a4 as p,s as y,e as m,i as f,h as g,a5 as b,F as d,$ as k}from"../chunks/vidstack-D40FSa5B.js";import{T as u}from"../chunks/vidstack-CioT3Yw2.js";import{p as v}from"../chunks/vidstack-uMxrPflF.js";import{E as P}from"../chunks/vidstack-C1FlyyzK.js";import{resolveYouTubeVideoId as w}from"../chunks/vidstack-DiNS2Vx5.js";import"../chunks/vidstack-DQvyz7Mm.js";const r={Ended:0,Playing:1,Paused:2,Buffering:3,Cued:5};class T extends P{$$PROVIDER_TYPE="YOUTUBE";scope=p();#e;#a=y("");#o=-1;#d=null;#r=-1;#i=!1;#s=new Map;constructor(e,t){super(e),this.#e=t}language="en";color="red";cookies=!1;get currentSrc(){return this.#d}get type(){return"youtube"}get videoId(){return this.#a()}preconnect(){v(this.getOrigin())}setup(){super.setup(),m(this.#c.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#l();const e="provider destroyed";for(const t of this.#s.values())for(const{reject:s}of t)s(e);this.#s.clear()}async play(){return this.#t("playVideo")}#k(e){this.#n("playVideo")?.reject(e)}async pause(){return this.#t("pauseVideo")}#v(e){this.#n("pauseVideo")?.reject(e)}setMuted(e){e?this.#t("mute"):this.#t("unMute")}setCurrentTime(e){this.#t("seekTo",[e,!0]),this.#e.notify("seeking",e)}setVolume(e){this.#t("setVolume",e*100)}setPlaybackRate(e){this.#t("setPlaybackRate",e)}async loadSource(e){if(!f(e.src)){this.#d=null,this.#a.set("");return}const t=w(e.src);this.#a.set(t??""),this.#d=e}getOrigin(){return this.cookies?"https://www.youtube.com":"https://www.youtube-nocookie.com"}#c(){this.#l();const e=this.#a();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/embed/${e}`),this.#e.notify("load-start")}buildParams(){const{keyDisabled:e}=this.#e.$props,{muted:t,playsInline:s,nativeControls:a}=this.#e.$state,i=a();return{rel:0,autoplay:0,cc_lang_pref:this.language,cc_load_policy:i?1:void 0,color:this.color,controls:i?1:0,disablekb:!i||e()?1:0,enablejsapi:1,fs:1,hl:this.language,iv_load_policy:i?1:3,mute:t()?1:0,playsinline:s()?1:0}}#t(e,t){let s=g(),a=this.#s.get(e);a||this.#s.set(e,a=[]),a.push(s);const i=Array.isArray(t)?t:t?[t]:void 0;return this.postMessage({event:"command",func:e,args:i}),s.promise}onLoad(){window.setTimeout(()=>this.postMessage({event:"listening"}),100)}#p(e){this.#e.notify("loaded-metadata"),this.#e.notify("loaded-data"),this.#e.delegate.ready(void 0,e)}#y(e){this.#n("pauseVideo")?.resolve(),this.#e.notify("pause",void 0,e)}#m(e,t){const{duration:s,realCurrentTime:a}=this.#e.$state,i=this.#o===r.Ended,o=i?s():e;this.#e.notify("time-change",o,t),!i&&Math.abs(o-a())>1&&this.#e.notify("seeking",o,t)}#u(e,t,s){const a={buffered:new u(0,e),seekable:t};this.#e.notify("progress",a,s);const{seeking:i,realCurrentTime:o}=this.#e.$state;i()&&e>o()&&this.#h(s)}#h(e){const{paused:t,realCurrentTime:s}=this.#e.$state;window.clearTimeout(this.#r),this.#r=window.setTimeout(()=>{this.#e.notify("seeked",s(),e),this.#r=-1},t()?100:0)}#f(e){const{seeking:t}=this.#e.$state;t()&&this.#h(e),this.#e.notify("pause",void 0,e),this.#e.notify("end",void 0,e)}#g(e,t){const{paused:s,seeking:a}=this.#e.$state,i=e===r.Playing,o=e===r.Buffering,n=this.#b("playVideo"),h=s()&&(o||i);if(o&&this.#e.notify("waiting",void 0,t),a()&&i&&this.#h(t),this.#i&&i){this.pause(),this.#i=!1,this.setMuted(this.#e.$state.muted());return}if(!n&&h){this.#i=!0,this.setMuted(!0);return}switch(h&&(this.#n("playVideo")?.resolve(),this.#e.notify("play",void 0,t)),e){case r.Cued:this.#p(t);break;case r.Playing:this.#e.notify("playing",void 0,t);break;case r.Paused:this.#y(t);break;case r.Ended:this.#f(t);break}this.#o=e}onMessage({info:e},t){if(!e)return;const{title:s,intrinsicDuration:a,playbackRate:i}=this.#e.$state;if(b(e.videoData)&&e.videoData.title!==s()&&this.#e.notify("title-change",e.videoData.title,t),d(e.duration)&&e.duration!==a()){if(d(e.videoLoadedFraction)){const o=e.progressState?.loaded??e.videoLoadedFraction*e.duration,n=new u(0,e.duration);this.#u(o,n,t)}this.#e.notify("duration-change",e.duration,t)}if(d(e.playbackRate)&&e.playbackRate!==i()&&this.#e.notify("rate-change",e.playbackRate,t),e.progressState){const{current:o,seekableStart:n,seekableEnd:h,loaded:c,duration:l}=e.progressState;this.#m(o,t),this.#u(c,new u(n,h),t),l!==a()&&this.#e.notify("duration-change",l,t)}if(d(e.volume)&&k(e.muted)&&!this.#i){const o={muted:e.muted,volume:e.volume/100};this.#e.notify("volume-change",o,t)}d(e.playerState)&&e.playerState!==this.#o&&this.#g(e.playerState,t)}#l(){this.#o=-1,this.#r=-1,this.#i=!1}#n(e){return this.#s.get(e)?.shift()}#b(e){return!!this.#s.get(e)?.length}}export{T as YouTubeProvider};
package/cdn/vidstack.js CHANGED
@@ -1 +1 @@
1
- import"./chunks/vidstack-CmpbA3Yd.js";import"https://cdn.vidstack.io/icons";import"./chunks/vidstack-D40FSa5B.js";import"./chunks/vidstack-DD2JwFVU.js";import"./chunks/vidstack-CioT3Yw2.js";import"./chunks/vidstack-C0msPRTd.js";import"./chunks/vidstack-D0M8R0ZU.js";import"./chunks/vidstack-C_AxqLKV.js";import"./chunks/vidstack-DRH_1tFW.js";import"./chunks/vidstack-BfBBPhXV.js";import"./chunks/vidstack-xjJ-ui_l.js";
1
+ import"./chunks/vidstack-D84Fzc__.js";import"https://cdn.vidstack.io/icons";import"./chunks/vidstack-D40FSa5B.js";import"./chunks/vidstack-DQvyz7Mm.js";import"./chunks/vidstack-CioT3Yw2.js";import"./chunks/vidstack-BF7lZRtq.js";import"./chunks/vidstack-uMxrPflF.js";import"./chunks/vidstack-C_AxqLKV.js";import"./chunks/vidstack-DRH_1tFW.js";import"./chunks/vidstack-BfBBPhXV.js";import"./chunks/vidstack-BYpysj84.js";
@@ -0,0 +1 @@
1
+ import{a as n,b as l,d as c}from"./vidstack-DhNpv7SU.js";import{l as p}from"./vidstack-BbFHhcVG.js";import{a as g,b as d,i,d as h,e as m,f as y,c as C,j as f}from"./vidstack-C5AP9wid.js";import{p as w}from"./vidstack-DLVdcWrK.js";class E{name="google-cast";target;#e;get cast(){return g()}mediaType(){return"video"}canPlay(e){return n&&!l&&c(e)}async prompt(e){let t,a,r;try{t=await this.#r(e),this.#e||(this.#e=new cast.framework.RemotePlayer,new cast.framework.RemotePlayerController(this.#e)),a=e.player.createEvent("google-cast-prompt-open",{trigger:t}),e.player.dispatchEvent(a),this.#t(e,"connecting",a),await this.#o(w(e.$props.googleCast)),e.$state.remotePlaybackInfo.set({deviceName:d()?.getCastDevice().friendlyName}),i()&&this.#t(e,"connected",a)}catch(o){const s=o instanceof Error?o:this.#a((o+"").toUpperCase(),"Prompt failed.");throw r=e.player.createEvent("google-cast-prompt-error",{detail:s,trigger:a??t,cancelable:!0}),e.player.dispatch(r),this.#t(e,i()?"connected":"disconnected",r),s}finally{e.player.dispatch("google-cast-prompt-close",{trigger:r??a??t})}}async load(e){if(!this.#e)throw Error("[vidstack] google cast player was not initialized");return new(await import("../providers/vidstack-google-cast-BSYJYn-o.js")).GoogleCastProvider(this.#e,e)}async#r(e){if(h())return;const t=e.player.createEvent("google-cast-load-start");e.player.dispatch(t),await p(m()),await customElements.whenDefined("google-cast-launcher");const a=e.player.createEvent("google-cast-loaded",{trigger:t});if(e.player.dispatch(a),!y())throw this.#a("CAST_NOT_AVAILABLE","Google Cast not available on this platform.");return a}async#o(e){this.#s(e);const t=await this.cast.requestSession();if(t)throw this.#a(t.toUpperCase(),C(t))}#s(e){this.cast?.setOptions({...f(),...e})}#t(e,t,a){const r={type:"google-cast",state:t};e.notify("remote-playback-change",r,a)}#a(e,t){const a=Error(t);return a.code=e,a}}export{E as GoogleCastLoader};
@@ -0,0 +1,3 @@
1
+ import{l,n as m,i as u,q as C,d as S,D as c,a as p,I as g}from"./vidstack-DLVdcWrK.js";import{g as T}from"./vidstack-BbFHhcVG.js";const b=Symbol(0),E=Symbol(0),A=Symbol(0),w=Symbol(0),O=Symbol(0),x=Symbol(0),N=Symbol(0),a={crossOrigin:b,readyState:E,updateActiveCues:A,canLoad:w,onModeChange:O,native:x,nativeHLS:N};function f(h,t){return t>=h.startTime&&t<h.endTime}function v(h,t,s){let e=null,i=C();function n(){const r=u(t)?[t]:t,o=h.toArray().find(d=>r.includes(d.kind)&&d.mode==="showing");if(o!==e){if(!o){s(null),e=null;return}o.readyState==2?s(o):(s(null),m(()=>{const d=l(o,"load",()=>{s(o),d()},{once:!0})},i)),e=o}}return n(),l(h,"mode-change",n)}function k(h,t,s){v(h,t,e=>{if(!e){s("");return}const i=()=>{const n=e?.activeCues[0];s(n?.text||"")};i(),l(e,"cue-change",i)})}class I extends S{static createId(t){return`vds-${t.type}-${t.kind}-${t.src??t.label??"?"}`}src;content;type;encoding;id="";label="";language="";kind;default=!1;#h=!1;#e=0;#i="disabled";#o={};#n=[];#t=[];#s=[];#r=new Set;[a.readyState]=0;[a.crossOrigin];[a.onModeChange]=null;[a.native]=null;get metadata(){return this.#o}get regions(){return this.#n}get cues(){return this.#t}get activeCues(){return this.#s}get readyState(){return this[a.readyState]}get mode(){return this.#i}set mode(t){this.setMode(t)}constructor(t){super();for(const s of Object.keys(t))this[s]=t[s];this.type||(this.type="vtt"),t.content?this.#f(t):t.src||(this[a.readyState]=2)}addCue(t,s){if(t.id){if(this.#r.has(t.id))return;this.#r.add(t.id)}let e=0,i=this.#t.length;for(e=0;e<i&&!(t.endTime<=this.#t[e].startTime);e++);e===i?this.#t.push(t):this.#t.splice(e,0,t),t instanceof TextTrackCue||this[a.native]?.track.addCue(t),this.dispatchEvent(new c("add-cue",{detail:t,trigger:s})),f(t,this.#e)&&this[a.updateActiveCues](this.#e,s)}removeCue(t,s){const e=this.#t.indexOf(t);if(e>=0){const i=this.#s.includes(t);t.id&&this.#r.delete(t.id),this.#t.splice(e,1),this[a.native]?.track.removeCue(t),this.dispatchEvent(new c("remove-cue",{detail:t,trigger:s})),i&&this[a.updateActiveCues](this.#e,s)}}setMode(t,s){this.#i!==t&&(this.#i=t,t==="disabled"?(this.#s=[],this.#u()):this.readyState===2?this[a.updateActiveCues](this.#e,s):this.#c(),this.dispatchEvent(new c("mode-change",{detail:this,trigger:s})),this[a.onModeChange]?.())}[a.updateActiveCues](t,s){if(this.#e=t,this.mode==="disabled"||!this.#t.length)return;const e=[];for(let n=0,r=this.#t.length;n<r;n++){const o=this.#t[n];f(o,t)&&e.push(o)}let i=e.length!==this.#s.length;if(!i){for(let n=0;n<e.length;n++)if(!this.#s.includes(e[n])){i=!0;break}}this.#s=e,i&&this.#u(s)}[a.canLoad](){this.#h=!0,this.#i!=="disabled"&&this.#c()}#f(t){import("https://cdn.jsdelivr.net/npm/media-captions@next/dist/prod.js").then(({parseText:s,VTTCue:e,VTTRegion:i})=>{if(!u(t.content)||t.type==="json")this.#l(t.content,e,i),this.readyState!==3&&this.#a();else{const n=t.content.split(`
2
+ `).map(r=>r.trim()).join(`
3
+ `).trim();s(n,{type:t.type}).then(({cues:r,regions:o})=>{this.#t=r,this.#n=o,this.#a()})}})}async#c(){if(!(!this.#h||this[a.readyState]>0)){if(this[a.readyState]=1,this.dispatchEvent(new c("load-start")),!this.src){this.#a();return}try{const{parseResponse:t,VTTCue:s,VTTRegion:e}=await import("https://cdn.jsdelivr.net/npm/media-captions@next/dist/prod.js"),i=this[a.crossOrigin]?.(),n=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:T(i)});if(this.type==="json")this.#l(await(await n).text(),s,e);else{const{errors:r,metadata:o,regions:d,cues:y}=await t(n,{type:this.type,encoding:this.encoding});if(r[0]?.code===0)throw r[0];this.#o=o,this.#n=d,this.#t=y}this.#a()}catch(t){this.#d(t)}}}#a(){if(this[a.readyState]=2,!this.src||this.type!=="vtt"){const s=this[a.native];if(s&&!s.managed)for(const e of this.#t)s.track.addCue(e)}const t=new c("load");this[a.updateActiveCues](this.#e,t),this.dispatchEvent(t)}#d(t){this[a.readyState]=3,this.dispatchEvent(new c("error",{detail:t}))}#l(t,s,e){try{const{regions:i,cues:n}=j(t,s,e);this.#n=i,this.#t=n}catch(i){this.#d(i)}}#u(t){this.dispatchEvent(new c("cue-change",{trigger:t}))}}const M=/captions|subtitles/;function _(h){return M.test(h.kind)}function j(h,t,s){const e=u(h)?JSON.parse(h):h;let i=[],n=[];return e.regions&&s&&(i=e.regions.map(r=>Object.assign(new s,r))),(e.cues||p(e))&&(n=(p(e)?e:e.cues).filter(r=>g(r.startTime)&&g(r.endTime)).map(r=>Object.assign(new t(0,0,""),r))),{regions:i,cues:n}}export{a as T,I as a,k as b,f as c,_ as i,v as w};
@@ -0,0 +1 @@
1
+ import{aa as o,i as s,h as c,W as u}from"./vidstack-DLVdcWrK.js";import{i as a,g as m}from"./vidstack-DhNpv7SU.js";function l(e,r){const t=new URL(e);for(const n of Object.keys(r))t.searchParams.set(n,r[n]+"");return t.toString()}function p(e,r="preconnect"){const t=document.querySelector(`link[href="${e}"]`);if(!o(t))return!0;const n=document.createElement("link");return n.rel=r,n.href=e,n.crossOrigin="true",document.head.append(n),!0}const i={};function f(e){if(i[e])return i[e].promise;const r=c(),t=document.querySelector(`script[src="${e}"]`);if(!o(t))return r.resolve(),r.promise;i[e]=r;const n=document.createElement("script");return n.src=e,n.onload=()=>{r.resolve(),delete i[e]},n.onerror=()=>{r.reject(),delete i[e]},setTimeout(()=>document.head.append(n),0),r.promise}function d(e){return e==="use-credentials"?"include":s(e)?"same-origin":void 0}function g({title:e,src:r,download:t}){const n=u(t)||t===""?r.src:s(t)?t:t?.url;return S({url:n,src:r,download:t})?{url:n,name:!u(t)&&!s(t)&&t?.filename||e.toLowerCase()||"media"}:null}function S({url:e,src:r,download:t}){return s(e)&&(t&&t!==!0||a(r)||m(r))}export{g as a,l as b,d as g,f as l,p};
@@ -0,0 +1 @@
1
+ import{s as e,l as r,e as a,p as o,i as n}from"./vidstack-DLVdcWrK.js";import{b as c}from"./vidstack-BbFHhcVG.js";class h{#t;src=e("");referrerPolicy=null;get iframe(){return this.#t}constructor(t){this.#t=t,t.setAttribute("frameBorder","0"),t.setAttribute("aria-hidden","true"),t.setAttribute("allow","autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"),this.referrerPolicy!==null&&t.setAttribute("referrerpolicy",this.referrerPolicy)}setup(){r(window,"message",this.#i.bind(this)),r(this.#t,"load",this.onLoad.bind(this)),a(this.#s.bind(this))}#s(){const t=this.src();if(!t.length){this.#t.setAttribute("src","");return}const s=o(()=>this.buildParams());this.#t.setAttribute("src",c(t,s))}postMessage(t,s){this.#t.contentWindow?.postMessage(JSON.stringify(t),s??"*")}#i(t){const s=this.getOrigin();if((t.source===null||t.source===this.#t?.contentWindow)&&(!n(s)||s===t.origin)){try{const i=JSON.parse(t.data);i&&this.onMessage(i,t);return}catch{}t.data&&this.onMessage(t.data,t)}}}export{h as E};
@@ -0,0 +1 @@
1
+ import{ao as m,e as c}from"./vidstack-DLVdcWrK.js";import{c as p,a as r}from"./vidstack-CyNByJUW.js";import"./vidstack-DhNpv7SU.js";import"./vidstack-CS2aNc61.js";import"./vidstack-B97B8XDc.js";import"./vidstack-BbFHhcVG.js";import"./vidstack-C_AxqLKV.js";import"./vidstack-DRH_1tFW.js";import"./vidstack-BfBBPhXV.js";import"./vidstack-Bxv1Qnxe.js";import"https://cdn.vidstack.io/icons";const d=r('<svg viewBox="0 0 32 32" fill="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"></svg>');function l(o,s){const n=p(d);n.innerHTML=m,o.append(n);const e=document.createElement("span");e.classList.add("vds-google-cast-info"),o.append(e);const t=document.createElement("span");t.classList.add("vds-google-cast-device-name"),c(()=>{const{remotePlaybackInfo:i}=s,a=i();return a?.deviceName&&(t.textContent=a.deviceName,e.append("Google Cast on ",t)),()=>{e.textContent=""}})}export{l as insertContent};
@@ -0,0 +1 @@
1
+ import{s as a,e as o,l as n,E as h}from"./vidstack-DLVdcWrK.js";import"./vidstack-DhNpv7SU.js";class c{#t;#s;#i;#e=a(!1);get supported(){return this.#e()}constructor(e,t){this.#t=e,this.#s=t,this.#r()}#r(){!this.#t?.remote||!this.canPrompt||(this.#t.remote.watchAvailability(e=>{this.#e.set(e)}).catch(()=>{this.#e.set(!1)}),o(this.#a.bind(this)))}#a(){if(!this.#e())return;const e=["connecting","connect","disconnect"],t=this.#o.bind(this);t(),n(this.#t,"playing",t);const s=new h(this.#t.remote);for(const r of e)s.add(r,t)}async prompt(){if(!this.supported)throw Error("Not supported on this platform.");return this.type==="airplay"&&this.#t.webkitShowPlaybackTargetPicker?this.#t.webkitShowPlaybackTargetPicker():this.#t.remote.prompt()}#o(e){const t=this.#t.remote.state;if(t===this.#i)return;const s={type:this.type,state:t};this.#s.notify("remote-playback-change",s,e),this.#i=t}}class p extends c{type="airplay";get canPrompt(){return"WebKitPlaybackTargetAvailabilityEvent"in window}}export{p as H};