|
@@ -31,14 +31,14 @@
|
|
<li
|
|
<li
|
|
@click="onIsBGM"
|
|
@click="onIsBGM"
|
|
v-tooltip="$t('menu.music')"
|
|
v-tooltip="$t('menu.music')"
|
|
- v-if="
|
|
|
|
- (metadata.backgroundMusic && metadata.backgroundMusic.id) || fdkkBGM
|
|
|
|
- "
|
|
|
|
|
|
+ v-if="isHasNormalBGM || isHasV4BGM"
|
|
>
|
|
>
|
|
<img
|
|
<img
|
|
:src="
|
|
:src="
|
|
require(`@/assets/images/icon/${
|
|
require(`@/assets/images/icon/${
|
|
- showMusicPlaying ? 'music@2x.png' : 'music_disabled@2x.png'
|
|
|
|
|
|
+ isPlayNormalBGM && isCurrentPlaying
|
|
|
|
+ ? 'music@2x.png'
|
|
|
|
+ : 'music_disabled@2x.png'
|
|
}`)
|
|
}`)
|
|
"
|
|
"
|
|
alt=""
|
|
alt=""
|
|
@@ -49,12 +49,12 @@
|
|
<li
|
|
<li
|
|
@click="onIsCommentary"
|
|
@click="onIsCommentary"
|
|
v-tooltip="$t('menu.commentary')"
|
|
v-tooltip="$t('menu.commentary')"
|
|
- v-if="currentScene.explanation && currentScene.explanation.audioUrl"
|
|
|
|
|
|
+ v-if="isHasExplanationBGM"
|
|
>
|
|
>
|
|
<img
|
|
<img
|
|
:src="
|
|
:src="
|
|
require(`@/assets/images/icon/${
|
|
require(`@/assets/images/icon/${
|
|
- showCommentaryPlaying
|
|
|
|
|
|
+ isPlayExplanationBGM && isCurrentPlaying
|
|
? 'commentary@2x.png'
|
|
? 'commentary@2x.png'
|
|
: 'commentary_disabled@2x.png'
|
|
: 'commentary_disabled@2x.png'
|
|
}`)
|
|
}`)
|
|
@@ -117,16 +117,27 @@ import { useApp } from "@/app";
|
|
import introduce from "./control/text";
|
|
import introduce from "./control/text";
|
|
import telephone from "./control/telephone";
|
|
import telephone from "./control/telephone";
|
|
import clink from "./control/link";
|
|
import clink from "./control/link";
|
|
-// import { useMusicPlayer, useSoundPlayer } from "@/utils/sound";
|
|
|
|
-
|
|
|
|
-// //背景音乐
|
|
|
|
-// const musicPlayer = useMusicPlayer();
|
|
|
|
-
|
|
|
|
-// //解说音乐
|
|
|
|
-// const soundPlayer = useSoundPlayer();
|
|
|
|
|
|
|
|
const store = useStore();
|
|
const store = useStore();
|
|
|
|
|
|
|
|
+//BMG音乐
|
|
|
|
+const isHasNormalBGM = computed(() => store.getters["audio/isHasNormalBGM"]);
|
|
|
|
+const isCurrentPlaying = computed(
|
|
|
|
+ () => store.getters["audio/isCurrentPlaying"]
|
|
|
|
+);
|
|
|
|
+const isHasV3BGM = computed(() => store.getters["audio/isHasV3BGM"]);
|
|
|
|
+const isHasV4BGM = computed(() => store.getters["audio/isHasV4BGM"]);
|
|
|
|
+const isHasExplanationBGM = computed(
|
|
|
|
+ () => store.getters["audio/isHasExplanationBGM"]
|
|
|
|
+);
|
|
|
|
+//BMG playing音乐
|
|
|
|
+const isPlayNormalBGM = computed(() => store.getters["audio/isPlayNormalBGM"]);
|
|
|
|
+const isPlayV3BGM = computed(() => store.getters["audio/isPlayV3BGM"]);
|
|
|
|
+const isPlayV4BGM = computed(() => store.getters["audio/isPlayV4BGM"]);
|
|
|
|
+const isPlayExplanationBGM = computed(
|
|
|
|
+ () => store.getters["audio/isPlayExplanationBGM"]
|
|
|
|
+);
|
|
|
|
+
|
|
const metadata = computed(() => store.getters["scene/metadata"]);
|
|
const metadata = computed(() => store.getters["scene/metadata"]);
|
|
|
|
|
|
const isDoneforCover = computed(() => store.getters["scene/isDoneforCover"]);
|
|
const isDoneforCover = computed(() => store.getters["scene/isDoneforCover"]);
|
|
@@ -154,65 +165,6 @@ const customLink = computed(() => store.getters["scene/customLink"]);
|
|
// const fdkkmetadata = computed(() => store.getters["fdkk/metadata"]);
|
|
// const fdkkmetadata = computed(() => store.getters["fdkk/metadata"]);
|
|
const fdkkBGM = computed(() => store.getters["fdkk/fdkkBGM"]);
|
|
const fdkkBGM = computed(() => store.getters["fdkk/fdkkBGM"]);
|
|
|
|
|
|
-// const setExplanation = (from) => {
|
|
|
|
-// if (
|
|
|
|
-// "explanation" in currentScene.value &&
|
|
|
|
-// "audioUrl" in currentScene.value.explanation
|
|
|
|
-// ) {
|
|
|
|
-// console.log("设置解说", from);
|
|
|
|
-// let { audioUrl, openByDefault, repeat } = currentScene.value.explanation;
|
|
|
|
-// // showCommentaryPlaying.value = false;
|
|
|
|
-// store.commit("functions/setCommentaryUrl", {
|
|
|
|
-// src: audioUrl,
|
|
|
|
-// loop: repeat,
|
|
|
|
-// openByDefault: openByDefault,
|
|
|
|
-// });
|
|
|
|
-// useSoundPlayer.player.isLock = false;
|
|
|
|
-// useSoundPlayer.player.watchPlay();
|
|
|
|
-// }
|
|
|
|
-// };
|
|
|
|
-// 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();
|
|
|
|
-// };
|
|
|
|
-// const resetExplanation = (from) => {
|
|
|
|
-// console.log("清空解说", from);
|
|
|
|
-// store.commit("functions/setCommentaryUrl", "");
|
|
|
|
-// useSoundPlayer.player.isLock = true;
|
|
|
|
-// soundPlayer.paused();
|
|
|
|
-// };
|
|
|
|
-// watch([isShowCover, isDoneforCover], (val) => {
|
|
|
|
-// 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;
|
|
|
|
-
|
|
|
|
-// if (audioUrl) {
|
|
|
|
-// //解说有变,初始化按钮状态
|
|
|
|
-// setExplanation(1);
|
|
|
|
-// if (unref(isShowCover)) {
|
|
|
|
-// stopExplanation(1);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// resetExplanation(1);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// resetExplanation(2);
|
|
|
|
-// }
|
|
|
|
-// });
|
|
|
|
const showIntroduce = computed(() => store.getters["functions/showIntroduce"]);
|
|
const showIntroduce = computed(() => store.getters["functions/showIntroduce"]);
|
|
const showTelephone = computed(() => store.getters["functions/showTelephone"]);
|
|
const showTelephone = computed(() => store.getters["functions/showTelephone"]);
|
|
const showLink = computed(() => store.getters["functions/showLink"]);
|
|
const showLink = computed(() => store.getters["functions/showLink"]);
|
|
@@ -236,16 +188,32 @@ const onLink = () => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-// const onIsBGM = () => {
|
|
|
|
-// showMusicPlaying.value ? musicPlayer.pause() : musicPlayer.play();
|
|
|
|
-// };
|
|
|
|
|
|
+const onIsBGM = () => {
|
|
|
|
+ if (!unref(isPlayNormalBGM)) {
|
|
|
|
+ store.dispatch("audio/playBGM", 0);
|
|
|
|
+ } else {
|
|
|
|
+ if (unref(isCurrentPlaying)) {
|
|
|
|
+ store.dispatch("audio/pauseBGM");
|
|
|
|
+ } else {
|
|
|
|
+ store.dispatch("audio/playBGM", 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
const onIsAutoRotate = (data) => {
|
|
const onIsAutoRotate = (data) => {
|
|
store.commit("functions/setAutoRotate", !isAutoRotate.value);
|
|
store.commit("functions/setAutoRotate", !isAutoRotate.value);
|
|
};
|
|
};
|
|
|
|
|
|
-const onIsCommentary = (data) => {
|
|
|
|
- showCommentaryPlaying.value ? soundPlayer.pause() : soundPlayer.play();
|
|
|
|
|
|
+const onIsCommentary = () => {
|
|
|
|
+ if (!unref(isPlayExplanationBGM)) {
|
|
|
|
+ store.dispatch("audio/playBGM", 3);
|
|
|
|
+ } else {
|
|
|
|
+ if (unref(isCurrentPlaying)) {
|
|
|
|
+ store.dispatch("audio/pauseBGM");
|
|
|
|
+ } else {
|
|
|
|
+ store.dispatch("audio/playBGM", 3);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
const onFullScreen = () => {
|
|
const onFullScreen = () => {
|