Play Audio Button

[Solved] Play Audio Button | Swift - Code Explorer | yomemimo.com
Question : play audio button

Answered by : evil-elk-iu0nm1u3xxvg

<script>
var audio = new Audio("http://music.ogg" ) ;
audio.oncanplaythrough = function(){
audio.play();
}
audio.loop = true;
audio.onended = function(){
audio.play();
}
</script>
<input type="image" src="http://button.png" onclick="audio.play()">

Source : https://stackoverflow.com/questions/18826147/javascript-audio-play-on-click | Last Update : Wed, 24 Feb 21

Answers related to play audio button

Code Explorer Popular Question For Swift