问题
I can't make this work, and I tried multiple methods, so far the suggestions maybe worked for static mp3 and other files, but for this stream, with controlls hidden I couldn't stop the autoplay, anything I tried.
Please check this jsfiddle
<audio id="player" autostart="0" autostart="false" name="media"><source id="liveatc_source" src="http://mtl2.liveatc.net/lrsb" type="audio/mpeg"></audio>
PS. it's a stream but you will probably not hear anything, unless there is some activity in my area, but to see if the stream autoplays or not, I used Inspect of Google chrome, and than check the Network tab, you will see the stream is loading coninously...
screenshot stream loading continously
回答1:
The solution was to use preload atribute like this:
<audio id="player" autostart="0" autostart="false" preload ="none" name="media">
来源:https://stackoverflow.com/questions/45132220/how-to-disable-autoplay-of-audio-stream-html5-element