|
@@ -9,10 +9,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="screen" @click="click">
|
|
|
<video
|
|
|
+ muted
|
|
|
loop
|
|
|
- id="video"
|
|
|
x5-video-player-type="h5"
|
|
|
preload="metadata"
|
|
|
autoplay
|
|
@@ -52,6 +53,7 @@ import sex from "./pages/sex.vue";
|
|
|
|
|
|
// import { onMounted, reactive } from "vue";
|
|
|
import { ref, onMounted } from "vue";
|
|
|
+import audioFile from "../../assets/music/BGM.mp3";
|
|
|
// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
/**
|
|
|
* window.$originData.orginParames.title 页面标题
|
|
@@ -68,31 +70,23 @@ const page = ref("second");
|
|
|
// clearTimeout(time);
|
|
|
// page.value = "second";
|
|
|
// }, 5000);
|
|
|
+const audio = new Audio();
|
|
|
+audio.src = audioFile;
|
|
|
+audio.loop = true;
|
|
|
|
|
|
function click() {
|
|
|
const video = document.querySelector("video");
|
|
|
- video.play();
|
|
|
+ !video.playing && video.play();
|
|
|
+ !audio.playing && audio.play();
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
- const video = document.querySelector("video");
|
|
|
- video.play();
|
|
|
- document.addEventListener(
|
|
|
- "WeixinJSBridgeReady",
|
|
|
- function () {
|
|
|
- video.play();
|
|
|
- },
|
|
|
- false
|
|
|
- );
|
|
|
- document.addEventListener(
|
|
|
- "touchstart",
|
|
|
- function () {
|
|
|
- video.play();
|
|
|
- },
|
|
|
- false
|
|
|
- );
|
|
|
+ click();
|
|
|
+ document.addEventListener("WeixinJSBridgeReady", click, false);
|
|
|
+ document.addEventListener("touchstart", click, false);
|
|
|
});
|
|
|
function changePage(type) {
|
|
|
page.value = type;
|
|
|
+ if (type === "third") click();
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|