12345 |
- <<<<<<<< HEAD:dist/assets/index-a6676b8f.js
- import{d as he,V as X,P as _e,q as Se,r as P,w as j,x as we,aO as xe,y as Be,R as Re,Q as J,a as i,A as Pe,ae as Ie}from"./index-ec1086fa.js";/* empty css */import{b as Le,a as Ce,L as be,P as De,g as ke}from"./back-d9fb04ed.js";import{V as Te}from"./vue3-lottie.es-4ea641d2.js";import{v as Ve}from"./videobg-a14c5ede.js";import{N as qe}from"./index-087ac928.js";const Ee="_playCreation_1oxsf_1",Me="_landscapeScreen_1oxsf_7",Ue="_notLoaded_1oxsf_19",Ae="_videoBox_1oxsf_97",Fe="_ipadPlayCreation_1oxsf_101",Ne="_audioBox_1oxsf_101",ze="_audioBga_1oxsf_101",He="_audioBga1_1oxsf_122",We="_audioBga2_1oxsf_128",$e="_audioVisualizer_1oxsf_141",Oe="_playLarge_1oxsf_149",Ye="_playIngShow_1oxsf_161",Qe="_backBox_1oxsf_164",Xe="_backImg_1oxsf_171",je="_musicDetail_1oxsf_175",Je="_musicSheetName_1oxsf_178",Ke="_username_1oxsf_190",Ze="_staffBox_1oxsf_197",Ge="_staffBoxShow_1oxsf_207",et="_staff_1oxsf_197",tt="_mask_1oxsf_215",n={playCreation:Ee,landscapeScreen:Me,notLoaded:Ue,videoBox:Ae,ipadPlayCreation:Fe,audioBox:Ne,audioBga:ze,audioBga1:He,audioBga2:We,audioVisualizer:$e,playLarge:Oe,playIngShow:Ye,backBox:Qe,backImg:Xe,musicDetail:je,musicSheetName:Je,username:Ke,staffBox:Ze,staffBoxShow:Ge,staff:et,mask:tt},D={playState:!1,playProgress:0},ct=he({name:"playCreation",setup(){const{isApp:N}=X(),m=_e(),K=Se(),k=decodeURIComponent(m.query.resourceUrl||""),Z=decodeURIComponent(m.query.musicSheetName||""),G=decodeURIComponent(m.query.username||""),ee=decodeURIComponent(m.query.musicSheetId||""),te=decodeURIComponent(m.query.videoBgUrl||""),T=k.lastIndexOf("mp4")!==-1?"Video":"Audio",_=P(!1);let e;const V=P(!0),z=P(!1);let H=!1;const{registerDrag:ae,unRegisterDrag:oe}=re(),q=P(0);j(_,()=>{_.value?ae():oe()});const r=we({staffSrc:"",isShow:!1,height:"initial",speedRate:Number(decodeURIComponent(m.query.speedRate||"1")),musicRenderType:decodeURIComponent(m.query.musicRenderType||"staff"),partIndex:Number(decodeURIComponent(m.query.partIndex||"0"))}),B=P(),{playStaff:ne,pauseStaff:se,updateProgressStaff:E}=pe();function ie(){const t=T==="Audio"?"#audioMediaSrc":"#videoMediaSrc";e=new De(t,{controls:["play","progress","current-time","duration"],fullscreen:{enabled:!1,fallback:!1}}),e.on("loadedmetadata",()=>{z.value=!0,e.currentTime=D.playProgress}),e.on("play",()=>{V.value=!1,ne()}),e.on("pause",()=>{V.value=!0,se()}),e.on("ended",()=>{e.currentTime=0,e.playing||setTimeout(()=>{E(e.currentTime)},100)}),e.on("seeked",()=>{e.playing||E(e.currentTime)})}function re(){let t;function s(l){l.preventDefault(),l.stopPropagation();const a=e.playing;e.pause();const o=W(l),S=o?l.touches[0]:l;A(S);function I(){document.removeEventListener(o?"touchmove":"mousemove",w),document.removeEventListener(o?"touchend":"mouseup",I),a&&e.play()}function w(g){g.preventDefault(),g.stopPropagation();const u=W(g)?g.touches[0]:g;A(u)}function A(g){const{top:u,height:v}=t.getBoundingClientRect(),d=(g.clientY-u)/v,R=Math.min(Math.max(d,0),1);e.currentTime=R*e.duration}document.addEventListener(o?"touchmove":"mousemove",w),document.addEventListener(o?"touchend":"mouseup",I)}function y(){t||(t=document.querySelector("#landscapeScreenPlay .plyr__progress__container")),t.addEventListener("mousedown",s),t.addEventListener("touchstart",s)}function c(){t.removeEventListener("mousedown",s),t.removeEventListener("touchstart",s)}return{registerDrag:y,unRegisterDrag:c}}function W(t){return window.TouchEvent&&t instanceof window.TouchEvent}function ce(t,s,y=128){const c=s.getContext("2d");let{width:l,height:a}=s.getBoundingClientRect();if(_.value){const u=l;l=a,a=u}s.width=l,s.height=a;const o=(u,v,{lineGap:d,canvWidth:R,canvHeight:me,canvFillColor:ge,lineColor:O})=>{if(!v)return;const F=R,Y=me;S(v,F,Y,ge);const L=u.length;let f=(F/2-d*L)/L;f<1&&(f=1);const Q=F/2,x=Y/2;let C=Q;for(let p=0;p<L;p++){const h=u[p]/255*x;c.fillStyle=O,p===0&&(C-=d/2),c.fillRect(C-f,x-h,f,h),c.fillRect(C-f,x,f,h),C-=f+d}let b=Q;for(let p=0;p<L;p++){const h=u[p]/255*x;c.fillStyle=O,p===0&&(b+=d/2),c.fillRect(b,x-h,f,h),c.fillRect(b,x,f,h),b+=f+d}},S=(u,v,d,R)=>{u.clearRect(0,0,v,d),u.fillStyle=R,u.fillRect(0,0,v,d)},I=()=>{const u=setInterval(()=>{if(w){clearInterval(u);return}o(ke(38),c,{lineGap:3,canvWidth:l,canvHeight:a,canvFillColor:"transparent",lineColor:"rgba(28,172,241, 0.58)"})},300)};let w=!0;return{playVisualDraw:()=>{w=!1,I()},pauseVisualDraw:()=>{w=!0,requestAnimationFrame(()=>{c.clearRect(0,0,l,a)})}}}function ue(t){t.stopPropagation(),D.playState=!!(e!=null&&e.playing),D.playProgress=(e==null?void 0:e.currentTime)||0,K.back()}function $(t){var s;if(!H&&T==="Audio"){H=!0;const y=document.querySelector("#audioMediaSrc"),c=document.querySelector("#audioVisualizer"),{pauseVisualDraw:l,playVisualDraw:a}=ce(y,c);e.on("play",()=>{a()}),e.on("pause",()=>{l()})}(s=t==null?void 0:t.target)!=null&&s.matches("button.plyr__control")||(e.playing?e.pause():e.play())}function le(){N?J({api:"setRequestedOrientation",content:{orientation:0}}):(M(),U(),window.addEventListener("resize",M),window.addEventListener("resize",U))}function M(){requestAnimationFrame(()=>{window.innerWidth>window.innerHeight?_.value=!1:_.value=!0})}const de=xe();j(de,t=>{t==="hidden"&&(e==null||e.pause())});function fe(){const t=`${Ie()}/instrument/#/simple-detail?id=${ee}&musicRenderType=${r.musicRenderType}&part-index=${r.partIndex}`;r.staffSrc=t,window.addEventListener("message",s=>{const{api:y,height:c}=s.data;y==="api_musicPage"&&(r.isShow=!0,r.height=c+"px",D.playState?$():E(e.currentTime))})}function pe(){let t=!0;const s=()=>{requestAnimationFrame(()=>{var a,o;(o=(a=B.value)==null?void 0:a.contentWindow)==null||o.postMessage({api:"api_playProgress",content:{currentTime:e.currentTime*r.speedRate}},"*"),t||s()})};return{playStaff:()=>{var a,o;r.isShow&&(t=!1,(o=(a=B.value)==null?void 0:a.contentWindow)==null||o.postMessage({api:"api_play"},"*"),s())},pauseStaff:()=>{var a,o;r.isShow&&(t=!0,(o=(a=B.value)==null?void 0:a.contentWindow)==null||o.postMessage({api:"api_paused"},"*"))},updateProgressStaff:a=>{var o,S;r.isShow&&((S=(o=B.value)==null?void 0:o.contentWindow)==null||S.postMessage({api:"api_updateProgress",content:{currentTime:a*r.speedRate}},"*"))}}}function U(){requestAnimationFrame(()=>{q.value=window.innerHeight})}return Be(()=>{fe(),ie(),le()}),Re(()=>{N?J({api:"setRequestedOrientation",content:{orientation:1}}):(window.removeEventListener("resize",M),window.removeEventListener("resize",U)),e==null||e.destroy()}),()=>i("div",{id:"landscapeScreenPlay",class:[n.playCreation,_.value&&n.landscapeScreen,!z.value&&n.notLoaded,X().isTablet&&n.ipadPlayCreation],style:{"--creationHeight":q.value?q.value+"px":"100vh"},onClick:t=>{r.isShow&&$(t)}},[i("div",{class:n.backBox},[i("img",{class:n.backImg,src:Le,onClick:ue},null),i("div",{class:n.musicDetail},[i("div",{class:n.musicSheetName},[i(qe,{text:Z,background:"none"},null)]),i("div",{class:n.username},[Pe("演奏:"),G])])]),T==="Audio"?i("div",{class:n.audioBox},[i("canvas",{class:n.audioVisualizer,id:"audioVisualizer"},null),i(Te,{class:n.audioBga,animationData:Ce,autoPlay:!0,loop:!0},null),i("audio",{crossorigin:"anonymous",id:"audioMediaSrc",src:k,controls:"false",preload:"metadata",playsinline:!0},null)]):i("video",{id:"videoMediaSrc",class:n.videoBox,src:k,"data-poster":te||Ve,preload:"metadata",playsinline:!0,"webkit-playsinline":!0},null),i("div",{class:[n.playLarge,V.value&&n.playIngShow]},null),r.staffSrc&&i("div",{class:[n.staffBox,r.isShow&&n.staffBoxShow],style:{"--staffBoxHeight":r.height}},[i("div",{class:n.mask},null),i("iframe",{ref:B,class:n.staff,frameborder:"0",src:r.staffSrc},null)]),!r.isShow&&i(be,null,null)])}});export{ct as default};
- ========
- import{d as he,V as X,P as _e,q as Se,r as P,w as j,x as we,aO as xe,y as Be,R as Re,Q as J,a as i,A as Pe,ae as Ie}from"./index-010a77d0.js";/* empty css */import{b as Le,a as Ce,L as be,P as De,g as ke}from"./back-0a409fe5.js";import{V as Te}from"./vue3-lottie.es-3f11cc3d.js";import{v as Ve}from"./videobg-a14c5ede.js";import{N as qe}from"./index-5932cf10.js";const Ee="_playCreation_1oxsf_1",Me="_landscapeScreen_1oxsf_7",Ue="_notLoaded_1oxsf_19",Ae="_videoBox_1oxsf_97",Fe="_ipadPlayCreation_1oxsf_101",Ne="_audioBox_1oxsf_101",ze="_audioBga_1oxsf_101",He="_audioBga1_1oxsf_122",We="_audioBga2_1oxsf_128",$e="_audioVisualizer_1oxsf_141",Oe="_playLarge_1oxsf_149",Ye="_playIngShow_1oxsf_161",Qe="_backBox_1oxsf_164",Xe="_backImg_1oxsf_171",je="_musicDetail_1oxsf_175",Je="_musicSheetName_1oxsf_178",Ke="_username_1oxsf_190",Ze="_staffBox_1oxsf_197",Ge="_staffBoxShow_1oxsf_207",et="_staff_1oxsf_197",tt="_mask_1oxsf_215",n={playCreation:Ee,landscapeScreen:Me,notLoaded:Ue,videoBox:Ae,ipadPlayCreation:Fe,audioBox:Ne,audioBga:ze,audioBga1:He,audioBga2:We,audioVisualizer:$e,playLarge:Oe,playIngShow:Ye,backBox:Qe,backImg:Xe,musicDetail:je,musicSheetName:Je,username:Ke,staffBox:Ze,staffBoxShow:Ge,staff:et,mask:tt},D={playState:!1,playProgress:0},ct=he({name:"playCreation",setup(){const{isApp:N}=X(),m=_e(),K=Se(),k=decodeURIComponent(m.query.resourceUrl||""),Z=decodeURIComponent(m.query.musicSheetName||""),G=decodeURIComponent(m.query.username||""),ee=decodeURIComponent(m.query.musicSheetId||""),te=decodeURIComponent(m.query.videoBgUrl||""),T=k.lastIndexOf("mp4")!==-1?"Video":"Audio",_=P(!1);let e;const V=P(!0),z=P(!1);let H=!1;const{registerDrag:ae,unRegisterDrag:oe}=re(),q=P(0);j(_,()=>{_.value?ae():oe()});const r=we({staffSrc:"",isShow:!1,height:"initial",speedRate:Number(decodeURIComponent(m.query.speedRate||"1")),musicRenderType:decodeURIComponent(m.query.musicRenderType||"staff"),partIndex:Number(decodeURIComponent(m.query.partIndex||"0"))}),B=P(),{playStaff:ne,pauseStaff:se,updateProgressStaff:E}=pe();function ie(){const t=T==="Audio"?"#audioMediaSrc":"#videoMediaSrc";e=new De(t,{controls:["play","progress","current-time","duration"],fullscreen:{enabled:!1,fallback:!1}}),e.on("loadedmetadata",()=>{z.value=!0,e.currentTime=D.playProgress}),e.on("play",()=>{V.value=!1,ne()}),e.on("pause",()=>{V.value=!0,se()}),e.on("ended",()=>{e.currentTime=0,e.playing||setTimeout(()=>{E(e.currentTime)},100)}),e.on("seeked",()=>{e.playing||E(e.currentTime)})}function re(){let t;function s(l){l.preventDefault(),l.stopPropagation();const a=e.playing;e.pause();const o=W(l),S=o?l.touches[0]:l;A(S);function I(){document.removeEventListener(o?"touchmove":"mousemove",w),document.removeEventListener(o?"touchend":"mouseup",I),a&&e.play()}function w(g){g.preventDefault(),g.stopPropagation();const u=W(g)?g.touches[0]:g;A(u)}function A(g){const{top:u,height:v}=t.getBoundingClientRect(),d=(g.clientY-u)/v,R=Math.min(Math.max(d,0),1);e.currentTime=R*e.duration}document.addEventListener(o?"touchmove":"mousemove",w),document.addEventListener(o?"touchend":"mouseup",I)}function y(){t||(t=document.querySelector("#landscapeScreenPlay .plyr__progress__container")),t.addEventListener("mousedown",s),t.addEventListener("touchstart",s)}function c(){t.removeEventListener("mousedown",s),t.removeEventListener("touchstart",s)}return{registerDrag:y,unRegisterDrag:c}}function W(t){return window.TouchEvent&&t instanceof window.TouchEvent}function ce(t,s,y=128){const c=s.getContext("2d");let{width:l,height:a}=s.getBoundingClientRect();if(_.value){const u=l;l=a,a=u}s.width=l,s.height=a;const o=(u,v,{lineGap:d,canvWidth:R,canvHeight:me,canvFillColor:ge,lineColor:O})=>{if(!v)return;const F=R,Y=me;S(v,F,Y,ge);const L=u.length;let f=(F/2-d*L)/L;f<1&&(f=1);const Q=F/2,x=Y/2;let C=Q;for(let p=0;p<L;p++){const h=u[p]/255*x;c.fillStyle=O,p===0&&(C-=d/2),c.fillRect(C-f,x-h,f,h),c.fillRect(C-f,x,f,h),C-=f+d}let b=Q;for(let p=0;p<L;p++){const h=u[p]/255*x;c.fillStyle=O,p===0&&(b+=d/2),c.fillRect(b,x-h,f,h),c.fillRect(b,x,f,h),b+=f+d}},S=(u,v,d,R)=>{u.clearRect(0,0,v,d),u.fillStyle=R,u.fillRect(0,0,v,d)},I=()=>{const u=setInterval(()=>{if(w){clearInterval(u);return}o(ke(38),c,{lineGap:3,canvWidth:l,canvHeight:a,canvFillColor:"transparent",lineColor:"rgba(28,172,241, 0.58)"})},300)};let w=!0;return{playVisualDraw:()=>{w=!1,I()},pauseVisualDraw:()=>{w=!0,requestAnimationFrame(()=>{c.clearRect(0,0,l,a)})}}}function ue(t){t.stopPropagation(),D.playState=!!(e!=null&&e.playing),D.playProgress=(e==null?void 0:e.currentTime)||0,K.back()}function $(t){var s;if(!H&&T==="Audio"){H=!0;const y=document.querySelector("#audioMediaSrc"),c=document.querySelector("#audioVisualizer"),{pauseVisualDraw:l,playVisualDraw:a}=ce(y,c);e.on("play",()=>{a()}),e.on("pause",()=>{l()})}(s=t==null?void 0:t.target)!=null&&s.matches("button.plyr__control")||(e.playing?e.pause():e.play())}function le(){N?J({api:"setRequestedOrientation",content:{orientation:0}}):(M(),U(),window.addEventListener("resize",M),window.addEventListener("resize",U))}function M(){requestAnimationFrame(()=>{window.innerWidth>window.innerHeight?_.value=!1:_.value=!0})}const de=xe();j(de,t=>{t==="hidden"&&(e==null||e.pause())});function fe(){const t=`${Ie()}/instrument/#/simple-detail?id=${ee}&musicRenderType=${r.musicRenderType}&part-index=${r.partIndex}`;r.staffSrc=t,window.addEventListener("message",s=>{const{api:y,height:c}=s.data;y==="api_musicPage"&&(r.isShow=!0,r.height=c+"px",D.playState?$():E(e.currentTime))})}function pe(){let t=!0;const s=()=>{requestAnimationFrame(()=>{var a,o;(o=(a=B.value)==null?void 0:a.contentWindow)==null||o.postMessage({api:"api_playProgress",content:{currentTime:e.currentTime*r.speedRate}},"*"),t||s()})};return{playStaff:()=>{var a,o;r.isShow&&(t=!1,(o=(a=B.value)==null?void 0:a.contentWindow)==null||o.postMessage({api:"api_play"},"*"),s())},pauseStaff:()=>{var a,o;r.isShow&&(t=!0,(o=(a=B.value)==null?void 0:a.contentWindow)==null||o.postMessage({api:"api_paused"},"*"))},updateProgressStaff:a=>{var o,S;r.isShow&&((S=(o=B.value)==null?void 0:o.contentWindow)==null||S.postMessage({api:"api_updateProgress",content:{currentTime:a*r.speedRate}},"*"))}}}function U(){requestAnimationFrame(()=>{q.value=window.innerHeight})}return Be(()=>{fe(),ie(),le()}),Re(()=>{N?J({api:"setRequestedOrientation",content:{orientation:1}}):(window.removeEventListener("resize",M),window.removeEventListener("resize",U)),e==null||e.destroy()}),()=>i("div",{id:"landscapeScreenPlay",class:[n.playCreation,_.value&&n.landscapeScreen,!z.value&&n.notLoaded,X().isTablet&&n.ipadPlayCreation],style:{"--creationHeight":q.value?q.value+"px":"100vh"},onClick:t=>{r.isShow&&$(t)}},[i("div",{class:n.backBox},[i("img",{class:n.backImg,src:Le,onClick:ue},null),i("div",{class:n.musicDetail},[i("div",{class:n.musicSheetName},[i(qe,{text:Z,background:"none"},null)]),i("div",{class:n.username},[Pe("演奏:"),G])])]),T==="Audio"?i("div",{class:n.audioBox},[i("canvas",{class:n.audioVisualizer,id:"audioVisualizer"},null),i(Te,{class:n.audioBga,animationData:Ce,autoPlay:!0,loop:!0},null),i("audio",{crossorigin:"anonymous",id:"audioMediaSrc",src:k,controls:"false",preload:"metadata",playsinline:!0},null)]):i("video",{id:"videoMediaSrc",class:n.videoBox,src:k,"data-poster":te||Ve,preload:"metadata",playsinline:!0,"webkit-playsinline":!0},null),i("div",{class:[n.playLarge,V.value&&n.playIngShow]},null),r.staffSrc&&i("div",{class:[n.staffBox,r.isShow&&n.staffBoxShow],style:{"--staffBoxHeight":r.height}},[i("div",{class:n.mask},null),i("iframe",{ref:B,class:n.staff,frameborder:"0",src:r.staffSrc},null)]),!r.isShow&&i(be,null,null)])}});export{ct as default};
- >>>>>>>> iteration-20250327-light:dist/assets/index-fb24ba51.js
|