报错内容
<audio
id="audioVoice"
:key="Math.random()"
:autoplay="false"
>
<source :src="countdownAudio" type="audio/mpeg">
</audio>
尝试加载后立即播放音频,有报错:
问题原因
引用:
It´s because Google updated its Autoplay Policy, it is necessary for the user to make some interaction first with the window in which the sound will be played, for example a ‘Start’ button then you can play the sound. This happened because for many users it is annoying when a sound is played out of nowhere.
解决方法
页面开启后,点击一下页面。。。。
暂时没想到好办法。。。