mpmediaitemcollection

Bug in iPhone Library Access?

Hi, This code: MPMediaQuery *query = [MPMediaQuery artistsQuery]; NSArray *songsByArtist = [query collections]; for( MPMediaItemCollection *c in songsByArtist ) { NSLog(@"artist %@ has %u songs",[[c representativeItem] valueForProperty:MPMediaItemPropertyArtist], [[c items]count]); } works as expected. But this code: MPMediaQuery ...

Iphone development : Play MPMediaCollection using AVAudioPlayer

Hi.. I am trying to play music in ipod library using AVAudioPlayer. I have added the music items to using MPMedia framework but do not know how to read the MPMediaCollection so that they can passed to the AVAudioPlayer. Thanks for your help ...

Why is setting queue in a MPMusicPlayerController only adding first track in collection?

I have an Album object containing a MPMediaItemCollection of the album's tracks. When I add this collecton to the queue with the following line of code, only the first track gets added. [iPodMusicPlayer setQueueWithItemCollection:album.mediaItems]; Oddly enough when I add with the following line of code, everything works as expected....

Best Practices for persisting iPod Playlist (MPMediaItemCollection) across sessions

When using in-app audio in the iPhone SDK, it is possible to allow users to select a list from their ipod library and create an in-app local playlist. If I want to persist this choice, it is easy to serialize the data and write to file, then recover. Just vanilla like this, however, leads me to think there is going to be something wron...

How do I clear the queue of a MPMusicPlayerController?

I'm trying to replicate the clear queue functionality of the iPod application, however I can't create an empty MPMediaItemCollection with which to call setQueueWithItemCollection: e.g. [self.musicPlayer setQueueWithItemCollection:[MPMediaItemCollection collectionWithItems:[NSArray array]]]; where musicPlayer is a MPMusicPlayerControl...

How to Store MPMediaItemCollection object in NSUserDefault?

Hi All, In My Application i access ipod Library and choose the song. i want store that Song in NSUserDefault for save that song for reuse. But when i reload the application i get error and application get crashed. I use NSData to store that MPMediaItemCollection object. I use following code... Save collection is my MPMediaItemColl...

Returning iPod MediaItemCollection based on index

Hi, I'm currently working on an app that accesses a user's iPod library to generate data. The order is something like this: Do a generic MediaQuery that returns everything Iterate through MediaItemCollection and save title/artist info into an array Clear MediaItemCollection and retrieve required items later via title query However, t...

MPMediaPickerController in one view and the MPMediaPlayback in another view. How to?

Basically I have a three view stack. In the last view I got a MPMediaPickerController that lets the user pick a song from his/her library. The song is to be played later from the first view. How can I tell the player (in the first view) what should be played? One possibility would be to send a notification and include the MPMediaItemCol...

How can I use AVAssetExportSession to overwrite songs in my iPhone/iPod library?

So supposedly in the iOS 4 SDK you can edit and write to the user's iTunes library. I can successfully load an AVAsset from my iPhone/iPod library, but as a quick test I'm trying to just overwrite the same file right away using AVAssetExportSession but it's always returning the status "4" which I THINK is AVAssetExportSessionStatusFailed...

How can I store the song the user chose in my iPhone app and later retrieve it and play it?

Hello. I'm diving into iOS development and have been slowly building my own alarm clock app to learn how to develop on the platform. I want my alarm clock to allow me to display a list of songs on my iOS device, choose only one, and have it play when the alarm fires. I've figured out how to use the MPMediaPicker to display the list of...