Skip to content Skip to sidebar Skip to footer

Audio Delay On Html5 Mobile Web App

I'm developing a mobile web app using HTML5 & Javascript. The goal is to have a page with buttons that play sound after touch events, using the HTML5 audio tag. But I'm noticin

Solution 1:

The audio delay may be because of buffering issues in iOS that are there due to cellular data charges. The user has to explicitly trigger the event in order for the content to start being downloaded.

In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad="play()" event does not.

-https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW1

=== EDIT ===

One potential improvement is to use lower bitrate/ higher compressed audio for mobile products. The quality will, however, be significantly reduced. Use only if it is acceptable in your application.

Post a Comment for "Audio Delay On Html5 Mobile Web App"