import{r as i,h as t,F as e,H as s}from"./p-811c9fd4.js";import{P as n}from"./p-7afe5dc8.js";const r="https://media.vimejs.com",o=class{constructor(t){i(this,t),this.provider=n.Audio,this.showCustomUI=!1,this.theme="dark",this.poster=r+"/poster.png"}buildProviderChildren(){var i;const s={[n.Audio]:"audio/mp3",[n.Video]:"video/mp4",[n.HLS]:"application/x-mpegURL"};return t(e,null,t("source",{"data-src":null!==(i=this.src)&&void 0!==i?i:this.src={[n.Audio]:r+"/audio.mp3",[n.Video]:r+"/720p.mp4",[n.HLS]:r+"/hls/index.m3u8"}[this.provider],type:s[this.provider]}),this.provider!==n.HLS&&t(e,null,t("track",{default:!0,kind:"subtitles",src:r+"/subs/english.vtt",srclang:"en",label:"English"}),t("track",{kind:"subtitles",src:r+"/subs/spanish.vtt",srclang:"es",label:"Spanish"})))}buildProvider(){var i,e,s,o;switch(this.provider){case n.Audio:return t("vime-audio",{crossOrigin:""},this.buildProviderChildren());case n.Video:return t("vime-video",{crossOrigin:"",poster:this.poster},this.buildProviderChildren());case n.HLS:return t("vime-hls",{crossOrigin:"",poster:this.poster},this.buildProviderChildren());case n.Dash:return t("vime-dash",{crossOrigin:"",poster:this.poster,src:null!==(i=this.src)&&void 0!==i?i:this.src=r+"/mpd/manifest.mpd"});case n.YouTube:return t("vime-youtube",{videoId:null!==(e=this.src)&&void 0!==e?e:this.src="DyTCOwB0DVw"});case n.Vimeo:return t("vime-vimeo",{videoId:null!==(s=this.src)&&void 0!==s?s:this.src="411652396"});case n.Dailymotion:return t("vime-dailymotion",{videoId:null!==(o=this.src)&&void 0!==o?o:this.src="k3b11PemcuTrmWvYe0q"});default:return}}changeProvider(i){this.src=void 0,this.provider=i}onCustomUiChange(i){this.showCustomUI=i.target.checked}onThemeChange(i){this.theme=i.target.checked?"light":"dark"}onSrcChange(i){this.src=i.target.value}render(){const i=Object.values(n).filter((i=>"faketube"!==i)).map((i=>t("button",{id:"audio",type:"button",onClick:()=>this.changeProvider(i)},i)));return t(s,null,t("div",{class:"container"},t("vime-player",{controls:!this.showCustomUI,theme:this.theme},this.buildProvider(),this.showCustomUI&&t("vime-default-ui",null))),t("div",{class:"buttons"},i),t("div",{class:"inputs"},t("label",{htmlFor:"src"},"Src"),t("input",{type:"text",id:"src",value:this.src,onChange:this.onSrcChange.bind(this)}),t("label",{htmlFor:"poster"},"Poster"),t("input",{type:"text",id:"poster",value:this.poster,readonly:!0}),t("div",{class:"checkboxes"},t("label",{htmlFor:"ui"},"Custom UI"),t("input",{type:"checkbox",id:"ui",checked:this.showCustomUI,onChange:this.onCustomUiChange.bind(this)}),t("label",{htmlFor:"theme"},"Light Theme"),t("input",{type:"checkbox",id:"theme",checked:"light"===this.theme,onChange:this.onThemeChange.bind(this)}))))}};o.style="vime-playground{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column}vime-playground .container{width:100%;max-width:960px}vime-playground .buttons,vime-playground .checkboxes{margin-top:24px}vime-playground .buttons>*,vime-playground .checkboxes>*{margin-left:8px}vime-playground .buttons>*:first-child,vime-playground .checkboxes>*:first-child{margin-left:0px}vime-playground .inputs{width:100%;max-width:480px;display:flex;flex-direction:column;margin-top:12px}vime-playground .inputs>input[readonly]{background-color:#f0f0f0}vime-playground .inputs>label{margin-top:16px;margin-bottom:8px}";export{o as vime_playground}