index.1032b0ae.js 7.0 KB

1
  1. import{P as p}from"./plyr.623e6d1e.js";import{d as c,b1 as d,p as n,b as f,i as t,aS as h,A as a,F as u,N as y,s as o,B as v,T as m}from"./index.6b776f4b.js";const A="_video_1ywf1_1",g="_loadingVideo_1ywf1_35",S="_playOver_1ywf1_44",b="_tips_1ywf1_52",P="_btn_1ywf1_56",w="_replay_1ywf1_63",R="_freeTxt_1ywf1_66",T="_freeRate_1ywf1_72";var l={"video-container":"_video-container_1ywf1_1",video:A,loadingVideo:g,playOver:S,tips:b,btn:P,replay:w,freeTxt:R,freeRate:T},N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAABSCAMAAADw8nOpAAAAAXNSR0IArs4c6QAAAapQTFRFAAAA////////////2NjY2dnZ9vb2////9vb23Nzc3d3d3t7e39/f////4+Pj4+Pj6+vr7Ozs5+fn6Ojo7u7u6enp6enp7+/v8fHx7Ozs8fHx7e3t7+/v8/Pz8PDw8/Pz9PT0+/v78PDw8PDw9PT09PT0////9fX1/Pz89fX19fX19fX18vLy/Pz89vb29vb2/Pz8+fn59/f3////9/f3+vr69/f3+vr6////+Pj4+/v7////+/v7+/v7+Pj4+fn5/////f39+/v7+/v7+/v7+fn5+/v7+/v7/f39////+/v7////+/v7/f39/Pz8/Pz8/////Pz8/////Pz8/f39/f39/Pz8/f39/v7+/Pz8/v7+/////Pz8/v7+/v7+/v7+/v7+/Pz8/v7+/////v7+/v7+/v7+/v7+/v7+/v7+/////v7+/v7+/v7+/////v7+/////v7+/v7+/////v7+/////v7+/////////////////v7+/////v7+/////////////v7+/////////////////////v7+////////////////////////lZ+FUgAAAI10Uk5TAAYSFRobGxscHR4fICMkJScpKywsLi8vNTY2OD5BQkJDQ0RGRkhISktMTlBRUlNVWFlbXF1gY29wcXJyc3R1d3p7fH+AgoSFhoaHj5CTlJWXmJifn6WoqKusr6+0tLi5ury/v8LDyMvMzdTV1tjY2trb3ODh4eLj5ejs7e3u7u/w8vT19vj5+vr7/P3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wRe3WVuWWlE8W1HiW9CIsKJdYkVTx4rWkxUNMivaeFY0G61oiVrRuCWixoR4eznRKNgE7xNtgveJvwEcKXernoio8mmZHxS2nz2mZQCZyLjf62pwSJKjweX1j0cyAORpE88eljzOHHxCWlhOy3J6eUHoCekfdmynrwwsFL4AAAAASUVORK5CYII=",V=c({name:"col-video",props:{trySee:{type:Boolean,default:!1},freeTitleStatus:{type:Boolean,default:!0},freeRate:{type:Number,default:100},setting:{type:Object,default:()=>{}},controls:Boolean,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:()=>{}},isBuy:{type:Boolean,default:!1},onBuyEmit:{type:Function,default:()=>{}}},data(){return{player:null,loading:!0,trySeeOver:!1,showSeeStatus:!0}},mounted(){this._init(),d("setVideoPlayer",s=>{(s==null?void 0:s.content).status==="pause"&&this.player.pause()})},beforeUnmount(){n({api:"limitScreenRecord",content:{type:0}})},computed:{computedSeeStatus(){return this.showSeeStatus&&this.trySee},playTime(){return this.player.duration*this.freeRate/100||0}},methods:{_init(){const s=["play-large","play","progress","captions","fullscreen"];this.currentTime&&s.push("current-time");const i={controls:s,...this.setting,invertTime:!1};f().iPhone&&(i.fullscreen={enabled:!0,fallback:"force",iosNative:!0}),this.player=new p(this.$refs.video,i),this.player.elements.container&&(this.player.elements.container.style.height=this.height||"210px"),this.preload==="none"&&(this.loading=!1),this.player.on("loadedmetadata",()=>{this.loading=!1,this.trySee?this.domPlayVisibility():this.domPlayVisibility(!1);const e=this;this.player.on("timeupdate",()=>{const r=e.player;r.currentTime>=this.playTime&&e.trySee&&(r.pause(),e.trySeeOver=!0,e.showSeeStatus=!0,e.domPlayVisibility())})}),this.player.on("play",()=>{n({api:"getDeviceStatus",content:{type:"video"}},e=>{e.content.status=="1"&&(m("\u4E3A\u4E86\u4FDD\u8BC1\u6570\u636E\u5B89\u5168\uFF0C\u8BF7\u4E0D\u8981\u5F55\u5C4F"),this.player.pause())}),n({api:"limitScreenRecord",content:{type:1}}),this.onPlay&&this.onPlay()}),this.player.on("enterfullscreen",()=>{console.log("fullscreen");const e=document.createElement("i");e.id="fullscreen-back",e.className="van-icon van-icon-arrow-left video-back",e.addEventListener("click",()=>{this.player.fullscreen.exit()}),console.log(document.getElementsByClassName("plyr")),document.getElementsByClassName("plyr")[0].appendChild(e)}),this.player.on("exitfullscreen",()=>{console.log("exitfullscreen");const e=document.getElementById("fullscreen-back");e&&e.remove()})},domPlayVisibility(s=!0){const i=document.querySelector(".plyr__controls"),e=document.querySelector(".plyr__control--overlaid");s?(i==null||i.setAttribute("style","display:none"),e==null||e.setAttribute("style","display:none")):(i==null||i.removeAttribute("style"),setTimeout(()=>{e==null||e.removeAttribute("style")},200))},onClickPlay(){this.player.play(),this.domPlayVisibility(!1),this.showSeeStatus=!1},onBuy(){if(this.isBuy){this.onBuyEmit();return}this.$router.back()},onReplay(){this.player.restart(),this.player.play(),this.domPlayVisibility(!1),this.trySeeOver=!1,this.showSeeStatus=!1}},unmounted(){var s;(s=this.player)==null||s.destroy()},render(){return t("div",{class:l["video-container"]},[t("video",{ref:"video",class:l.video,src:this.src,playsinline:this.playsinline,poster:this.poster,preload:this.preload,style:{...this.styleValue}},null),this.loading&&t("div",{class:l.loadingVideo,style:{height:this.height||"210px"}},[t(h,{size:36,color:"#2dc7aa",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:()=>[a("\u52A0\u8F7D\u4E2D...")]})]),this.trySee&&this.computedSeeStatus&&!this.loading&&t("div",{class:[l.loadingVideo,l.playOver],style:{height:this.height||"210px"}},[this.trySeeOver?t(u,null,[o.platformType==="STUDENT"?t("p",{class:l.tips},[this.freeTitleStatus?"\u514D\u8D39\u8BD5\u770B\u7ED3\u675F\uFF0C\u8D2D\u4E70\u5B8C\u6574\u8BFE\u7A0B\u540E\u7EE7\u7EED\u5B66\u4E60":"\u8BD5\u770B\u7ED3\u675F\uFF0C\u9886\u53D6\u8BFE\u7A0B\u540E\u7EE7\u7EED\u5B66\u4E60"]):t("p",{class:l.tips},[a("\u82E5\u9700\u5B8C\u6574\u89C2\u770B\uFF0C\u8BF7\u4E0B\u8F7D\u9177\u4E50\u79C0\u9886\u53D6\u6216\u8D2D\u4E70")]),o.platformType==="STUDENT"&&t(v,{class:l.btn,type:"primary",round:!0,size:"small",onClick:this.onBuy},{default:()=>[o.platformType==="STUDENT"?this.freeTitleStatus?"\u7ACB\u5373\u8D2D\u4E70":"\u514D\u8D39\u9886\u53D6":"\u8FD4\u56DE\u514D\u8D39"]}),t("div",{class:o.platformType!=="STUDENT"&&l.replay,onClick:this.onReplay},[t(y,{name:"replay",style:{marginRight:"5px"},size:16},null),a("\u91CD\u64AD")])]):t(u,null,[t(y,{name:N,size:50,onClick:this.onClickPlay},null),t("p",{class:l.freeTxt},[a("\u514D\u8D39\u8BD5\u770B")])])])])}});export{V as C};