1

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.

4

1 回答 1

1

遗憾的是,没有将 DRM 文件加载到 AVPlayer 或任何 AV Foundation API 的机制。如果您可以说服您的用户使用 iTunes Plus 以每首歌曲 0.30 美元的价格升级他们的整个音乐库,那是唯一的方法。

于 2012-05-02T19:13:04.263 回答