I have a web application that uses the HTML5 <audio> and for some reason, although it works fine on computers with Windows and Mac, it does not work on iOS and Android. Here is the relevant snippet of my code:
JavaScript:
var audioElement = document.querySelector('#audioplayer'); var source = document.querySelector('#mp3'); source.src = tokObject._url; audioElement.load(); audioElement.play();
HTML:
<center> <audio id="audioplayer" style="width:480px;"> <source id="mp3" src="random-placeholder" type="audio/mp3" /> </audio> </center>
javascript android html5 ios audio
Pavel zagalsky
source share