diff --git a/components/s-video/s-video.vue b/components/s-video/s-video.vue index 8cb2ff4..2c9c7fc 100644 --- a/components/s-video/s-video.vue +++ b/components/s-video/s-video.vue @@ -77,6 +77,7 @@ showLayer: false, isResVideo: false, failUrl: uni.$http.baseUrl +"/profile//images/fail.gif", + innerAudioContext: null, }; }, computed: { @@ -105,6 +106,10 @@ this.videoHeight = res.screenHeight; } }); + + this.innerAudioContext = uni.createInnerAudioContext(); + this.innerAudioContext.autoplay = true; + this.innerAudioContext.src = "/static/videos/supermario.mp3"; // this.videoContext = uni.createVideoContext("video_play"); // this.videoContext.requestFullScreen(); @@ -161,6 +166,7 @@ // 不为空表示答题错误展示返回重新选择 this.resCheck = true; this.question = false; + this.innerAudioContext.play(); } } }, @@ -174,6 +180,7 @@ this.resCheck = false; this.resVideoUrl = ""; this.isResVideo = true; + this.innerAudioContext.stop(); }, onMetadataLoaded(event) { if(this.isResVideo) { @@ -183,6 +190,7 @@ } }, nextQuestion(outId, obj) { + this.innerAudioContext.stop(); // 点击开始后先增加题次 if (2 == outId) { this.$api.addQuestionFre({ diff --git a/static/videos/supermario.mp3 b/static/videos/supermario.mp3 new file mode 100644 index 0000000..d6be84b Binary files /dev/null and b/static/videos/supermario.mp3 differ