Commit c85c64a7 by vito

audio

parent d2dc5e3a
...@@ -89,7 +89,15 @@ ...@@ -89,7 +89,15 @@
Copyright©zhangyongfeng5350@gmail.com Copyright©zhangyongfeng5350@gmail.com
</span> </span>
<audio id="audiobg" :src="audioSrc" preload="auto" controls autoplay loop> <audio
id="audiobg"
preload="auto"
controls
autoplay
loop
@play="playHandler"
>
<source :src="audioSrc" />
你的浏览器不支持audio标签 你的浏览器不支持audio标签
</audio> </audio>
</div> </div>
...@@ -235,6 +243,9 @@ export default { ...@@ -235,6 +243,9 @@ export default {
}, 1000); }, 1000);
}, },
methods: { methods: {
playHandler() {
this.audioPlaying = true;
},
playAudio(type) { playAudio(type) {
if (type) { if (type) {
this.$el.querySelector('#audiobg').play(); this.$el.querySelector('#audiobg').play();
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment