video-legacy.86d09a1f.js 8.7 KB

1
  1. !function(){function e(e,n,o,t,r,a,i){try{var s=e[a](i),l=s.value}catch(c){return void o(c)}s.done?n(l):Promise.resolve(l).then(t,r)}function n(n){return function(){var o=this,t=arguments;return new Promise((function(r,a){var i=n.apply(o,t);function s(n){e(i,r,a,s,l,"next",n)}function l(n){e(i,r,a,s,l,"throw",n)}s(void 0)}))}}System.register(["./video.module-legacy.9ea13724.js","./index-legacy.5d6d69c8.js","./plyr.min-legacy.a0adaba2.js","./plyr-legacy.2bfabaee.js","./index-legacy.c75fe8a2.js","./index-legacy.dc1b386c.js"],(function(e){"use strict";var o,t,r,a,i,s,l,c,u,d,p,v,f,g,m,y,h,w,I,B;return{setters:[function(e){o=e.s},function(e){t=e.d,r=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,B=e.b}],execute:function(){e("default",t({name:"pre-register",setup:function(){var e=r(),t=a(),T=i(),x=sessionStorage.getItem("active-open-id"),k=I(1e3,{controls:!0});k.pause();var N=s({coverImg:"",introductionVideo:"",introductionVideoTime:0,videoBrowsePoint:0,saveId:e.query.saveId,orchestraId:e.query.id,openId:e.query.openId||x,loading:!1,player:null,playerSpeed:1,intervalFnRef:null,videoDetails:[],pointVideo:{},pointVideoTime:0,videoSelectId:null,isPageHide:!1}),b=I(1e3,{controls:!0});b.pause();var P=function(e){var n=[];e.sort((function(e,n){return e[0]-n[0]}));for(var o=e[0],t=1;t<e.length;t++){var r=e[t];o[1]>=r[0]?o[1]=Math.max(r[1],o[1]):(n.push(o),o=r)}return n.push(o),R(n)},R=function(e){var n=[],o=N.pointVideo.startNode,t=N.pointVideo.endNode;return e.forEach((function(e){e[0]>=o&&e[1]<=t&&n.push(e),e[0]>=o&&e[1]<=t&&e[1]>=t&&n.push([e[0],t]),e[0]<o&&e[1]>o&&e[1]<t&&n.push(o,e[1])})),n},V=function(e){var n=P(e);console.log(n,"afterIntervals");var o=0;return n.forEach((function(e){o+=e[1]-e[0]})),o},E=function(e){N.videoDetails.forEach((function(n){n.startNode<=e&&e<=n.endNode&&(N.videoSelectId=n.id)}))},S=function(){var e={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&&(e.fullscreen={enabled:!0,fallback:"force",iosNative:!0});var n=[];N.videoDetails.forEach((function(e){n.push({time:e.startNode,label:e.desc})})),e.markers={enabled:!0,points:n},N.player=new h("#register-video",e),N.player.on("ready",(function(e){console.log("ready",e)})),N.player.on("loadedmetadata",(function(){console.log("loadedmetadata"),N.loading=!1,N.player.currentTime=N.videoBrowsePoint,E(N.player.currentTime)})),N.player.on("ratechange",(function(){N.playerSpeed=N.playerSpeed<N.player.speed?N.player.speed:N.playerSpeed})),N.player.on("seeking",(function(){console.log("seeking"),b.isActive.value&&b.pause()})),N.player.on("seeked",(function(){console.log("seeked"),b.isActive.value&&b.pause()})),N.player.on("waiting",(function(){b.isActive.value&&b.pause()})),N.player.on("timeupdate",(function(){console.log("timeupdate",N.player.currentTime),E(N.player.currentTime),!b.isActive.value&&N.player.currentTime>0&&N.player.playing&&b.resume()})),N.player.on("ended",(function(){N.player.pause()})),N.player.on("play",(function(){console.log("play"),b.resume()})),N.player.on("pause",(function(){console.log("pause",b.isActive.value),b.pause()})),N.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(){N.player.fullscreen.exit()})),console.log(document.getElementsByClassName("plyr")),document.getElementsByClassName("plyr")[0].appendChild(e)})),N.player.on("exitfullscreen",(function(){console.log("exitfullscreen");var e=document.getElementById("fullscreen-back");e&&e.remove()})),E(0)},C=l([]),D=[],j=I(1e3,{controls:!0});c((function(){return b.isActive.value}),(function(e){F(e)}));var F=function(e){if(e?D[0]=Math.floor(N.player.currentTime):D[1]=Math.floor(N.player.currentTime),D.length>=2){var n=D[1]-D[0]-j.counter.value*N.playerSpeed>2;D[1]>=D[0]&&!n&&C.value.push(D),D=[],j.counter.value=0}};c(T,(function(e){console.log("watch",e),"hidden"==e&&N.player.pause()}));var q=function(){var e=n(regeneratorRuntime.mark((function e(){var n,o,t,r,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,o=C.value.length>0?P(C.value):[],t=o.length>0?V(o):0,r=Math.floor(t/Math.floor(N.pointVideoTime)*100),e.next=7,d.post("/api-student/open/studentBrowseRecord/updateStat",{data:{id:N.saveId,pageBrowseTime:n,videoBrowseData:JSON.stringify(o),videoBrowseDataTime:t||0,videoBrowsePercentage:r||0,videoBrowseTime:null==b?void 0:b.counter.value,videoBrowsePoint:Math.floor(N.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,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N.player.pause(),null===(n=N.intervalFnRef)||void 0===n||n.pause(),j.pause(),b.pause(),k.pause(),F(b.isActive.value),e.next=9,q();case 9:window.location.href=window.location.origin+window.location.pathname+"/project/preRegister.html?"+w.stringify({orchestraId:N.orchestraId,openId:N.openId}),e.next=18;break;case 12:e.prev=12,e.t0=e.catch(0),console.log(e.t0,"e"),null===(o=N.intervalFnRef)||void 0===o||o.resume(),k.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 o,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:N.openId,orchestraId:N.orchestraId}});case 3:o=e.sent,t=o.data,N.videoBrowsePoint=t.videoBrowsePoint||0,N.player&&(N.player.currentTime=t.videoBrowsePoint||0),N.introductionVideo=t.introductionVideo,N.introductionVideoTime=t.introductionVideoTime,N.coverImg=t.coverImg,C.value=t.videoBrowseData?JSON.parse(t.videoBrowseData):[],(t.videoDetails||[]).forEach((function(e){N.videoDetails.push({startNode:e.startNode,endNode:e.endNode,desc:e.desc,id:e.id}),e.pointFlag&&(N.pointVideo=e,N.pointVideoTime=e.endNode-e.startNode)})),S(),N.intervalFnRef=B(n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.counter.value=0,k.resume(),e.next=4,q();case 4:b.counter.value=0;case 5:case"end":return e.stop()}}),e)}))),1e4),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,null,[[0,17]])})))),p((function(){var e;null===(e=N.intervalFnRef)||void 0===e||e.pause(),j.pause(),k.pause()})),N.openId||t.replace({path:"/pre-register-video",query:{id:N.orchestraId}});var L=function(){console.log(N.isPageHide,"showInfo"),N.isPageHide&&window.location.reload()};window.addEventListener("pageshow",L);var M=function(){console.log(N.isPageHide,"showInfo"),N.isPageHide=!0};return window.addEventListener("pagehide",M),p((function(){window.removeEventListener("pageshow",L),window.removeEventListener("pagehide",M)})),function(){return v("div",{class:o["pre-register-video"]},[v("div",{class:o.videoContainer},[v("div",{class:o["video-content"]},[v("video",{id:"register-video",class:o.video,src:N.introductionVideo,playsinline:!0,poster:N.coverImg,preload:"auto"},null),N.loading&&v("div",{class:o.loadingVideo},[v(f,{size:36,color:"#FF8057",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:function(){return[g("加载中...")]}})])])]),v("div",{class:o.videoCount},[v("div",{class:o.videoCountContent},[N.videoDetails.map((function(e){return v("span",{class:[e.id===N.videoSelectId?o.active:""],onClick:function(){N.player.currentTime=e.startNode,N.player.play(),N.videoBrowsePoint=e.startNode,E(N.player.currentTime)}},[e.desc])}))])]),v("div",{class:o.messageContainer},[v("div",{class:o.messageContent},[v("p",null,[g("家长您好!")]),v("p",{class:o.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:o.c1},[g("下周,专业老师将针对意向入团学员进行身体条件确认。谢谢各位的支持!")]),v("p",{class:o.bottom},[g("注:乐团于下学期正式开始训练,训练时间下学期开学前另行通知,训练时间会与学校其他社团错开,家长无需担心时间冲突问题。")])]),v(m,{class:o.submitBtn,onClick:A},null)])])}}}))}}}))}();