Android Chrome <audio> Element Doesn’t Play from Javascript
The problem: You are calling play() on an audio element, but playback doesn’t start on Chrome on Android.
The cause: There appears to be a feature in Chrome on Android which restricts <audio> tags from playing unless “authorised” by a user click. Calls to “play” will have no effect until the user clicks on the play button of the element, or a call to play is made inside a click handler.
Possible solution: No solution appears to be possible unless there is a click of some sort between creating the element and your first required play() call. However, if there is a such an event, calling play and then immediately calling pause will “authorise” the element.
Leave a comment