The AV Foundation framework in the iOS SDK allows developers to play and/or record audio and video with ease. In addition, the Media Player framework allows developers to play audio and video files.
Before you can run the code in this chapter, you must add the AVFoundation.framework and MediaPlayer.framework frameworks to your Xcode project. You can do this by following these steps:
In Xcode, click on your project’s icon (a blue icon).
Select the target to which you want to add the framework.
On the top, select Build Phases.
Select the + button in the bottom-left corner of the Link Binaries with Libraries box.
Hold down the Command key and choose AVFoundation.framework and MediaPlayer.framework from the list.