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
2
votes
0 answers

Using media query to manage media item picker selected collections?

In the iPod Library Access Guide, at page 16 (where it explains about media query usage) there is a description like this, after describing the usage for MPMediaQuery: You can construct your own collections as well. This can be useful, for…
2
votes
1 answer

Place mediaItemCollection data in UITableView

I need some help placing the mediaItemCollection data in a UITableView. Code: // Responds to the user tapping Done after choosing music. - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems:(MPMediaItemCollection…
Aleksander Azizi
  • 9,829
  • 9
  • 59
  • 87
2
votes
2 answers

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…
2
votes
1 answer

Play items from MPMediaItemCollection in AVPlayer [Swift]

Here is the thing, I have a MPMediaItemCollection with user choosen items(from the library). I used the mediaPicker to do that. Now, I need to get the URL from these items so I can play them on a AVPlayer. This is the best I can find, but when I…
2
votes
1 answer

Conversion of raw music file from main bundle to MPMediaItem

is there any way I can get reference of MPMediaItem from raw mp3 file bundled in main bundle as a resource? Thanks in advance.
Saty
  • 2,563
  • 3
  • 37
  • 88
2
votes
1 answer

Fetch list of all artists from iOS Media Library

I wish to fetch a MPMediaItemCollection or NSArray of all artists in a user's library. Here's my current code (which obviously doesn't work): - (void)viewDidLoad { [super viewDidLoad]; MPMediaQuery *artistsQuery = [MPMediaQuery…
duci9y
  • 4,128
  • 3
  • 26
  • 42
1
vote
2 answers

MPMediaItemCollection Whole Library?

Does anyone know if it's possible to create an MPMediaItemCollection object containing every song in a users iPod library without the user having to select it using the MPMediaPicker stuff? Like, on application launch perhaps. Thanks...
Adam Waite
  • 19,175
  • 22
  • 126
  • 148
1
vote
1 answer

Is it possible to uniquely identify duplicate MPMediaItems within an MPMediaCollection?

I am using an MPMediaItemCollection to hold a number of user selected music tracks from the iPod music library. I want to be able to uniquely identify each MPMediaItem within the collection even if they are duplicated. Is this possible?
1
vote
1 answer

MPMediaItemCollection Delete selected que/collection?

I am currently looking at Apple's AddMusic example and playing around with it before I start rewriting it into my application. I noticed that it makes its own little playlist of the songs qued. I want to use the swipe action on the table view to…
Dan
  • 11
  • 3
1
vote
1 answer

Big problems when adding the same MPMediaItem into an iPod queue - how can I track which one is playing?

I've had a few complaints about my app, InstanTunes, when people are adding the same song twice to the queue, which is queued in the iPod app. [[MPMusicPlayerController iPodMusicPlayer] setQueueWithItemCollection:collection]; Basically, the problem…
Craig
  • 863
  • 7
  • 7
1
vote
0 answers

How to play mediaItemCollection using AVAudioPlayer

I think variable mediaItemCollection of func mediaPicker of https://developer.apple.com/documentation/mediaplayer/displaying_a_media_picker_from_your_app have music files information I selected. I would like to play music files of…
Yun
  • 75
  • 6
1
vote
1 answer

How do i save MPMediaItemCollection to NSUSerDefaults?

Anybody know how to do this? The standard method will not work. I want the user to pick a song, and then have it save for the next time they load the app, but i can't seem to get it into NSUserDefaults.
Andrew
  • 15,935
  • 28
  • 121
  • 203
1
vote
1 answer

How to add MPMediaItem to MPMediaItemCollection

I hope to play MPMediaItemcollection using MPMusicPlayerController. musicPlayer = [MPMusicPlayerController applicationMusicPlayer]; I have got the handler of MPMediaItem *mediaItem. How can I add MPMediaItem to MPMediaItemCollection? I try…
arachide
  • 8,006
  • 18
  • 71
  • 134
1
vote
1 answer

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

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…
BeachRunnerFred
  • 18,070
  • 35
  • 139
  • 238
1
vote
0 answers

loading playlist artwork like in the music app

I'm looking for an solution to display my artwork like in the apple music application. I'm able to load one artwork for the playlist but I want to be able to show 4 of the artworks as a playlist representative. Currently I'm using this code for my…
NoSixties
  • 2,443
  • 2
  • 28
  • 65