Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPMediaItem and iTunes Match

I have an app that uses the iPod Library API to access the song database in iOS. With the release of iTunes Match, any song which is not on the device will fail to load. Is there a way I an request that the song be downloaded? Perhaps using the new iCloud API?

Edit: To be clear I am not asking how to download songs with iTunes Match using the iPhone. The iOS SDK allows access to the iPod Library via the MPMediaQuery/MPMediaItems. On a iOS device with iTunes Match enabled songs which are in your iTunes Match library but not local on the device are returned via a MPMediaQuery however the MPMediaItems have their 'exportable' flag set to false. When I access these songs in the Music app they are automatically downloaded. I would like to trigger the same automatic download via the MPMediaItem.

I have seen items in iTunes Match refereed to as part of iCloud and there is a new iCloud section of the iOS 5 SDK. However as I understand it I can only get data my app as uploaded. I was hoping there was a way via the MPMediaItem or using the URL via iCloud to trigger an iTunes Match download.

like image 921
TurqMage Avatar asked Nov 16 '11 01:11

TurqMage


People also ask

Do I still need iTunes Match 2021?

You should only have iTunes Match if you have content within your iTunes Library that has been added from outside sources, imported, burned, etc, and if you wish to have the ability to have that content uploaded into the cloud to appear on all devices signed in with your Apple ID.

Is there an alternative to iTunes Match?

If you're determined to quit iTunes Match, however, the most viable (and free) alternative is Google Play Music. The service allows up to 50,000 songs at up to 300MB each to be stored without cost. You can't buy additional service. You can then use Google mobile apps to play back songs.

Does Apple still support iTunes Match?

The first thing to understand is that Apple is no longer using the name “iTunes Match,” at least within iTunes. iTunes Match is now part of the iCloud Music Library, which includes the following: Purchased tracks (previously called iTunes in the Cloud) Tracks matched or uploaded with iTunes Match.

Is it worth having iTunes Match and Apple Music?

For those users, Match makes much more financial sense: iTunes Match is just $24.99/year, while an Apple Music subscription runs you $119.88/year. If streaming services don't appeal to you, but having on-the-go access to your local music library does, iTunes Match appears to be a good alternative option.


1 Answers

I have found something, but it isn't great. If you select the song to be played through the iPod player then that will trigger a download. You can access the iPod player with an MPMusicPlayerController.

MPMusicPlayerController *mDRMAudioPlayer; mDRMAudioPlayer = [MPMusicPlayerController iPodMusicPlayer];  MPMediaQuery *assetQuery = [[MPMediaQuery alloc] init]; NSNumber *persistentID = [mediaItem valueForProperty: MPMediaItemPropertyPersistentID]; MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue: persistentID                                                                         forProperty: MPMediaItemPropertyPersistentID]; [assetQuery addFilterPredicate: predicate];  [mDRMAudioPlayer setQueueWithQuery: assetQuery]; [mDRMAudioPlayer play]; 

No feedback on if this really started a download or not, or progress on the download but the item will start downloading and if your connection is good it will play the first time (otherwise you can spam play and it will get around to starting).

like image 131
TurqMage Avatar answered Sep 30 '22 08:09

TurqMage