Chapter 8. Multimedia

WHAT'S IN THIS CHAPTER?

  • How to access the iPod library to retrieve music and video

  • How to use the iOS 4 AVPlayer to play a movie

  • Quickly adding a movie player to your application using the MPMoviePlayerViewController class

It would be safe to say that it's the media capabilities of the iPhone, iPad, and iPod touch that accounts for their popularity. Integration with iTunes has brought these devices to the next level.

This chapter describes how to write media-rich applications. For audio, the techniques and frameworks are demonstrated; and for video, two approaches are compared side by side within one application. The AVPlayer class is an iOS 4 addition, and with iOS 3.2 the MPMoviePlayerViewController class enabled video capability with just a few Objective-C statements.

The best thing about this chapter is it shows you how to retrieve both audio and video from the iPod library. For video, I have created a standalone class so you can easily add this capability to your own applications!

FRAMEWORKS FOR AUDIO

Writing applications that involve the processing of audio has typically been a complicated task. With the iOS frameworks, examined in this section, the task is vastly simplified.

When working with audio, you may forget that your iPhone or iPad devices are not dedicated audio tools; they have to respond to higher-priority events, such as phone calls, and alarms. Responding to these interruptions should be an important factor in your applications design.

Media Player ...

Get Professional iPhone® and iPad™ Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.