|
@@ -134,10 +134,11 @@ export default {
|
|
newURL = url
|
|
newURL = url
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
commit('setV4BGM', { url: newURL, repeat: true, isAuto: true });
|
|
commit('setV4BGM', { url: newURL, repeat: true, isAuto: true });
|
|
},
|
|
},
|
|
- playBGM({ commit, getters, state }, type) {
|
|
|
|
|
|
+ playBGM({ commit, getters, state, dispatch }, type) {
|
|
|
|
+ console.warn('~~playBGM~~', type);
|
|
|
|
+ debugger;
|
|
const index = getters['currentAudio'].order;
|
|
const index = getters['currentAudio'].order;
|
|
const order = index + 1;
|
|
const order = index + 1;
|
|
const target = getters['bgmList'].find(i => i.type === type);
|
|
const target = getters['bgmList'].find(i => i.type === type);
|
|
@@ -158,6 +159,10 @@ export default {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
console.error('当前BGM没有URL', target);
|
|
console.error('当前BGM没有URL', target);
|
|
|
|
+ if (type === 2) {
|
|
|
|
+ //fallback
|
|
|
|
+ dispatch('playBGM', 0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -171,7 +176,7 @@ export default {
|
|
resumeBGM() {
|
|
resumeBGM() {
|
|
const { currentPlayer } = useAudio();
|
|
const { currentPlayer } = useAudio();
|
|
if (unref(currentPlayer)) {
|
|
if (unref(currentPlayer)) {
|
|
- currentPlayer.value.play();
|
|
|
|
|
|
+ currentPlayer.value.resume();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
updatePlayerStatus({ commit }, status) {
|
|
updatePlayerStatus({ commit }, status) {
|