|
@@ -9,7 +9,7 @@ import { handleStartTick } from "./view/tick";
|
|
|
import { audioListStart, getAudioCurrentTime, getAudioDuration, setAudioCurrentTime, setAudioPlaybackRate, audioData } from "./view/audio-list";
|
|
|
import { toggleFollow } from "./view/follow-practice";
|
|
|
import { browser, setStorageSpeed, setGlobalData } from "./utils";
|
|
|
-import { api_cloudGetMediaStatus, api_createMusicPlayer, api_cloudChangeSpeed, api_cloudSuspend, api_cloudSetCurrentTime } from "./helpers/communication";
|
|
|
+import { api_cloudGetMediaStatus, api_createMusicPlayer, api_cloudChangeSpeed, api_cloudSuspend, api_cloudSetCurrentTime, api_cloudDestroy } from "./helpers/communication";
|
|
|
import { verifyCanRepeat, getDuration } from "./helpers/formateMusic";
|
|
|
import { getMusicSheetDetail } from "./utils/baseApi"
|
|
|
import { getQuery } from "/src/utils/queryString";
|
|
@@ -434,6 +434,7 @@ const state = reactive({
|
|
|
audiosInstance: null as any,
|
|
|
/** midi音频的时长 */
|
|
|
durationNum: 0,
|
|
|
+ midiSectionStart: 0,
|
|
|
});
|
|
|
const browserInfo = browser();
|
|
|
let offset_duration = 0;
|
|
@@ -490,6 +491,10 @@ const autoResetPlay = () => {
|
|
|
/** 播放完成事件 */
|
|
|
export const onEnded = () => {
|
|
|
console.log("音频播放结束");
|
|
|
+ // if (state.isAppPlay) {
|
|
|
+ // // 销毁播放器
|
|
|
+ // api_cloudDestroy();
|
|
|
+ // }
|
|
|
// 修改状态为结束
|
|
|
state.playEnd = true;
|
|
|
state.playState = "paused";
|
|
@@ -592,6 +597,7 @@ export const skipNotePlay = async (itemIndex: number, isStart = false) => {
|
|
|
songID: state.examSongId,
|
|
|
})
|
|
|
audioData.progress = itemTime
|
|
|
+ state.midiSectionStart = itemTime
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -742,7 +748,7 @@ export const getNote = (currentTime: number) => {
|
|
|
const times = state.times;
|
|
|
const len = state.times.length;
|
|
|
/** 播放超过了最后一个音符的时间,直接结束, 2秒误差 */
|
|
|
- if (currentTime > times[len - 1].endtime + 2) {
|
|
|
+ if (currentTime > times[len - 1].endtime + 2 && !state.isAppPlay) {
|
|
|
onEnded();
|
|
|
return;
|
|
|
}
|