Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

9. Core Audio > Using the iPod Music Library

Using the iPod Music Library

There are two primary audio-based players available in the iOS SDK. The first is designed specifically to play music from a user’s iPod Music Library by working with the iPod music Now Playing session. Additionally, this player offers necessary APIs to interact with the metadata associated with iPod media items.

Playing music from a user’s music library involves two simple steps:

1. Obtain a reference to the media object or objects using MPMediaPickerController.

2. Set the selected media items as the collection associated with a new MPMusicPlayerController object.


image Note

You can download a complete project that uses the iPod Music Library at iOSCoreFrameworks.com/download#chapter-9.


Media Picker Controller

The media picker controller (MPMediaPickerController) is a simple delegate-based view controller designed to give you complete access to a user’s music library. When you create a new media picker controller, that controller is presented as a child view controller to the current view controller. iOS will then present the media picker controller modally, allowing the user to navigate their music library and select designed media objects (depending on the asset types allowed in the configuration of the controller).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial