O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Playing an audio file

This recipe will describe the process of playing an audio file from a web application designed specifically for the iOS operating system. We'll learn three different ways for playing a file with our various frameworks.

This recipe shows a simple method for playing audio, but you can integrate it with your own code or application for building more sophisticated applications.

We're going to play an audio file in MP3 format; however, other audio formats, such as WAF and AAC-LC, can be played as well.

Our recipe describes how to display a simple player with controls for playing and pausing a specific and preloaded MP3 file.

For one of the three approaches explained in our recipe, we don't need any framework because we'll take advantage ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required