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

iOS 7 SDK - MediaPlayer Framework - Rolling back transaction

The following block of code results in the error message: 2013-09-13 15:27:08.449 Mobile[746:5603] {MediaLibrary} Rolling back transaction. MPMediaQuery *mediaQuery = [MPMediaQuery songsQuery]; NSArray *collections = [mediaQuery collections]; This…
JADurham909
  • 221
  • 2
  • 7
11
votes
4 answers

MPMediaQuery search for Artists, Albums, and Songs

How can I search the iPod Library in the same manner as the iOS Music application? I want to make general queries that return results for each Artists, Albums, and Songs. For instance, if I search Kenny Chesney I want the songs query to return all…
morcutt
  • 3,739
  • 8
  • 30
  • 47
10
votes
2 answers

Load songs from iPod Library right after sync

I'm developing an iPhone application that uses the iPod library to play some songs. I load the songs with the code below. The problem is, when running this code right after the device has been synced with iTunes, there is a problem. Apparently the…
Peter
  • 1,495
  • 1
  • 14
  • 21
10
votes
4 answers

iOS - get programmatically queue of items currently playing

I want to get programmatically queue currently played in native Music App. I can use MPMusicPlayerController to get currently playing item but I want to get not only the item but whole playing queue. Is it possible to do it using AVFoundation or any…
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
8
votes
1 answer

Playing (non library) Apple Music content - request fails

I'm trying to play an album, using the following code… let predicate = MPMediaPropertyPredicate(value: "1459938538", forProperty: MPMediaItemPropertyAlbumPersistentID) let iCloudPredicate = MPMediaPropertyPredicate(value: true, forProperty:…
Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
8
votes
1 answer

MPMediaQuery in iOS simulator

I want to run some tests on my iOS application and I would like to find a way to test in the simulator a MPMediaQuery so I can get a MPMediaItemCollection with mock data. Any library or mock data I can use to test it without depending on a…
Albertoimpl
  • 321
  • 3
  • 8
8
votes
2 answers

MPMediaQuery to return local items only

I want to display a UITableView with only the songs that are currently on the device. If I query all items I (obviously) get all items, including the once that I purchased but not have downloaded. Here is the (part) of the code @property (strong,…
ASCJU
  • 317
  • 3
  • 14
8
votes
2 answers

Retrieve list of songs ordered by last play time in iOS

I need to obtain a list of the N most recently played songs from an iOS device, in order. The only way I can imagine doing it, at the moment, is by getting all the songs through an MPMediaQuery and manually sort them by lastPlayedDate. This is a…
Mexican Seafood
  • 504
  • 3
  • 13
8
votes
1 answer

MPMediaQuery artistsQuery returns duplicates

I am using the Apple Media Player Framework in my application. To fetch items I am using the MPMediaQuery as described in their documents. Which works well, but when using the predefined query to retrieve all artists, I get duplicated entries for…
miho
  • 11,765
  • 7
  • 42
  • 85
7
votes
1 answer

iOS - Getting [Explicit] and [Clean] tags from Media in Objective-C

When I view my purchased music in iTunes songs that are explicit are shown with a red explicit box next to them in the list of songs. I.e. the explicit tag you see when purchasing the song is passed through to the iTunes library. Also the same is…
Skanky
  • 129
  • 8
6
votes
1 answer

"MediaQuery.of(context).size" VS "LayouBuilder( BoxConstraints constraints)"

I am a new Flutter learner. I am trying to write both mobile and web application using the same code base. I am wondering to know where should I use MediaQuery.of(context).size and where LayouBuilder( BoxConstraints constraints)? Also like to know…
6
votes
0 answers

iOS Music Library: How to tell if a given Playlist is a folder

Say I have an iOS music library with this playlist structure: A Folder | ---> A Playlist | ---> Song A I run the following code: import MediaPlayer let playlists = MPMediaQuery.playlists().collections! as! [MPMediaPlaylist] for playlist…
Dov
  • 15,530
  • 13
  • 76
  • 177
6
votes
2 answers

iPhone sdk, save MPMediaItemCollection?

I have my application displaying a MPMediaPickerController. I would like to save the MediaItem and start it playing again on startup. I think this is doable using the MPMediaQuery. It seems, I should be using the MPMediaItemPropertyPersistentID but…
Kyle
  • 17,317
  • 32
  • 140
  • 246
5
votes
1 answer

Using MPMediaQuery to query ios library by rating

I'm developing an iphone 4 app that filters the local media library by different criteria. I have been able to filter by song name, artist, and genre. Now I need to add a rating filter mechanism. I was thinking in something like "rating >= N stars"…
Mariano Latorre
  • 719
  • 1
  • 10
  • 21
5
votes
4 answers

setVolume not working on AVMutableAudioMixInputParameters with playing from phones local iPod library

I'm currently trying to play music from a phones local iPod library using AVPlayer rather than MPMusicPlayerController using the application controller. I can get it select a track from the local iPod lib using and MPMediaQuery, but when I try to…
Ben Novakovic
  • 581
  • 7
  • 17
1
2 3
11 12