1 |
- !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?e(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=document.createElement("style");i.innerHTML="._video-container_1ywf1_1{position:relative;width:100%;--plyr-color-main: #01c1b5}._video-container_1ywf1_1 video{width:100%}._video-container_1ywf1_1 .video-back{position:absolute;left:.53333rem;top:.53333rem;color:#fff;z-index:99;font-size:.64rem;width:.8rem;height:.8rem;background-color:rgba(0,0,0,.5);border-radius:50%;padding:.10667rem .13333rem .10667rem .08rem}._video-container_1ywf1_1 .plyr__poster{background-size:cover}._video-container_1ywf1_1 .plyr__control--overlaid{border:.02667rem solid #fff;background-color:transparent!important}._video-container_1ywf1_1 .plyr--video .plyr__control:hover{background-color:transparent!important}._video-container_1ywf1_1 ._video_1ywf1_1{position:relative}._loadingVideo_1ywf1_35{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(0,0,0,.9);z-index:10}._playOver_1ywf1_44{background:rgba(0,0,0,.5);color:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column}._playOver_1ywf1_44 ._tips_1ywf1_52{font-size:.4rem;color:#fff}._playOver_1ywf1_44 ._btn_1ywf1_56{margin:.26667rem 0;min-width:2.50667rem;font-size:.37333rem;height:.74667rem;line-height:.74667rem}._playOver_1ywf1_44 ._replay_1ywf1_63{padding-top:.32rem}._freeTxt_1ywf1_66{font-size:.4rem;color:#fff;line-height:.56rem;padding-top:.26667rem}._freeRate_1ywf1_72{color:#32ffd8}\n",document.head.appendChild(i),System.register(["./index-legacy.b903c881.js","./plyr-legacy.180f4c53.js"],(function(e){"use strict";var n,i,r,o,l,a,s,c,u,y,f,p,d;return{setters:[function(e){n=e.d,i=e.b0,r=e.n,o=e.f,l=e.j,a=e.aS,s=e.z,c=e.F,u=e.M,y=e.g,f=e.B,p=e.T},function(e){d=e.P}],execute:function(){var v="_video-container_1ywf1_1",m="_video_1ywf1_1",h="_loadingVideo_1ywf1_35",g="_playOver_1ywf1_44",_="_tips_1ywf1_52",b="_btn_1ywf1_56",w="_replay_1ywf1_63",A="_freeTxt_1ywf1_66";e("C",n({name:"col-video",props:{trySee:{type:Boolean,default:!1},freeTitleStatus:{type:Boolean,default:!0},freeRate:{type:Number,default:100},setting:{type:Object,default:function(){}},controls:Boolean,height:String,src:{type:String,default:""},poster:{type:String,default:""},styleValue:{type:Object,default:function(){return{}}},preload:{type:String,default:"auto"},currentTime:{type:Boolean,default:!0},playsinline:{type:Boolean,default:!0},onPlay:{type:Function,default:function(){}},isBuy:{type:Boolean,default:!1},onBuyEmit:{type:Function,default:function(){}}},data:function(){return{player:null,loading:!0,trySeeOver:!1,showSeeStatus:!0}},mounted:function(){var e=this;this._init(),i("setVideoPlayer",(function(t){"pause"===(null==t?void 0:t.content).status&&e.player.pause()}))},beforeUnmount:function(){r({api:"limitScreenRecord",content:{type:0}})},computed:{computedSeeStatus:function(){return this.showSeeStatus&&this.trySee},playTime:function(){var e=this.player.duration*this.freeRate/100;return e||0}},methods:{_init:function(){var e=this,n=["play-large","play","progress","captions","fullscreen"];this.currentTime&&n.push("current-time");var i=t(t({controls:n},this.setting),{},{invertTime:!1});o().iPhone&&(i.fullscreen={enabled:!0,fallback:"force",iosNative:!0}),this.player=new d(this.$refs.video,i),this.player.elements.container&&(this.player.elements.container.style.height=this.height||"210px"),"none"===this.preload&&(this.loading=!1),this.player.on("loadedmetadata",(function(){e.loading=!1,e.trySee?e.domPlayVisibility():e.domPlayVisibility(!1);var t=e;e.player.on("timeupdate",(function(){var n=t.player;n.currentTime>=e.playTime&&t.trySee&&(n.pause(),t.trySeeOver=!0,t.showSeeStatus=!0,t.domPlayVisibility())}))})),this.player.on("play",(function(){r({api:"getDeviceStatus",content:{type:"video"}},(function(t){"1"==t.content.status&&(p("为了保证数据安全,请不要录屏"),e.player.pause())})),r({api:"limitScreenRecord",content:{type:1}}),e.onPlay&&e.onPlay()})),this.player.on("enterfullscreen",(function(){console.log("fullscreen");var t=document.createElement("i");t.id="fullscreen-back",t.className="van-icon van-icon-arrow-left video-back",t.addEventListener("click",(function(){e.player.fullscreen.exit()})),console.log(document.getElementsByClassName("plyr")),document.getElementsByClassName("plyr")[0].appendChild(t)})),this.player.on("exitfullscreen",(function(){console.log("exitfullscreen");var e=document.getElementById("fullscreen-back");e&&e.remove()}))},domPlayVisibility:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=document.querySelector(".plyr__controls"),n=document.querySelector(".plyr__control--overlaid");e?(null==t||t.setAttribute("style","display:none"),null==n||n.setAttribute("style","display:none")):(null==t||t.removeAttribute("style"),setTimeout((function(){null==n||n.removeAttribute("style")}),200))},onClickPlay:function(){this.player.play(),this.domPlayVisibility(!1),this.showSeeStatus=!1},onBuy:function(){this.isBuy?this.onBuyEmit():this.$router.back()},onReplay:function(){this.player.restart(),this.player.play(),this.domPlayVisibility(!1),this.trySeeOver=!1,this.showSeeStatus=!1}},unmounted:function(){var e;null===(e=this.player)||void 0===e||e.destroy()},render:function(){var e=this;return l("div",{class:v},[l("video",{ref:"video",class:m,src:this.src,playsinline:this.playsinline,poster:this.poster,preload:this.preload,style:t({},this.styleValue)},null),this.loading&&l("div",{class:h,style:{height:this.height||"210px"}},[l(a,{size:36,color:"#2dc7aa",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:function(){return[s("加载中...")]}})]),this.trySee&&this.computedSeeStatus&&!this.loading&&l("div",{class:[h,g],style:{height:this.height||"210px"}},[this.trySeeOver?l(c,null,["STUDENT"===y.platformType?l("p",{class:_},[this.freeTitleStatus?"免费试看结束,购买完整课程后继续学习":"试看结束,领取课程后继续学习"]):l("p",{class:_},[s("若需完整观看,请下载酷乐秀领取或购买")]),"STUDENT"===y.platformType&&l(f,{class:b,type:"primary",round:!0,size:"small",onClick:this.onBuy},{default:function(){return["STUDENT"===y.platformType?e.freeTitleStatus?"立即购买":"免费领取":"返回免费"]}}),l("div",{class:"STUDENT"!==y.platformType&&w,onClick:this.onReplay},[l(u,{name:"replay",style:{marginRight:"5px"},size:16},null),s("重播")])]):l(c,null,[l(u,{name:"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/v8LDyMvMzdTV1tjY2trb3ODh4eLj5ejs7e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