|
@@ -161,7 +161,7 @@ const setExplanation = (from) => {
|
|
|
) {
|
|
|
console.log("设置解说", from);
|
|
|
let { audioUrl, openByDefault, repeat } = currentScene.value.explanation;
|
|
|
- showCommentaryPlaying.value = false;
|
|
|
+ // showCommentaryPlaying.value = false;
|
|
|
store.commit("functions/setCommentaryUrl", {
|
|
|
src: audioUrl,
|
|
|
loop: repeat,
|
|
@@ -169,13 +169,15 @@ const setExplanation = (from) => {
|
|
|
});
|
|
|
useSoundPlayer.player.isLock = false;
|
|
|
useSoundPlayer.player.watchPlay();
|
|
|
- }
|
|
|
+ }
|
|
|
};
|
|
|
-const stopExplanation = () => {
|
|
|
+const stopExplanation = (from) => {
|
|
|
+ console.log("stop解说", from);
|
|
|
useSoundPlayer.player.isLock = true;
|
|
|
soundPlayer.paused();
|
|
|
};
|
|
|
const resumeExplanation = () => {
|
|
|
+ console.log("resume解说");
|
|
|
useSoundPlayer.player.isLock = false;
|
|
|
useSoundPlayer.player.watchPlay();
|
|
|
};
|
|
@@ -183,13 +185,17 @@ const resetExplanation = (from) => {
|
|
|
console.log("清空解说", from);
|
|
|
store.commit("functions/setCommentaryUrl", "");
|
|
|
useSoundPlayer.player.isLock = true;
|
|
|
- soundPlayer.pause();
|
|
|
+ soundPlayer.paused();
|
|
|
};
|
|
|
watch([isShowCover, isDoneforCover], (val) => {
|
|
|
- if (val[0] && val[1]) {
|
|
|
+ if (unref(val[0]) && unref(val[1])) {
|
|
|
resumeExplanation(2);
|
|
|
}
|
|
|
+ if (unref(val[0]) && !unref(val[1])) {
|
|
|
+ stopExplanation(2);
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
watchEffect(() => {
|
|
|
if (currentScene.value.explanation) {
|
|
|
let { audioUrl } = currentScene.value.explanation;
|
|
@@ -197,17 +203,16 @@ watchEffect(() => {
|
|
|
if (audioUrl) {
|
|
|
//解说有变,初始化按钮状态
|
|
|
setExplanation(1);
|
|
|
+ if (unref(isShowCover)) {
|
|
|
+ stopExplanation(1);
|
|
|
+ }
|
|
|
} else {
|
|
|
resetExplanation(1);
|
|
|
}
|
|
|
} else {
|
|
|
resetExplanation(2);
|
|
|
}
|
|
|
- if (unref(isShowCover)) {
|
|
|
- stopExplanation();
|
|
|
- }
|
|
|
});
|
|
|
-
|
|
|
const showIntroduce = computed(() => store.getters["functions/showIntroduce"]);
|
|
|
const showTelephone = computed(() => store.getters["functions/showTelephone"]);
|
|
|
const showLink = computed(() => store.getters["functions/showLink"]);
|