ios - 如何使用自定义 NSURLProtocol 播放带 URL 的电影?

标签 ios url mpmovieplayercontroller nsurlprotocol

如您所知,使用 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/

相关文章:

ios - 在 UITableView 中的 UINib 中重新加载 UITableView

ios - 为同一应用程序的多个变体的多个证书重复使用 CSR

ios - Size Class 紧凑高度不能与 UIStackView 的轴和真实设备一起正常工作

android - Flutter:禁用平板电脑和 iPad 的应用程序

没有文件名的url

regex - URL正则表达式组捕获

c# - disqus API 缺少必需的参数 : grant_type

ios - MPMoviePlayerController 仅在调用两次时播放。仅在 iOS 4 中出现

ios - 如何将 mpMoviePlayerController 方向锁定为横向模式?

ios - MPMoviePlayerController MovieAccessLogEvent - 膨胀的观察比特率