mpmediaquery

How to get the MPMediaItem (audiobook) individual chapters

…衆ロ難τιáo~ 提交于 2019-12-22 18:27:06
问题 I know I can get all the audiobooks from the iPod library with: MPMediaPropertyPredicate *abPredicate = [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInt:MPMediaTypeAudioBook] forProperty:MPMediaItemPropertyMediaType]; MPMediaQuery *abQuery = [[MPMediaQuery alloc] init]; [abQuery addFilterPredicate:abPredicate]; [abQuery setGroupingType:MPMediaGroupingAlbum]; NSArray *books = [abQuery collections]; And I can get the parts/files for each book by using this: [book items];

NSNumber for MPMediaItemPropertyPersistentID to NSString and back again

风流意气都作罢 提交于 2019-12-20 14:35:31
问题 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 * persistentID = [[[item representativeItem] valueForProperty:MPMediaItemPropertyPersistentID] stringValue]; // Do something with it. } [songs release]; Pretty basic stuff. I'm getting the PersistentID as an NSString because I need to write it to an XML file

iPhone sdk, save MPMediaItemCollection?

你。 提交于 2019-12-20 14:20:25
问题 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 I am not sure how to query for it. Any thoughts? 回答1: Man, you dont need to save mediaCollection. media collection it is just array of MPMediaItem objects. So you'd better save persistentIds of this items. it's quite easy //it's how to know

MPMediaQuery search for Artists, Albums, and Songs

梦想的初衷 提交于 2019-12-18 02:51:21
问题 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 Kenny Chesney songs (and any songs titles or albums that contain Kenny Chesney in them.) When I make this query and a predicate for each property (song title, album title, artist name), an empty array returns. Here is a bit of code that may give you

Getting the most played track out of the iPod library (MPMediaQuery)

给你一囗甜甜゛ 提交于 2019-12-13 18:51:39
问题 I need to get out the 25 most Played Songs out from my iPod Library with my iPhone app. i am using a MPMediaQuery. One solutions would be to loop through all tracks and them comparing by MPMediaItemPropertyAlbumTrackCount. But i think thats a bit unefficient. Is there a way to directly get the Most Played items playlist? 回答1: I think you are looking for MPMediaItemPropertyPlayCount not MPMediaItemPropertyAlbumTrackCount. MPMediaItemPropertyAlbumTrackCount is the track number of the song as it

Gmail's Support of Media Queries Limited by Location?

怎甘沉沦 提交于 2019-12-12 06:37:17
问题 Now that Gmail supports media queries (https://developers.google.com/gmail/design/css) does any know of limitations such as location (i.e., only available for US based email addresses) or if the update is limited to just webmail? Email on acid did a webinar about the updates and didn't say any of the above limitations existed - but the company I use to build and deploy emails, is saying media query support is not available in Canada. Thanks, 回答1: Yes, they are rolling it out based on geo

No songs detected on iPad

…衆ロ難τιáo~ 提交于 2019-12-11 08:08:41
问题 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% fine. In my code I'm handling the situation of an empty library in the following way: MPMediaQuery *albums = [MPMediaQuery albumsQuery]; NSArray *albumCollections = [albums collections]; if ([albumCollections count] > 0) { // everything fine, let's

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

点点圈 提交于 2019-12-11 07:00:12
问题 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 criteria, push it filteredSongs array } Now I'd like to sort that array by MPMediaItemPropertyAlbumTitle , but avoiding problems if the Album info of the user's mp3 is missing. (I'm trying to find a workaround for the problem solved here) 回答1: You can use the

Detecting iTunes playlist folders on a device

老子叫甜甜 提交于 2019-12-06 07:21:35
问题 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 get songs. Any idea how they do that?? I've been trying to figure this out for days. When I query for a specific persistentID of a known folder, the only things I can see about it that are different from a playlist that contains songs are: playlist

iOS - get programmatically queue of items currently playing

一世执手 提交于 2019-12-05 01:40:05
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 other library? I'm afraid this is not possible. Apple does not give us access to this information from any libraries. bugloaf I'm pretty sure this is not possible through any public API. The Ecoute app that @sooper mentions must be using private APIs. I did a little experiment in the codebase of my own music app. First I used this code to list all