Questions tagged [mpmediaquery]

A media query specifies a set of media items (instances of MPMediaItem) from the iPod library by way of a filter and a grouping type. Filter and grouping type are both optional; an unqualified query matches the entire library.

A media query specifies a set of media items (instances of MPMediaItem) from the iPod library by way of a filter and a grouping type. Filter and grouping type are both optional; an unqualified query matches the entire library.

170 questions
5
votes
4 answers

NSNumber for MPMediaItemPropertyPersistentID to NSString and back again

I'm looping through all the songs from an iPhone's music library using the following code: NSArray * songs = [[NSArray alloc] initWithArray:[[MPMediaQuery songsQuery] collections]]; for (MPMediaItemCollection * item in songs){ NSString *…
Tom Irving
  • 10,041
  • 6
  • 47
  • 63
5
votes
2 answers

How to get MPMediaItem (song) listening times (dates)

I wanna get song's listening times in a certain period. Using MPMediaItemPropertyLastPlayedDate I only get the date of the last time a song was played, so if a I play a song multiple times a day, only the last time will count. Basically, what I…
5
votes
3 answers

How to retrieve Artist lists with MPMediaQuery?

Hello i am trying to retrieve Artist with MPMediaQuery in iOS with following code. In My ViewDidLenter code hereoad MPMediaQuery *query = [MPMediaQuery artistsQuery]; self.arrayOfArtist = [query collections]; And In my cellForRowAtIndexPath …
Fire Fist
  • 7,032
  • 12
  • 63
  • 109
5
votes
2 answers

How to play MPMediaItem in MPMusicPlayerController in iOS?

I am trying to play MPMedaiItem in MPMusicPlayerController in iOS. In my case , i have a UITableView that show songs from playlist. When i tap cell on UITableView , i want to play that song with MPMusicPlayerController. And i also want to skip next…
Fire Fist
  • 7,032
  • 12
  • 63
  • 109
5
votes
6 answers

Number of Albums By Artists

That's my Question =) MPMediaQuery *artistQuery = [MPMediaQuery artistsQuery]; NSArray *songsByArtist = [artistQuery collections]; How can I get the number of albums of each artists of the MPMediaItemCollections in songsByArtist ? Exemple : The…
Jonathan
  • 873
  • 3
  • 9
  • 23
5
votes
2 answers

Accessing the Movies and iTunes U videos on the iPad

In my app, I want to reproduce a view which looks exactly like the "Videos" native iPad app (it displays Movies and iTunes U videos located on the iPad). I don't know how to access those elements on the iPad (Movies and iTunes U). I've played with…
fredericouimet
  • 151
  • 1
  • 5
4
votes
3 answers

Access device music files from iPhone app programmatically

I want to access music files which are available on the iPhone and get it listed (or) get the file into my iPhone application some delegats and start playing it. Is it possible to do it ? Similar to how we access images from device photo album using…
Getsy
  • 4,887
  • 16
  • 78
  • 139
4
votes
1 answer

How to properly add predicate for Music Compilations in MPMediaItem

In my app I'm checking if the currently playing song is part of an album. I am able to do this but I have found that if an album is part of a compilation my code does not work as expected. What I want to do is if the currently playing song is part…
RubberDucky4444
  • 2,330
  • 5
  • 38
  • 70
4
votes
0 answers

How to fetch all subscribed Podcasts and not just downloaded ones, locally

I'm building an import method from the native Apple Podcasts app into my own. So I've been using a predicate to fetch MPMediaItems of type Podcast from the local device, however, this (As shown below) only shows downloaded episodes and not shows:…
patrickjquinn
  • 288
  • 1
  • 15
4
votes
1 answer

Apple Music API - Create a Playlist

I have been exploring the Apple Music API to see what kind of functionality I can expect to be able to use in an iOS app. I have created a little test app that gains permission from the user and outputs the playlists I have (and songs) to…
scgough
  • 5,099
  • 3
  • 30
  • 48
4
votes
2 answers

Bug: MPMediaItem Download Status on iOS & MPMediaPropertyPredicate using assetURL

Fun bug in the MPMedia API I have had an ongoing bug in my music app that I have finally tracked down now (now that I am re-writing it in swift). It has a few facets. (using systemMusicPlayer) I think I have narrowed the issues down to an…
solenoid
  • 954
  • 1
  • 9
  • 20
4
votes
2 answers

How to get MPMediaPlaylist's user defined cover image and description?

I know how to get MPMediaQuery's title by: MPMediaQuery *playlistsQuery = [MPMediaQuery playlistsQuery]; NSArray *items = [playlistsQuery collections]; MPMediaPlaylist *myPlaylist = items.firstObject; NSLog(@"%@",myPlaylist.name); //"New playlist…
4
votes
2 answers

How Do You Obtain the "Purchase Date" or "Date Added" from MPMediaItems in iPod Library

As users download new songs into their iPod Music library from the iTunes Store, I would like to programmatically list those songs in a table view. Is it possible to obtain the "Date Added" or "Purchase Date" from the MPMediaItemCollection? I see…
JeffB6688
  • 3,782
  • 5
  • 38
  • 58
4
votes
1 answer

Detecting iTunes playlist folders on a device

Through iTunes, you can create playlist folders that are nested arbitrarily deep. When you copy those playlist folders to your iOS device, iTunes is able to detect that they're folders, and allows you to drill down to the point where you ultimately…
BigSprocket
  • 166
  • 7
3
votes
2 answers

Escaping punctuation, and 'The' prefix in song titles when collating a MPMediaQuery

The code works and populates the table with sections, but it has a flaw: It doesn't escape punctuation and 'The' prefixes in song titles, just like how the native music app does. Would really appreciate some guidance on how I should go about doing…
sooper
  • 5,991
  • 6
  • 40
  • 65
1
2
3
11 12