Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the limitations of HTML5 audio on Android and iOS?

I've noticed that for the HTML5 Audio element, what works on the latest version of Chrome for PCs will not necessarily work on the default browser in Android, Chrome for Android, or Safari on iOS.

What limitations exist for Audio on these platforms?

Specifically:

  • Which audio formats are supported on each platform?
  • For each platform, is a user interaction event (eg. onclick) required to play audio from javascript? (via new Audio(url);)
  • Can audio be played from a data URI on the Android and iOS Audio element?
  • Are there any other major limitations (or bugs) for HTML5 Audio on these platforms?
like image 947
James Avatar asked Sep 04 '13 00:09

James


2 Answers

Summary

MP3 seems to be the best bet for broad platform coverage. It is supported by the newest versions of all major desktop and mobile browsers. (Safari on iOS & Chrome on Android)

At the moment, playback through DataURIs is limited mainly to desktop browsers, but will soon become available in Android.

Android (default browser)

Formats

  • Ogg Vorbis: Yes
  • MP3: Yes
  • FLAC: No (not 100% certain)

Data URIs

Yes

Autoplay allowed

TBC

User interaction event required

TBC

Limitations

  • Full audio doesn't seem to play. (tested with short sounds)

Android (Chrome)

Formats

  • Ogg Vorbis: Yes
  • MP3: Yes
  • FLAC: Yes

Data URIs

Yes (bug fixed in Chrome 34, which is currently in beta)

Autoplay allowed

No (bug)

User interaction event required

Yes

Limitations

  • "ended" event never fires. (bug)
  • "ended" event doesn't have user interaction privileges, so audio cannot be chained. (bug)

iOS

Formats

  • Ogg Vorbis: No
  • MP3: Yes
  • FLAC: No

Data URIs

No (workaround for iOS 6; no known workaround for iOS 6+)

Autoplay allowed

TBC

User interaction event required

TBC

Limitations

TBC


Format tests performed using http://hpr.dogphilosophy.net/test/

like image 124
12 revs Avatar answered Oct 21 '22 10:10

12 revs


Which audio formats are supported on each platform?

iOS: AAC audio, MP3 audio, AIF audio, WAVE audio

Safari on iOS (including iPad) currently supports uncompressed WAV and AIF audio, MP3 audio, and AAC-LC or HE-AAC audio. HE-AAC is the preferred format.

Safari on iOS (including iPad) currently supports MPEG-4 video (Baseline profile) and QuickTime movies encoded with H.264 video (Baseline profile) and one of the supported audio types.

iPad and iPhone 3G and later support H.264 Baseline profile 3.1. Earlier versions of iPhone support H.264 Baseline profile 3.0.

Links:

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

Android : MP3

Link:

http://html5test.com/compare/browser/android23/android40/android22.html

You can follow this link to test the supported audio format

http://hpr.dogphilosophy.net/test/

For each platform, is a user interaction event (eg. onclick) required to play audio from javascript?

No, it can also play automatically.

http://www.w3schools.com/tags/att_video_autoplay.asp

Can audio be played from a data URI on the Android and iOS Audio element?

Here is the link which explains the probability to play audio using data URI

Is it possible to use data URIs in video and audio tags?

Are there any other major limitations of HTML5 Audio on these platforms?

Here is the link which explains the linitations

http://www.ibm.com/developerworks/library/wa-ioshtml5/

http://blog.chenalexander.com/2011/limitations-of-layering-html5-audio/

like image 24
sourav Avatar answered Oct 21 '22 11:10

sourav