Skip to content Skip to sidebar Skip to footer

Playing Audio On Mobile Browser Throgh Html Audio Tag

how can we play audio on mobile broswer is playing on desktop browser but not playing on mobile what is the solution for the particular problem.. code is var audio=new Audio('sou

Solution 1:

Mobile Safari, and probably others, only allow audio to play in response to a user action. So element.addEventListener( 'click', () => audio.play() ) will work, but the autoplay attribute or document.addEventListener('DOMContentLoaded', () => audio.play() ) won't.


Post a Comment for "Playing Audio On Mobile Browser Throgh Html Audio Tag"