video-legacy.bc363b26.js 7.6 KB

1
  1. !function(){function e(e,n,r,t,o,a,i){try{var s=e[a](i),l=s.value}catch(c){return void r(c)}s.done?n(l):Promise.resolve(l).then(t,o)}function n(n){return function(){var r=this,t=arguments;return new Promise((function(o,a){var i=n.apply(r,t);function s(n){e(i,o,a,s,l,"next",n)}function l(n){e(i,o,a,s,l,"throw",n)}s(void 0)}))}}System.register(["./video.module-legacy.627d52e5.js","./index-legacy.0dc8a0a8.js","./plyr.min-legacy.a0adaba2.js","./plyr-legacy.2bfabaee.js","./index-legacy.c75fe8a2.js","./index-legacy.dfe14db4.js"],(function(e){"use strict";var r,t,o,a,i,s,l,c,u,d,p,v,f,g,m,y,h,w,I,x;return{setters:[function(e){r=e.s},function(e){t=e.d,o=e.ah,a=e.ag,i=e.aY,s=e.r,l=e.R,c=e.Z,u=e.$,d=e.m,p=e.b3,v=e.c,f=e.L,g=e.q,m=e.B,y=e.f},function(e){h=e.P},function(){},function(e){w=e.q},function(e){I=e.u,x=e.b}],execute:function(){e("default",t({name:"pre-register",setup:function(){var e=o(),t=a(),B=i(),k=sessionStorage.getItem("active-open-id"),R=I(1e3,{controls:!0});R.pause();var b=s({coverImg:"",introductionVideo:"",introductionVideoTime:0,videoBrowsePoint:0,saveId:e.query.saveId,orchestraId:e.query.id,openId:e.query.openId||k,loading:!1,player:null,playerSpeed:1,intervalFnRef:null,isPageHide:!1}),P=I(1e3,{controls:!0});P.pause();var T=function(e){var n=[];e.sort((function(e,n){return e[0]-n[0]}));for(var r=e[0],t=1;t<e.length;t++){var o=e[t];r[1]>=o[0]?r[1]=Math.max(o[1],r[1]):(n.push(r),r=o)}return n.push(r),n},E=function(e){var n=T(e),r=0;return n.forEach((function(e){r+=e[1]-e[0]})),r},S=l([]),V=[],j=I(1e3,{controls:!0});c((function(){return P.isActive.value}),(function(e){C(e)}));var C=function(e){if(e?V[0]=Math.floor(b.player.currentTime):V[1]=Math.floor(b.player.currentTime),V.length>=2){var n=V[1]-V[0]-j.counter.value*b.playerSpeed>2;V[1]>=V[0]&&!n&&S.value.push(V),V=[],j.counter.value=0}};c(B,(function(e){console.log("watch",e),"hidden"==e&&b.player.pause()}));var q=function(){var e=n(regeneratorRuntime.mark((function e(){var n,r,t,o,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>0&&void 0!==a[0]?a[0]:10,e.prev=1,r=S.value.length>0?T(S.value):[],t=S.value.length>0?E(S.value):0,o=Math.floor(t/Math.floor(b.introductionVideoTime)*100),e.next=7,d.post("/api-student/open/studentBrowseRecord/updateStat",{data:{id:b.saveId,pageBrowseTime:n,videoBrowseData:JSON.stringify(r),videoBrowseDataTime:t||0,videoBrowsePercentage:o||0,videoBrowseTime:null==P?void 0:P.counter.value,videoBrowsePoint:Math.floor(b.player.currentTime||0)}});case 7:e.next=11;break;case 9:e.prev=9,e.t0=e.catch(1);case 11:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=n(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,b.player.pause(),null===(n=b.intervalFnRef)||void 0===n||n.pause(),j.pause(),P.pause(),R.pause(),C(P.isActive.value),e.next=9,q();case 9:window.location.href=window.location.origin+window.location.pathname+"/project/preRegister.html?"+w.stringify({orchestraId:b.orchestraId,openId:b.openId}),e.next=18;break;case 12:e.prev=12,e.t0=e.catch(0),console.log(e.t0,"e"),null===(r=b.intervalFnRef)||void 0===r||r.resume(),R.resume(),j.resume();case 18:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(){return e.apply(this,arguments)}}();u(n(regeneratorRuntime.mark((function e(){var r,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.get("/api-student/open/studentBrowseRecord/query",{params:{openId:b.openId,orchestraId:b.orchestraId}});case 3:r=e.sent,t=r.data,b.videoBrowsePoint=t.videoBrowsePoint||0,b.player&&(b.player.currentTime=t.videoBrowsePoint||0),b.introductionVideo=t.introductionVideo,b.introductionVideoTime=t.introductionVideoTime,b.coverImg=t.coverImg,S.value=t.videoBrowseData?JSON.parse(t.videoBrowseData):[],o=void 0,o={controls:["play-large","play","progress","captions","current-time","duration","settings","fullscreen"],settings:["speed"],speed:{selected:1,options:[.5,1,1.5,2]},i18n:{speed:"速度",normal:"默认"},autoplay:!1,invertTime:!1},y().iPhone&&(o.fullscreen={enabled:!0,fallback:"force",iosNative:!0}),b.player=new h("#register-video",o),b.player.on("loadedmetadata",(function(){console.log("loadedmetadata"),b.loading=!1,b.player.currentTime=b.videoBrowsePoint})),b.player.on("ratechange",(function(){b.playerSpeed=b.playerSpeed<b.player.speed?b.player.speed:b.playerSpeed})),b.player.on("seeking",(function(){console.log("seeking"),P.isActive.value&&P.pause()})),b.player.on("seeked",(function(){console.log("seeked"),P.isActive.value&&P.pause()})),b.player.on("waiting",(function(){console.log("waiting pause"),P.isActive.value&&P.pause()})),b.player.on("timeupdate",(function(){!P.isActive.value&&b.player.currentTime>0&&b.player.playing&&P.resume()})),b.player.on("ended",(function(){b.player.pause()})),b.player.on("play",(function(){console.log("play"),P.resume()})),b.player.on("pause",(function(){console.log("pause",P.isActive.value),P.pause()})),b.player.on("enterfullscreen",(function(){console.log("fullscreen");var e=document.createElement("i");e.id="fullscreen-back",e.className="van-icon van-icon-arrow-left video-back",e.addEventListener("click",(function(){b.player.fullscreen.exit()})),console.log(document.getElementsByClassName("plyr")),document.getElementsByClassName("plyr")[0].appendChild(e)})),b.player.on("exitfullscreen",(function(){console.log("exitfullscreen");var e=document.getElementById("fullscreen-back");e&&e.remove()})),b.intervalFnRef=x(n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R.counter.value=0,R.resume(),e.next=4,q();case 4:P.counter.value=0;case 5:case"end":return e.stop()}}),e)}))),1e4),e.next=17;break;case 15:e.prev=15,e.t0=e.catch(0);case 17:case"end":return e.stop()}var o}),e,null,[[0,15]])})))),p((function(){var e;null===(e=b.intervalFnRef)||void 0===e||e.pause(),j.pause(),R.pause()})),b.openId||t.replace({path:"/pre-register-video",query:{id:b.orchestraId}});var F=function(){console.log(b.isPageHide,"showInfo"),b.isPageHide&&window.location.reload()};window.addEventListener("pageshow",F);var L=function(){console.log(b.isPageHide,"showInfo"),b.isPageHide=!0};return window.addEventListener("pagehide",L),p((function(){window.removeEventListener("pageshow",F),window.removeEventListener("pagehide",L)})),function(){return v("div",{class:r["pre-register-video"]},[v("div",{class:r.videoContainer},[v("div",{class:r["video-content"]},[v("video",{id:"register-video",class:r.video,src:b.introductionVideo,playsinline:!0,poster:b.coverImg,preload:"auto"},null),b.loading&&v("div",{class:r.loadingVideo},[v(f,{size:36,color:"#FF8057",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:function(){return[g("加载中...")]}})])])]),v("div",{class:r.messageContainer},[v("div",{class:r.messageContent},[v("p",null,[g("家长您好!")]),v("p",{class:r.c1},[g("请家长们合理安排时间,"),v("span",null,[g("认真观看")]),g("家长会内容。在"),v("span",null,[g("详细了解")]),g("所有要求后,有意向让孩子加入乐团的家长,请在"),v("span",null,[g("明晚20:00前")]),g(",为孩子完成"),v("span",null,[g("乐团报名")]),g("。")]),v("p",{class:r.c1},[g("下周,专业老师将针对意向入团学员进行身体条件确认。谢谢各位的支持!")]),v("p",{class:r.bottom},[g("注:乐团于下学期正式开始训练,训练时间下学期开学前另行通知,训练时间会与学校其他社团错开,家长无需担心时间冲突问题。")])]),v(m,{class:r.submitBtn,onClick:A},null)])])}}}))}}}))}();