1 |
- System.register(["./instrument-legacy-c8c4d9ee.js"],(function(e,t){"use strict";var i,n,o,a,r,d,s,l,u,c,m,p,v,g,_,b,h,f,S,M,w,x,y,j=document.createElement("style");return j.textContent="body{overflow:hidden}._skeleton_1bnjb_4{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_1bnjb_15{width:100vw;height:auto;overflow:hidden;--header-height: 1.65333rem;background:transparent;position:relative}._detail_1bnjb_15 ._mask_1bnjb_23{position:absolute;z-index:6;width:100%;height:100%}._detail_1bnjb_15 ._container_1bnjb_29{margin:0;border-radius:.26667rem}._detail_1bnjb_15 #osmdCanvasPage1{position:relative!important}._detail_1bnjb_15 #musicAndSelection{height:initial!important;max-height:initial!important}._detail_1bnjb_15 .smoothAnimationBox{height:0!important;overflow:hidden}._detail_1bnjb_15 #cursorImg-0{margin-top:-20PX!important}._whiteBg_1bnjb_47{background:#fff}\n",document.head.appendChild(j),{setters:[e=>{i=e.d,n=e.g,o=e.r,a=e.o,r=e.s,d=e.J,s=e.x,l=e.b,u=e.M,c=e.R,m=e.S,p=e.U,v=e.V,g=e.W,_=e.X,b=e.O,h=e.n,f=e.Y,S=e.Z,M=e.Q,w=e._,x=e.$,y=e.a0}],execute:function(){const t="_detail_1bnjb_15",j="_mask_1bnjb_23",I="_container_1bnjb_29",T="_whiteBg_1bnjb_47";e("default",i({name:"simple-detail",setup(){const e=n(),i=o({isLoading:!0,currentTime:0,totalTime:0,backgroundRendMode:""}),k=e=>{var t,n,o,a;let d={};try{d="string"==typeof(null==e?void 0:e.data)?JSON.parse(e.data):e.data}catch(b){console.error("parse_error: Invalid JSON data received")}if("api_play"===(null===(t=d)||void 0===t?void 0:t.api)&&(console.log("h5开始播放"),r.playState="play",P()),"api_paused"===(null===(n=d)||void 0===n?void 0:n.api)){var s,l;const e=null===(s=d)||void 0===s||null===(l=s.content)||void 0===l?void 0:l.currentTime;console.log("暂停播放",e),r.playState="paused",0===e&&setTimeout((()=>{i.currentTime=0,r.activeNoteIndex=0,r.activeMeasureIndex=r.times[0].MeasureNumberXML,N(!0)}),200)}var u,p,v;if("api_updateProgress"===(null===(o=d)||void 0===o?void 0:o.api)&&(console.log("拖动的进度",r.playState),"paused"===r.playState&&(i.currentTime=null!==(u=null===(p=d)||void 0===p||null===(v=p.content)||void 0===v?void 0:v.currentTime)&&void 0!==u?u:i.currentTime,r.activeNoteIndex=0,r.activeMeasureIndex=r.times[0].MeasureNumberXML,N(!0))),"api_playProgress"===(null===(a=d)||void 0===a?void 0:a.api)){var g,_;const e=null===(g=d)||void 0===g||null===(_=g.content)||void 0===_?void 0:_.currentTime;if(e){if(e<i.currentTime){r.activeNoteIndex=0;let t=c(e)||r.times[0];t.i===r.activeNoteIndex&&(r.activeMeasureIndex=t.MeasureNumberXML),e<=r.times[0].fixtime&&m(!0)}i.currentTime=e}}};a((async()=>{const t=e.id||"";i.backgroundRendMode=e.backgroundRendMode,r.isSimplePage=!0,await d(t,"open"),i.isLoading=!1,r.isSingleLine=!0,window.addEventListener("message",k)})),s((()=>{r.isSimplePage=!1,window.removeEventListener("message",k)}));const L=async e=>{var t;const i=null===(t=document.getElementById("scrollContainer"))||void 0===t?void 0:t.getBoundingClientRect().height;r.osmd=e,0===r.originSpeed&&(r.originSpeed=r.speed=e.bpm||e.Sheet.userStartTempoInBPM||100);const n=(p.get("speeds")||{})[r.examSongId]||r.speed||e.bpm||e.Sheet.userStartTempoInBPM;n&&v(n),g(),_(),r.times=b(e),console.log("🚀 ~ state.times:",r.times,r),h((()=>{r.activeMeasureIndex=r.times[0].MeasureNumberXML})),f(r.times),S(),M(),console.log("渲染完成",i),window.parent.postMessage({api:"api_musicPage",height:i},"*"),w({height:i})},N=e=>{const t=i.currentTime;let n=c(t)||r.times[0];n&&x(n,e),r.activeNoteIndex=(null==n?void 0:n.i)||0,r.isSingleLine&&y(t,!0)},P=()=>{if("play"!==r.playState)return void console.log("暂停播放");let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(N(),P()):setTimeout((()=>{N(),P()}),16.7)}))};return()=>l("div",{class:[t,"video"===i.backgroundRendMode&&T]},[l("div",{class:j},null),l("div",{id:"scrollContainer",class:[I]},[!i.isLoading&&l(u,{onRendered:L,musicColor:"#000000"},null)])])}}))}}}));
|