Explorar o código

注释掉开场语音

任一存 hai 1 ano
pai
achega
5efa05a4f4
Modificáronse 3 ficheiros con 14 adicións e 9 borrados
  1. BIN=BIN
      src/assets/audios/loading-music.mp3
  2. 13 8
      src/components/StartUp.vue
  3. 1 1
      src/store/index.js

BIN=BIN
src/assets/audios/loading-music.mp3


+ 13 - 8
src/components/StartUp.vue

@@ -44,6 +44,7 @@
         webkit-playsinline="true"
         x5-video-player-type="h5"
         @play="onVideoPlay"
+        @ended="onVideoEnd"
       />
       <transition name="fade-in">
         <button
@@ -60,7 +61,7 @@
 import { ref, computed, watch, onMounted } from "vue"
 import { useRoute, useRouter } from "vue-router"
 import { useStore } from "vuex"
-import startupVoiceUrl from '@/assets/audios/startup-voice.mp3'
+// import startupVoiceUrl from '@/assets/audios/startup-voice.mp3'
 
 const route = useRoute()
 const router = useRouter()
@@ -100,22 +101,26 @@ watch(haveShownStartUp, (v) => {
   }
 })
 
-const startUpAudio = new Audio(startupVoiceUrl)
-startUpAudio.addEventListener('ended', () => {
+function onVideoEnd() {
   store.commit('setHaveShownStartUp', true)
-})
+}
+
+// const startUpAudio = new Audio(startupVoiceUrl)
+// startUpAudio.addEventListener('ended', () => {
+//   store.commit('setHaveShownStartUp', true)
+// })
 
 function onVideoPlay() {
-  setTimeout(() => {
-    startUpAudio.play()
-  }, 1000)
+  // setTimeout(() => {
+  //   startUpAudio.play()
+  // }, 1000)
 }
 
 const isShowSkip = ref(false)
 function onClickSkip() {
   videoEl.value.pause()
   store.commit('setHaveShownStartUp', true)
-  startUpAudio.pause()
+  // startUpAudio.pause()
 }
 </script>
 

+ 1 - 1
src/store/index.js

@@ -9,7 +9,7 @@ for (let index = 0; index < projectData['长轴展示文物清单'].length; inde
 export default createStore({
   state: {
     panoData: null,
-    haveShownStartUp: process.env.VUE_APP_CLI_MODE === 'dev' ? true : false,
+    haveShownStartUp: process.env.VUE_APP_CLI_MODE === 'dev' ? false : false,
     canStart: false,
     haveShownSceneEffect: [false, false, false],
     relicDataRaw: projectData['长轴展示文物清单'],