video-legacy.49158a47.js 9.9 KB

1
  1. !function(){function e(e,n,t,o,r,i,a){try{var s=e[i](a),l=s.value}catch(c){return void t(c)}s.done?n(l):Promise.resolve(l).then(o,r)}function n(n){return function(){var t=this,o=arguments;return new Promise((function(r,i){var a=n.apply(t,o);function s(n){e(a,r,i,s,l,"next",n)}function l(n){e(a,r,i,s,l,"throw",n)}s(void 0)}))}}System.register(["./index-legacy.5f9666b4.js","./video.module-legacy.fa24b34b.js","./tcplayer.v4.8.0.min-legacy.cbe420be.js","./tcplayer-legacy.cc17772c.js","./deep-clone-legacy.b234d76d.js","./index-legacy.85e16f70.js"],(function(e){"use strict";var t,o,r,i,a,s,l,c,u,d,p,v,f,g,y,m,h,w,T,I;return{setters:[function(e){t=e.d,o=e.ah,r=e.ag,i=e.b0,a=e.r,s=e.R,l=e.Z,c=e.$,u=e.m,d=e.b7,p=e.c,v=e.L,f=e.q,g=e.B,y=e.bd},function(e){m=e.s},function(e){h=e.T},function(){},function(e){w=e.d},function(e){T=e.u,I=e.b}],execute:function(){e("default",t({name:"pre-register",setup:function(){var e=o(),t=r(),x=i(),R=sessionStorage.getItem("active-open-id"),C=T(1e3,{controls:!0});C.pause();var B=a({videoID:"video"+Date.now()+Math.floor(100*Math.random()),coverImg:"",introductionVideo:"",introductionVideoTime:0,videoBrowsePoint:0,saveId:e.query.saveId,orchestraId:e.query.id,openId:e.query.openId||R,loading:!1,player:null,playerSpeed:1,intervalFnRef:null,videoDetails:[],pointVideo:{},pointVideoTime:0,videoSelectId:null,isPageHide:!1,parentConferencesNotes:"",orchestraRegisterType:"",status:"",registerDisplay:!0}),N=T(1e3,{controls:!0});N.pause();var F=function(e){var n=[];e.sort((function(e,n){return e[0]-n[0]}));for(var t=e[0],o=1;o<e.length;o++){var r=e[o];t[1]>=r[0]?t[1]=Math.max(r[1],t[1]):(n.push(t),t=r)}return n.push(t),k(n)},k=function(e){var n=[],t=B.pointVideo.startNode,o=B.pointVideo.endNode;return e.forEach((function(e){e[1]>=e[0]&&(e[0]>=t&&e[0]<=o&&e[1]<=o&&n.push(e),e[0]>=t&&e[0]<=o&&e[1]>o&&n.push([e[0],o]),e[0]<t&&e[1]>t&&e[1]<=o&&n.push([t,e[1]]),e[0]<t&&e[1]>t&&e[1]>o&&n.push([t,o]))})),n},b=function(e){var n=F(e),t=0;return n.forEach((function(e){t+=e[1]-e[0]})),t},D=function(e){B.videoDetails.forEach((function(n){n.startNode<=e&&e<=n.endNode&&(B.videoSelectId=n.id)}))},E=function(){var e=h.getComponent("Button");h.getComponent("BigPlayButton").prototype.createEl=function(){var n=e.prototype.createEl.call(this);return n.appendChild(h.dom.createEl("div",{className:"vjs-button-icon",innerHTML:'<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="椭圆形"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="路径"fill="#FFFFFF"fill-rule="nonzero"></path></g></g></g></g></g></svg></button>'})),n},B.player=h("register-video",{appID:"",controls:!0,plugins:{}}),B.player&&(B.player.src(B.introductionVideo),B.player.poster(B.coverImg||""),B.player.on("ready",(function(e){console.log("ready",e)})),B.player.on("loadedmetadata",(function(){console.log("loadedmetadata"),B.loading=!1,B.player.currentTime(B.videoBrowsePoint),D(B.player.currentTime())})),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"),N.isActive.value&&N.pause()})),B.player.on("seeked",(function(){console.log("seeked"),N.isActive.value&&N.pause()})),B.player.on("waiting",(function(){N.isActive.value&&N.pause()})),B.player.on("timeupdate",(function(){console.log("timeupdate",B.player.currentTime()),D(B.player.currentTime()),!N.isActive.value&&B.player.currentTime()>0&&B.player.playing&&N.resume()})),B.player.on("ended",(function(){B.player.pause()})),B.player.on("play",(function(){console.log("play"),N.resume()})),B.player.on("pause",(function(){console.log("pause",N.isActive.value),N.pause()})),B.player.on("fullscreenchange",(function(){if(B.player.isFullscreen()){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.exitFullscreen()})),document.getElementsByClassName("video-js")[0].appendChild(e)}else{console.log("exitfullscreen");var n=document.getElementById("fullscreen-back");n&&n.remove()}}))),D(0)},P=s([]),V=[],S=T(1e3,{controls:!0});l((function(){return N.isActive.value}),(function(e){console.log(N.isActive.value,"videoIntervalRef"),M(e)}));var M=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=w(V);if(n?V.length>0&&(V[1]=Math.floor(B.player.currentTime)):e?V[0]=Math.floor(B.player.currentTime):V[1]=Math.floor(B.player.currentTime),V.length>=2){var o=V[1]-V[0]-S.counter.value*B.playerSpeed>2;V[1]>=V[0]&&!o&&P.value.push(V),n?V=w(t):(V=[],S.counter.value=0)}};l(x,(function(e){console.log("watch",e),"hidden"==e&&B.player.pause()}));var A=function(){var e=n(regeneratorRuntime.mark((function e(){var n,t,o,r,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>0&&void 0!==i[0]?i[0]:10,e.prev=1,t=P.value.length>0?F(P.value):[],o=t.length>0?b(t):0,r=Math.floor(o/Math.floor(B.pointVideoTime)*100),e.next=7,u.post("/api-student/open/studentBrowseRecord/updateStat",{data:{id:B.saveId,pageBrowseTime:n,videoBrowseData:JSON.stringify(t),videoBrowseDataTime:o||0,videoBrowsePercentage:r||0,videoBrowseTime:null==N?void 0:N.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)}}(),L=function(){var e=n(regeneratorRuntime.mark((function e(){var n,t;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(),S.pause(),N.pause(),C.pause(),M(N.isActive.value),e.next=9,A();case 9:console.log(B.orchestraRegisterType),"PARENT_CONFERENCES"===B.orchestraRegisterType?window.location.href=window.location.origin+window.location.pathname+"/#/preApply?id=".concat(B.orchestraId):"GROUP_BUY"===B.orchestraRegisterType?window.location.href=window.location.origin+window.location.pathname+"/#/preGoodsApply?id=".concat(B.orchestraId):window.location.href=window.location.origin+window.location.pathname+"/project/preRegister.html?"+y.stringify({orchestraId:B.orchestraId,openId:B.openId}),e.next=19;break;case 13:e.prev=13,e.t0=e.catch(0),console.log(e.t0,"e"),null===(t=B.intervalFnRef)||void 0===t||t.resume(),C.resume(),S.resume();case 19:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}();c(n(regeneratorRuntime.mark((function e(){var t,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.get("/api-student/open/studentBrowseRecord/query",{params:{openId:B.openId,orchestraId:B.orchestraId}});case 3:t=e.sent,o=t.data,B.videoBrowsePoint=o.videoBrowsePoint||0,B.player&&B.player.currentTime(o.videoBrowsePoint||0),B.introductionVideo=o.introductionVideo,B.introductionVideoTime=o.introductionVideoTime,B.coverImg=o.coverImg,P.value=o.videoBrowseData?JSON.parse(o.videoBrowseData):[],B.parentConferencesNotes=o.parentConferencesNotes,B.orchestraRegisterType=o.orchestraRegisterType,B.registerDisplay=o.registerDisplay,(o.videoDetails||[]).forEach((function(e){B.videoDetails.push({startNode:e.startNode,endNode:e.endNode,desc:e.desc,id:e.id}),e.pointFlag&&(B.pointVideo=e,B.pointVideoTime=e.endNode-e.startNode)})),E(),B.intervalFnRef=I(n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C.counter.value=0,C.resume(),M(!1,!0),e.next=5,A();case 5:N.counter.value=0;case 6:case"end":return e.stop()}}),e)}))),1e4),e.next=22;break;case 20:e.prev=20,e.t0=e.catch(0);case 22:case"end":return e.stop()}}),e,null,[[0,20]])})))),d((function(){var e,n;null===(e=B.player)||void 0===e||e.fullscreen.exit(),null===(n=B.intervalFnRef)||void 0===n||n.pause(),S.pause(),C.pause()})),B.openId||t.replace({path:"/pre-register-video",query:{id:B.orchestraId}});var j=function(){B.isPageHide&&window.location.reload()};window.addEventListener("pageshow",j);var q=function(){B.isPageHide=!0};return window.addEventListener("pagehide",q),d((function(){window.removeEventListener("pageshow",j),window.removeEventListener("pagehide",q)})),function(){return p("div",{class:m["pre-register-video"]},[p("div",{class:m.videoContainer},[p("div",{class:m["video-content"]},[p("video",{id:"register-video",class:m.video,src:B.introductionVideo,playsinline:!0,poster:B.coverImg,preload:"auto"},null),B.loading&&p("div",{class:m.loadingVideo},[p(v,{size:36,color:"#FF8057",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:function(){return[f("加载中...")]}})])])]),p("div",{class:m.videoCount},[p("div",{class:m.videoTitle},null),p("div",{class:m.videoCountContent},[B.videoDetails.map((function(e){return p("span",{class:[e.id===B.videoSelectId?m.active:""],onClick:function(){B.player.currentTime(e.startNode),B.player.play(),B.videoBrowsePoint=e.startNode,D(B.player.currentTime())}},[e.desc])}))])]),p("div",{class:m.messageContainer},[p("div",{class:m.messageContent},[p("div",{innerHTML:B.parentConferencesNotes},null),B.registerDisplay&&p(g,{class:m.submitBtn,onClick:L},null)])])])}}}))}}}))}();