Jonny
Jonny

Reputation: 16298

How to make the html5 audio tag work with iOS Safari

The audio tag on Safari does not seem to work...

Example:

http://iandevlin.com/html5/data-uri/audio.php

For me using iPhone 5s and iOS 7.1, the tag control says that the audio file cannot be played. Fix?

The code in the example above:

<audio controls src="data:audio/ogg;base64,T2dnUwACAAaaaaand so on" />

I need to use the data: method of providing the sound data in base64 format.

Upvotes: 2

Views: 2210

Answers (2)

Alastair
Alastair

Reputation: 6114

Unfortunately, iOS Safari won't process base 64 encoded audio. No idea why, but you have to store it as an external file.

Upvotes: 0

rckoenes
rckoenes

Reputation: 69459

OGG is not support on iOS.

As you can read in the Safari documentation:

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.

Upvotes: 3

Related Questions