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
3
votes
1 answer

How to get MPMediaPlaylist for localized "Purchased" and "Purchased on My iPhone" playlist?

How to manage to get the "Purchased" and "Purchased on my iPhone" MPMediaPlaylist, using localized strings name as playlists names: NSArray *songs; NSString *name=@"Purchased"; // @TODO // need to get localized version of this default iOS playlist…
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
3
votes
2 answers

Need good explanation of MPMediaQuery results for collections and items

I need some help in understanding MPMediaQuery and how to access the results so that I can use the query with setQueue(with:). Here's an example of why I am confused. In my library I have an artist with 3 albums. My goal is a query for those 3…
wayneh
  • 4,393
  • 9
  • 35
  • 70
3
votes
4 answers

media query min-width not working

I am using media query, no matter the browser is below or over 1200px, the the css always detects my browser min-width is 768px.so the display in browser is always 750px. maybe it's a easy problem but it bothered me few hours. My HTML:
CHANG.T
  • 33
  • 1
  • 3
3
votes
1 answer

How to get artwork from MPMediaItemCollection

My goal is to get the cover picture for the playlists in iPod library. And I did something like playlistMediaItemCollections = MPMediaQuery.playlistsQuery().collections ?? [] let artworks = playlistMediaItemCollections.map {…
3
votes
1 answer

Finding a Song from Persistent ID using Swift 2 programming

I am a beginner with Swift programming who is trying to re-write code that I found online that Finds A Song from Persistent ID. The original code is found at this…
3
votes
1 answer

how to filter MPMediaItems by .mp3 files to play songs in AVPlayer

I need to filter my query items by .mp3 files. Now i am getting result from query,it's contains video files(mp4). these are my line of codes MPMediaQuery *everything = [[MPMediaQuery alloc] init]; NSArray *itemsFromGenericQuery =…
abymathew
  • 115
  • 1
  • 1
  • 11
3
votes
1 answer

Creating a playlist in iOS?

Is it possible to create, name and save an iTunes playlist like you can in the Music app from a 3rd-party programmed app? If so, how?
rweichler
  • 103
  • 2
  • 7
3
votes
1 answer

How to play songs (only songs) from a playlist on iOS?

I'm trying to play songs from an iPod playlist. As far as playlist may have videos too, I want to play only songs in them. MPMusicPlayerController *mp = [MPMusicPlayerController applicationMusicPlayer]; MPMediaQuery *query = [MPMediaQuery…
OtoLeo
  • 363
  • 3
  • 19
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

How to get the MPMediaItem (audiobook) individual chapters

I know I can get all the audiobooks from the iPod library with: MPMediaPropertyPredicate *abPredicate = [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInt:MPMediaTypeAudioBook] …
Christian Schlensker
  • 21,708
  • 19
  • 73
  • 121
2
votes
3 answers

How to show MPMediaItem Artwork in a SwiftUI list?

I try to build a SwiftUI List of all local stored songs on my iPhone. Im using the MediaPlayer Framework of Apple to get the songs and storing them inside an EnvironmentObject for easy access in my SwiftUI view. Inside my Cell im accessing the…
KevinP
  • 2,562
  • 1
  • 14
  • 27
2
votes
2 answers

NULL MPMediaitemPropertyAssetURL

Using MPMediaQuery and then getting the MPMediaitemPropertyAssetURL from the song results sometimes returns null (and by sometimes I mean in this case, 1/3 of the users song library). Does anyone know what causes this? I'm assuming that this is due…
monstercoo
  • 83
  • 1
  • 9
2
votes
1 answer

How to access the "Sort as" field of MPMediaItem?

iTunes has a way of sorting the songs that the ones with title starts with "a" or "the" are recognized without it. Is there a way to access this "sort title"? I am pretty sure Apple Music does this and I guess it can be accessed by let item =…
Adam
  • 1,776
  • 1
  • 17
  • 28
2
votes
1 answer

iOS MPMediaQuery.artistsQuery() doesn't return every artist if compilation is checked

I have been writing a music app using Swift 2.3. The trouble that I've found is that my a MPMediaQuery.artistsQuery() doesn't provide all of the artists. Using iTunes, I've tracked it down to if "Album is a compilation of songs by various artists"…
James64
  • 123
  • 10
2
votes
0 answers

Bifurcate iTunes playlist from folders

I want to show all folders and playlists in my app just like iTunes does. I do get playlists from MPMediaQuery, but I cannot bifurcate if its playlist or a folder. Below is my code: let playlistQuery = MPMediaQuery.playlistsQuery() if let…
Sunil Chauhan
  • 2,074
  • 1
  • 15
  • 33
1 2
3
11 12