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
1
vote
1 answer

how to create a set of MPMediaPropertyPredicate joined by OR rather than AND

I would like to add a series of predicates to an MPMediaQuery, but I want it aggregated using OR, not AND: MPMediaQuery *q = [MPMediaQuery songsQuery]; NSMutableArray *a = [@[] mutableCopy]; for (DFLocalMediaItem *item in self.offlineItems) { …
abbood
  • 23,101
  • 16
  • 132
  • 246
1
vote
1 answer

MPMediaQuery get local song list

I'm trying to get local song list from iPod music library by MPMediaQuery: MPMediaQuery *everything = [[MPMediaQuery alloc] init]; NSArray *itemsFromGenericQuery = [everything items]; self.songsList = [NSMutableArray…
Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
1
vote
1 answer

cannot subscript a value of type [MPMediaItem]

I am trying to execute this code in order to get all the music playlists that the users can have on their phones. var queryPlaylists = MPMediaQuery.playlistsQuery() print(queryPlaylists.collections[0]) However, when I try to access any of…
Pav Johnson
  • 132
  • 7
1
vote
2 answers

Swift - Sort artistsQuery By Album

I want to sort the artists query by album like the Music app. How can I do that? var artistsQuery = MPMediaQuery.artistsQuery() var artistsQuery.groupingType = MPMediaGrouping.AlbumArtist var songsByArtist = artistsQuery.collections
evenwerk
  • 947
  • 1
  • 12
  • 28
1
vote
1 answer

is there any way to search multiple artists tracks from iPod Library at a time .

I wants to get multiple artists tracks from iPod Library . The following code allow me to get specific artist tracks like - MPMediaQuery *query = [[MPMediaQuery alloc] init]; [query addFilterPredicate: [MPMediaPropertyPredicate …
Anupam Mishra
  • 3,408
  • 5
  • 35
  • 63
1
vote
3 answers

Sort Albums by Artist using MPMediaQuery

I'm trying to access the user’s local music library using MPMediaQuery to sort the results in the following manner: Artist A (sorted alphabetically) > All of Artist A's albums, sorted alphabetically Artist B (sorted alphabetically) > All of Artist…
David Barsky
  • 108
  • 1
  • 3
  • 10
1
vote
1 answer

How to filter MPMediaQuery using comparison predicates?

I'd like to fetch all songs in a user's iPod library that are over 30 seconds long. I know I need to add a predicate to the query, but I'm not sure how to do so exactly when it's something more advanced than artist = blah. NSPredicate *predicate =…
user1080952
  • 1,073
  • 2
  • 10
  • 15
1
vote
2 answers

how to get MPMediaItem order in MPMediaPlaylist?

I'm looking for the MPMediaItem attribute that would allow me to sort my MPMediaPlaylist items array in the same order that it is showing up in the Music app. Anyone? Thanks.
JackyJohnson
  • 3,106
  • 3
  • 28
  • 35
1
vote
0 answers

IOS::How to detect the downloaded songs in MPMediaSongs

I need to implement this functionality.Help me.I don't wan to showing up the downloaded songs in my App.And I'm getting the some songs names like "url format".How to detect that one.Thanks. playlistsQuery = [MPMediaQuery playlistsQuery]; …
Ravikumar
  • 85
  • 1
  • 16
1
vote
1 answer

MPMedia Query to filter playlists for songs not working

I'm trying to retrieve playlists on iOS, but remove any non-music content. This was the original code, which was returning some video items. MPMediaQuery *query = [[MPMediaQuery alloc] init]; [query addFilterPredicate:[MPMediaPropertyPredicate…
varunsrin
  • 860
  • 2
  • 15
  • 24
1
vote
2 answers

Why CSS Media Query doesn't work on mobile device but yes on Google Chrome device emulator?

As from the title, I don't understand why the media query works on emulator device on Google Chrome and it doesn't work on a real mobile device. Html meta tag
Donovant
  • 3,091
  • 8
  • 40
  • 68
1
vote
0 answers

Getting unique recently played tracks list from iPod (Music) library

I use MPMediaQuery *songsQuery = [MPMediaQuery songsQuery]; NSArray *songsArray = [songsQuery items]; to get recently played tracks and sort the array by MPMediaItemPropertyLastPlayedDate The problem is, I don't get unique plays. for example if I…
1
vote
1 answer

Sorting an array of songs by Album, when Album info available

I'm populating an array with songs that match a specific criteria. NSArray *songs = [[[MPMediaQuery alloc] init] items]; NSMutableArray *filteredSongs; for (int i=0; i<[songs count]; i++) { // filter logic here: if songs[i] match the…
Sr.Richie
  • 5,680
  • 5
  • 38
  • 62
1
vote
2 answers

No songs detected on iPad

My app has been rejected by Apple :( The issue reported is The application does not detect the songs on the iPad. I already tried to have all the tests I can in order to understand the issue, but on MY ipad and on MY songs, everything works 100%…
Sr.Richie
  • 5,680
  • 5
  • 38
  • 62
1
vote
1 answer

How to play an album starting at a specific track?

My app uses an MPMusicPlayerController to play music. I'm getting a bit lost in all the documentation for it and MPMediaQuery and so on. What I want to do is play a particular album, beginning at a specific track. I can construct a MPMediaQuery that…
Kenny
  • 1,083
  • 2
  • 8
  • 23