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 ...
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
...
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....
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...
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...
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...
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...
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...
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...
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...