有没有办法让 MPMoviePlayerController(或什至像 AVPlayer 之类的更低级别的东西)播放来自 iTunes Store 的受保护的 M4V 文件?
Is there a way to have the MPMoviePlayerController (or even something lower level like AVPlayer) play protected M4V files from the iTunes Store?
在此处使用官方 iTunes API:http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
Using the official iTunes API here: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
我可以获得电影、电视节目和音乐视频的previewURL".音乐视频似乎不受保护,但电影和电视节目受保护.
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.
例如,这是披头士乐队音乐视频的预览 URL(实际上是一部纪录片,但无论如何):http://a809.v.phobos.apple.com/us/r1000/006/Video/72/fe/52/mzm.bxhrrlns..640x480.h264lc.upm4v
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
这是《辛普森一家》一集的预览网址:http://a911.v.phobos.apple.com/us/r1000/017/Video/ec/cc/cf/mzi.mnuqbbcl..640x480.h264lc.d2.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
使用 MPMoviePlayerController 可以正常播放音乐视频,但《辛普森一家》的视频根本无法播放.(与 MPMoviePlayerViewController 一起使用时,视图控制器以模态方式显示,然后立即关闭,无需任何用户交互.)
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.)
如果您在 QuickTime Pro 中查看这两个 URL,唯一明显的区别是第二个 URL 被列为受保护",这会导致人们认为 MPMoviePlayerController 无法播放受保护的内容,即使该内容是直接来自苹果.
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.
在文档中的支持的格式"部分下,没有特别列出 M4V,但它确实有效.我找不到任何引用受保护内容的文档.
Under the "Supported Formats" section in the documentation, M4V isn't specifically listed but it certainly works. I can't find any documentation that references protected content.
很好奇是否有人知道在应用程序中或通过其他方式播放此内容的方法.(调用 [UIApplication... openURL] 也不起作用,因为 Mobile Safari 也不会播放内容.)
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.)
这是在 iOS 4.x 上.
This is on iOS 4.x.
谢谢.
恐怕苹果不希望我们在自己的应用程序中这样做.
I am afraid that Apple does not want us to do that in our own apps.
DRMed MPEG4 视频似乎不适用于所有多媒体 iOS SDK 级别(媒体播放器框架以及 avfoundation 框架).
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.
只是为了确保人们不会弄错这个,把苹果和橙子混在一起.这仅适用于受 DRM 保护的视频文件,与受保护的流媒体无关 - AES-128 加密的 HTTP 流媒体 (m3u8) 与 iOS 完美兼容,并且可以在所有级别(MPMoviePlayerController
以及AVPlayer
).
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
).
这篇关于使用 MPMoviePlayerController 或 AVPlayer (iOS) 播放受 M4V 保护的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!