import{d as a,c as o,L as n,q as p}from"./index.27735e87.js";/* empty css             */import{T as l}from"./tcplayer.v4.8.0.min.144c5b72.js";/* empty css                 */const d="_video_1jgvo_1",y="_loadingVideo_1jgvo_54",u="_playOver_1jgvo_63",h="_tips_1jgvo_71",c="_btn_1jgvo_75",g="_replay_1jgvo_82",v="_freeTxt_1jgvo_85",f="_freeRate_1jgvo_91";var s={"video-container":"_video-container_1jgvo_1",video:d,loadingVideo:y,playOver:u,tips:h,btn:c,replay:g,freeTxt:v,freeRate:f},j=a({name:"o-video",props:{setting:{type:Object,default:()=>{}},controls:{type:Boolean,default:!0},height:String,src:{type:String,default:""},poster:{type:String,default:""},styleValue:{type:Object,default:()=>({})},preload:{type:String,default:"auto"},currentTime:{type:Boolean,default:!0},playsinline:{type:Boolean,default:!0},onPlay:{type:Function,default:()=>{}}},emits:["exitfullscreen"],data(){return{videoID:"video"+Date.now()+Math.floor(Math.random()*100),player:null,loading:!0}},mounted(){this._init()},methods:{_init(){const i=l.getComponent("Button"),e=l.getComponent("BigPlayButton");e.prototype.createEl=function(){const t=i.prototype.createEl.call(this),r='<button><svg width="41px"height="41px"viewBox="0 0 41 41"version="1.1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke="none"stroke-width="1"fill="none"fill-rule="evenodd"><g transform="translate(-167.000000, -155.000000)"><g transform="translate(0.000000, 85.000000)"><g transform="translate(158.000000, 70.000000)"><g transform="translate(9.000000, 0.000000)"><circle id="\u692D\u5706\u5F62"stroke="#FFFFFF"fill-opacity="0.1"fill="#D8D8D8"cx="20.5"cy="20.5"r="20"></circle><path d="M14.5483871,27.6859997 L14.5483871,13.4342349 C14.5480523,12.8729571 14.8729597,12.356555 15.3949624,12.0887034 C15.9169651,11.8208518 16.5522696,11.8445472 17.0503046,12.1504437 L28.6530473,19.2778563 C29.1119763,19.5602271 29.3887725,20.0426422 29.3887725,20.5601173 C29.3887725,21.0775924 29.1119763,21.5600075 28.6530473,21.8423783 L17.0503046,28.9697909 C16.5522696,29.2756874 15.9169651,29.2993828 15.3949624,29.0315312 C14.8729597,28.7636796 14.5480523,28.2472775 14.5483871,27.6859997 Z"id="\u8DEF\u5F84"fill="#FFFFFF"fill-rule="nonzero"></path></g></g></g></g></g></svg></button>';return t.appendChild(l.dom.createEl("div",{className:"vjs-button-icon",innerHTML:r})),t},this.player=l(this.videoID,{appID:"",controls:this.controls}),this.player&&(this.player.src(this.src),this.player.poster(this.poster||""),this.preload==="none"&&(this.loading=!1),this.player.on("loadstart",()=>{this.loading=!1,this.domPlayVisibility(!1)}),this.player.on("play",()=>{this.onPlay&&this.onPlay(this.player)}))},domPlayVisibility(i=!0){const e=document.querySelector(".vjs-big-play-button"),t=document.querySelector(".vjs-control-bar");i?(e==null||e.setAttribute("style","display:none"),t==null||t.setAttribute("style","display:none")):(e==null||e.removeAttribute("style"),setTimeout(()=>{t==null||t.removeAttribute("style")},200))},onReplay(){this.player.currentTime(0),this.player.play(),this.domPlayVisibility(!1)},onStop(){this.player.currentTime(0),this.player.pause()}},unmounted(){var i,e,t;(i=this.player)==null||i.pause(),(e=this.player)==null||e.src(""),(t=this.player)==null||t.dispose()},render(){return o("div",{class:s["video-container"]},[o("video",{ref:"video",id:this.videoID,class:s.video,src:this.src,playsinline:this.playsinline,poster:this.poster,preload:this.preload,style:{...this.styleValue}},null),this.loading&&o("div",{class:s.loadingVideo,style:{height:this.height||"210px"}},[o(n,{size:36,color:"#FF8057",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:()=>[p("\u52A0\u8F7D\u4E2D...")]})])])}});export{j as O};
