如您所知,使用 MPMoviePlayerController 对象播放电影
[[MPMoviePlayerController alloc] initWithContentURL: aURL];
现在,我想实现一个自定义 NSURLProtocol,我将在其中解密已由 AlgorithmDES 加密的电影源。 有这种可能吗?感谢您提供任何想法。需要您的帮助~
最佳答案
更新:我与 Apple 谈过此事,目前无法将 MPMoviePlayerController 与 NSURLProtocol 子类一起使用!
他,
我不确定,但有可能。我目前正在研究类似的东西,但还没有完全发挥作用。我发现 MPMoviePlayerController 与我的自定义 NSURLProtocol 子类交互,但考虑 NSURLRequest 的 HTTPHeaders 似乎很重要,因为它们定义了 MPMoviePlayerController 需要的字节范围。
如果你将它们转储到你的 NSURLProtocol 子类中,你将在开始时得到两次类似的东西:
2011-01-16 17:00:47.287 iPhoneApp[1177:5f03] Start loading from request: {
Range = "bytes=0-1";
所以我的猜测是,只要您可以提供正确的范围并返回一个可以由 MPMoviePlayerController 播放的 mp4 文件,它应该是可能的!
编辑:这是一个有趣的链接:Protecting resources in iPhone and iPad apps
关于ios - 如何使用自定义 NSURLProtocol 播放带 URL 的电影?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4383388/