|
@@ -43,7 +43,7 @@
|
|
|
playsinline
|
|
|
webkit-playsinline="true"
|
|
|
x5-video-player-type="h5"
|
|
|
- @ended="onVideoEnd"
|
|
|
+ @play="onVideoPlay"
|
|
|
/>
|
|
|
<transition name="fade-in">
|
|
|
<button
|
|
@@ -60,11 +60,16 @@
|
|
|
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'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
const store = useStore()
|
|
|
|
|
|
+const canStart = computed(() => {
|
|
|
+ return store.state.canStart
|
|
|
+})
|
|
|
+
|
|
|
const loadingProgress = ref(0)
|
|
|
let loadingIntervalId = null
|
|
|
loadingIntervalId = setInterval(() => {
|
|
@@ -75,31 +80,16 @@ loadingIntervalId = setInterval(() => {
|
|
|
}
|
|
|
}, 30)
|
|
|
|
|
|
-const canStart = computed(() => {
|
|
|
- return store.state.canStart
|
|
|
-})
|
|
|
+const isShowVideo = ref(false)
|
|
|
function onClickStart() {
|
|
|
isShowVideo.value = true
|
|
|
videoEl.value.play()
|
|
|
-
|
|
|
setTimeout(() => {
|
|
|
isShowSkip.value = true
|
|
|
}, 2000)
|
|
|
}
|
|
|
|
|
|
-const isShowVideo = ref(false)
|
|
|
const videoEl = ref(null)
|
|
|
-// const startUpAudio =
|
|
|
-function onClickSkip() {
|
|
|
- videoEl.value.pause()
|
|
|
- store.commit('setHaveShownStartUp', true)
|
|
|
-}
|
|
|
-function onVideoEnd() {
|
|
|
- store.commit('setHaveShownStartUp', true)
|
|
|
-}
|
|
|
-
|
|
|
-const isShowSkip = ref(false)
|
|
|
-
|
|
|
const haveShownStartUp = computed(() => {
|
|
|
return store.state.haveShownStartUp
|
|
|
})
|
|
@@ -109,6 +99,24 @@ watch(haveShownStartUp, (v) => {
|
|
|
videoEl.value.play()
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+const startUpAudio = new Audio(startupVoiceUrl)
|
|
|
+startUpAudio.addEventListener('ended', () => {
|
|
|
+ store.commit('setHaveShownStartUp', true)
|
|
|
+})
|
|
|
+
|
|
|
+function onVideoPlay() {
|
|
|
+ setTimeout(() => {
|
|
|
+ startUpAudio.play()
|
|
|
+ }, 1000)
|
|
|
+}
|
|
|
+
|
|
|
+const isShowSkip = ref(false)
|
|
|
+function onClickSkip() {
|
|
|
+ videoEl.value.pause()
|
|
|
+ store.commit('setHaveShownStartUp', true)
|
|
|
+ startUpAudio.pause()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|