https://www.ribevikingecenter.dk/dist/assets/VueTube.vue_vue_type_script_setup_true_lang-D3_AiZo3.js
1import{d as P,k as h,o as b,c as k,r as i}from"./app-B5_m4LVx.js";const Y=["id"],I=P({__name:"VueTube",props:{youtubeId:{},startTime:{},loop:{type:Boolean},loopTime:{},isMuted:{type:Boolean,default:!0}},emits:["ready","playing","paused","ended","stateChange","error","apiChange","buffering","cued"],setup(d,{expose:c,emit:p}){const t=d,a=i(null),l=i(""),r=i(!1),n=i(!1),o=p;function f(){a.value=new YT.Player(l.value,{width:600,height:400,videoId:t.youtubeId,playerVars:{disablekb:1,enablejsapi:1,modestbranding:1,playsinline:1,controls:0,mute:t.isMuted?1:0,fs:0,iv_load_policy:3,cc_load_policy:1,cc_lang_pref:"en",loop:1,start:0,autohide:1,rel:0,origin:"http://localhost/"},events:{onReady:y,onStateChange:T}})}function y(e){r.value=!0,n.value&&u(),o("ready",e.target)}function T(e){switch(e.data){case window.YT.PlayerState.PLAYING:o("playing",e.target),t.loop&&t.loopTime&&setTimeout(g,t.loopTime*1e3);break;case window.YT.PlayerState.PAUSED:o("paused",e.target);break;case window.YT.PlayerState.ENDED:o("ended",e.target);break;case window.YT.PlayerState.UNSTARTED:o("ended",e.target);break;case window.YT.PlayerState.BUFFERING:o("buffering",e.target);break;case window.YT.PlayerState.CUED:o("cued",e.target);break}o("stateChange",e.data)}function g(){!r.value||a.value?.getPlayerState()!=window.YT.PlayerState.PLAYING||(t.startTime?a.value.seekTo(t.startTime,!0):a.value.seekTo(0,!0))}function u(){n.value=!0,r.value&&(t.startTime&&a.value?.seekTo(t.startTime,!0),a.value?.playVideo())}function m(){n.value=!1,r.value&&a.value?.pauseVideo()}function w(){n.value=!1,r.value&&a.value?.stopVideo()}function v(e){!r.value||a.value?.getPlayerState()!=window.YT.PlayerState.PLAYING||a.value.seekTo(a.value.getCurrentTime()+e,!0)}function s(){return window.YT&&window.YT.Player?Promise.resolve():new Promise(e=>{setTimeout(()=>{s().then(()=>{e()})},100)})}return h(()=>{l.value=Math.random().toString(36).substring(2,12),s().then(()=>{f()})}),c({playVideo:u,stopVideo:w,pauseVideo:m,seekTo:v}),(e,S)=>(b(),k("div",{id:l.value},null,8,Y))}});export{I as _};
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.