I am implementing a Music related Application. In my application I need to use AVPlayer instead of MPMusicPlayer to play iPod Library songs. I used AVPlayer to support FadeIn and Fadeout effects for the background playback of MPMediaItems. I used MPMediaItemProperyAssetURL to get the url from the MPMediaItem and give it as input to the AVPlayer like follows. My problem is some items are won't play because of null url. I found that songs downloaded from iTunes store (which are DRM protected) were unable to play because they have no MPMediaItemProperyAssetURL. Could you please guys help me, how can I resolve these issues. I need to support these DRM protected songs in AVPlayer. Please take a look at my following code for reference,
MPMediaItem *currentItem = [songs objectAtIndex:songIndex];
NSURL *itemURL = [currentItem valueForProperty:MPMediaItemPropertyAssetURL];
currentlyPlayingItem=[itemURL absoluteString];
avPlayer = [[AVPlayer alloc] initWithURL:itemURL];
[avPlayer play];
Thanks in Advance, Sekhar.