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

Creating an iPod playlist and playing a specific item

As other modern smartphones, iPhone has the capability to reproduce audio files in different formats as MP3 and AAC. Also, other devices running the iOS operating systems — as iPad and iPod Touch — include the same feature. Keeping in mind this fact, it would be interesting to create a list with some items in a similar way to the iPod application included in iPhone.

This recipe shows how to create a simple list with some items that can be played when the user clicks on each one. For each item in the list, we'll display information about it as the title and duration of each song.

For simplicity, we're going to use some preview songs from iTunes as items for our list.

Getting ready

Check whether ...

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