Questions tagged [mpmediaitemcollection]

A media item collection is a sorted set of media items (instances of the MPMediaItem class) from the iPod library. Typically, you use this class by requesting an array of collections from a media query by way of its collections property.

A media item collection is a sorted set of media items (instances of the class) from the iPod library. Typically, you use this class by requesting an array of collections from a media query by way of its collections property.

The grouping type for the media query determines the arrangement of the media items you obtain. You also use the media query collections property to obtain synced playlists.

A media item collection can have a wide range of metadata associated with it. You access this metadata using the valueForProperty: method along with the property keys. You can also access metadata in a batch fashion using the enumerateValuesForProperties:usingBlock: method. In some cases, this is more efficient. Both of these methods are defined in MPMediaEntity (the abstract superclass of ).

External Resources

71 questions
1
vote
1 answer

MPMusicPlayerController setQueue and noPlayingItem defaults to index 0

When I try to change the queue of a MPMusicPlayerController and set the nowPlayingItem the player always goes to the first item in the queue. The documentation says if I want to set the current position in a queue I should set the nowPlayingItem to…
1
vote
1 answer

How to save MPMediaItemCollection to database?

I'm making an application that allows user make playlist and edit playlist , using MPMusicPlayerController. I already able to make playlist and then retrieve it so it can be played. What I don't know is how can I store…
Ega Setya Putra
  • 1,645
  • 6
  • 23
  • 51
1
vote
1 answer

Skip to Previous and Next song notification in MPMusicplayercontroller?

I am working on music player app where I am using MPMusicPlayerController iPodPlayer to play the songs. I want to receive skip to Next and Previous song notifications to my app when I am in forground when user skips from ipod music controller.…
1
vote
1 answer

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…
prendio2
  • 1,885
  • 17
  • 25
1
vote
2 answers

Play an MPMediaItemCollection in MPMusicPlayerController shuffled, but let user choose the first item?

I'm working on an application that integrates with the iPod Music app on iOS. It displays different music groupings (i.e., MPMediaItemCollections) and it allows the user to play these groupings in the Music app, using [MPMusicPlayerController…
1
vote
2 answers

How do I stop the MPMediaPickerController filling MPMediaItemCollection with duplicate MPMediaItems?

Im using this code to select tracks //open the media picker, allow the inport of any type of audio MPMediaPickerController *mediaPickerController = [[MPMediaPickerController alloc] initWithMediaTypes:…
1
vote
1 answer

Snooze Alarm in Alarm Clock Application in iPhone?

I've been working on Alarm Clock application and using local notifications to pop the alarm. I also need to snooze the alarm as per the time interval set by the user in user settings. The user cannot snooze until the application starts i.e below…
Aditya Mathur
  • 1,185
  • 17
  • 27
1
vote
1 answer

Can't play songs from bundle with iPodMusicPlayer in iOS

I am trying to play songs from bundle(document directory) in my app with iPodMusicPlayer. I don't want to play with AVPlayer. Here is some of my code: NSString *bundleRoot = [[NSBundle mainBundle] bundlePath]; NSFileManager *fm =…
Fire Fist
  • 7,032
  • 12
  • 63
  • 109
1
vote
1 answer

Regarding MPMediaItemCollection items lastObject

I'm setting N items in an MPMediaItemsCollection, where some items aren't unique (the collection represents a playlist, where the same song might appear twice). - (void)setLastSongWithItemCollection:(MPMediaItemCollection *)itemCollection { …
kid_x
  • 1,415
  • 1
  • 11
  • 31
1
vote
0 answers

Wrong playlist is playing when musicPlayer uses setQueueWithItemCollection:playlist

I am trying to load a playlist from my iTunes library using the following code. The code works for all playlist names except for the one called "Christmas & pop mix" (other playlist names also have an & in the name). For "Christmas & pop mix", the…
JeffB6688
  • 3,782
  • 5
  • 38
  • 58
1
vote
1 answer

Getting properties in batch for multiple MPMediaItems

With regards to MPMediaItem, is there a way to get a property for multiple items/for items in a media item collection, which is more efficient than calling valueForProperty: on each item separately? I'm aware of…
Danra
  • 9,546
  • 5
  • 59
  • 117
1
vote
1 answer

MPMusicPlayerController queue issues

I'm having some issues with my MPMusicPlayerController. It's an an iPodMusicPlayer, not an appmusicplayer. My problem is that I can not get the queue to play in the correct order. Let me explain further: I use an iPod picker to select a media…
Sean Danzeiser
  • 9,141
  • 12
  • 52
  • 90
0
votes
1 answer

UITableview + images from ipod library yielding choppy scrolling. Are there workarounds?

I have a UITableView that is loading a list of Albums from an MPMediaQuery. Everything had been working fine, until I noticed that an album with a non-square album art was pushing the label-text of a built-in cell view to the right. Noticing this…
solenoid
  • 954
  • 1
  • 9
  • 20
0
votes
0 answers

How to get MPMediaItem lyrics in swift 5

I checked some of SO answers but it doesn't work for me! I need to get lyrics for the current playing song. I get an empty result if I simply try to get lyrics from a media item: if var music = mediaItemCollection.items as? [MPMediaItem]{ …
Yogesh Patel
  • 1,893
  • 1
  • 20
  • 55
0
votes
1 answer

add item to MPMediaItemCollection from NSURL

In .plist file I keep NSURLs of audio files from iPod library. I need to initialize MPMediaItemCollection items by these urls. How can I do that? Thanks.
unkm
  • 43
  • 3