Playing M4V Protected Content with MPMoviePlayerController or AVPlayer (iOS)
Is there a way to have the MPMoviePlayerController (or even something lower level like AVPlayer) play protected M4V files from the iTunes Store?
Using the official iTunes API here: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
I can get a "previewURL" for movies, TV shows and music videos. Music videos don't appear to be protected, but movies and TV shows are.
For example, this is the preview URL for a music video from The Beatles (actually a documentary, but whatever): http://a809.v.phobos.apple.com/us/r1000/006/Video/72/fe/52/mzm.bxhrrlns..640x480.h264lc.u.p.m4v
And this is the preview URL for an episode of The Simpsons: http://a911.v.phobos.apple.com/us/r1000/017/Video/ec/cc/cf/mzi.mnuqbbcl..640x480.h264lc.d2.p.m4v
The music video will play just fine using an MPMoviePlayerController, but the video for the The Simpsons does not play at all. (When used with an MPMoviePlayerViewController, the view controller is displayed modally then immediately dismissed without any user interaction.)
If you look at both of those URLs in QuickTime Pro, the only telling difference is that the second one is listed as "Protected", which would lead one to assume that the MPMoviePlayerController cannot play protected content, even if that content is coming straight from Apple.
Under the "Supported Formats" section in the documentation, M4V isn't specifically listed but it certainly works. I can't find any docum开发者_JS百科entation that references protected content.
Was just curious if anyone knew of a way to play this content either within an application or through some other means. (Calling [UIApplication... openURL] doesn't work either, as Mobile Safari won't play the content either.)
This is on iOS 4.x.
Thank You.
I am afraid that Apple does not want us to do that in our own apps.
DRMed MPEG4 video seems to be a no-go for all multimedia iOS SDK levels (mediaplayer framework as well as avfoundation framework).
Read this blog for a proof of the exact same experiences you made yourself already.
And just for making sure that people do not get this wrong and mix apples with oranges. This does only apply to DRM protected video files and has nothing to do with protected streaming - AES-128 encrypted HTTP-streaming (m3u8) is perfectly compatible with iOS and possible on all levels (MPMoviePlayerController
as well as AVPlayer
).
精彩评论