AssetUrl for a MPMediaItem returns nil

We are trying to retrieve Metadata for Audiobooks in Itunes. Online we were asked to retrieve the AVURLAsset for this MPMediaItem. Inorder to retrieve the AVURLAsset, we access the property MPMediaItemPropertyAssetURL on MPMediaItem instance. However for most of the titles, we retrieve a nil URL. We want to know if this is a bug or some licensing issue. Please let us know If we should use some other API. Does iBook use a different API as they show chapters ?


Steps to Reproduce: NSURL *assetURL = [self.mediaItem valueForProperty:MPMediaItemPropertyAssetURL]; / if (assetURL) { AVURLAsset *asset = [AVURLAsset URLAssetWithURL:assetURL options:nil]; NSArray *locales = [asset availableChapterLocales]; for (NSLocale *locale in locales) { NSArray *chaptersByLocale = [asset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:[NSArray arrayWithObject:AVMetadataCommonKeyArtwork]]; [chapters addObjectsFromArray:chaptersByLocale]; } }


Expected Results: NSURL *assetURL = [self.mediaItem valueForProperty:MPMediaItemPropertyAssetURL]; returns a valid URL for the AVURLAsset.


Actual Results: NSURL *assetURL = [self.mediaItem valueForProperty:MPMediaItemPropertyAssetURL]; returns nil

Replies

This is the case in iOS 8.3 and iOS 8.4 beta. iBooks finally supports displaying chapters in iOS 8.4 beta, but we are unable to extract them. Please advise what new API we have to use, or if this is a known bug which will be corrected.