1 |
- System.register(["./instrument-legacy-7c9a95ca.js"],(function(e,t){"use strict";var i,o,n,a,r,d,s,l,u,m,c,p,v,g,_,h,f,S,M,w,x,y,b,I=document.createElement("style");return I.textContent="body{overflow:hidden}._skeleton_oe0r3_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_oe0r3_15{width:100vw;height:auto;overflow:hidden;--header-height: 1.65333rem;background:transparent;position:relative}._detail_oe0r3_15 ._mask_oe0r3_23{position:absolute;z-index:6;width:100%;height:100%}._detail_oe0r3_15 ._container_oe0r3_29{margin:0;border-radius:.26667rem}._detail_oe0r3_15 #osmdCanvasPage1{position:relative!important}._detail_oe0r3_15 #musicAndSelection{height:initial!important;max-height:initial!important}._detail_oe0r3_15 .smoothAnimationBox{height:0!important;overflow:hidden}._detail_oe0r3_15 #cursorImg-0{margin-top:-20PX!important;transform:translate(6PX)!important}._whiteBg_oe0r3_48{background:#fff}\n",document.head.appendChild(I),{setters:[e=>{i=e.d,o=e.g,n=e.r,a=e.o,r=e.s,d=e.J,s=e.x,l=e.b,u=e.M,m=e.R,c=e.S,p=e.U,v=e.V,g=e.W,_=e.X,h=e.O,f=e.n,S=e.Y,M=e.Z,w=e.Q,x=e._,y=e.$,b=e.a0}],execute:function(){const t="_detail_oe0r3_15",I="_mask_oe0r3_23",T="_container_oe0r3_29",k="_whiteBg_oe0r3_48";e("default",i({name:"simple-detail",setup(){const e=o(),i=n({isLoading:!0,currentTime:0,totalTime:0,backgroundRendMode:""}),L=e=>{var t,o,n,a;let d={};try{d="string"==typeof(null==e?void 0:e.data)?JSON.parse(e.data):e.data}catch(h){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",B()),"api_paused"===(null===(o=d)||void 0===o?void 0:o.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,P(!0)}),200)}var u,p,v;if("api_updateProgress"===(null===(n=d)||void 0===n?void 0:n.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,P(!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=m(e)||r.times[0];t.i===r.activeNoteIndex&&(r.activeMeasureIndex=t.MeasureNumberXML),e<=r.times[0].fixtime&&c(!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",L)})),s((()=>{r.isSimplePage=!1,window.removeEventListener("message",L)}));const N=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 o=(p.get("speeds")||{})[r.examSongId]||r.speed||e.bpm||e.Sheet.userStartTempoInBPM;o&&v(o),g(),_(),r.times=h(e),console.log("🚀 ~ state.times:",r.times,r),f((()=>{r.activeMeasureIndex=r.times[0].MeasureNumberXML})),S(r.times),M(),w(),console.log("渲染完成",i),window.parent.postMessage({api:"api_musicPage",height:i},"*"),x({height:i})},P=e=>{const t=i.currentTime;let o=m(t)||r.times[0];o&&y(o,e),r.activeNoteIndex=(null==o?void 0:o.i)||0,r.isSingleLine&&b(t)},B=()=>{if("play"!==r.playState)return void console.log("暂停播放");let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(P(),B()):setTimeout((()=>{P(),B()}),16.7)}))};return()=>l("div",{class:[t,"video"===i.backgroundRendMode&&k]},[l("div",{class:I},null),l("div",{id:"scrollContainer",class:[T]},[!i.isLoading&&l(u,{onRendered:N,musicColor:"#000000"},null)])])}}))}}}));
|