本文介绍了如何使用自定义NSURLProtocol通过URL播放电影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道,使用

[[MPMoviePlayerController alloc] initWithContentURL: aURL];

现在,我想实现一个自定义NSURLProtocol,在该协议中,我将解密已由AlgorithmDES加密的电影源.那有可能吗?感谢您提出任何想法.需要您的帮助〜

now ,i want to achieve a custom NSURLProtocol in which i will decrypt a movie source that had be encrypt by AlgorithmDES.Is that possibility? thanks for giving any ideas.need you help~

推荐答案

更新:我曾与Apple谈过此事,目前无法将MPMoviePlayerController与NSURLProtocol子类一起使用!

UPDATE: I spoke to Apple about this and it's not possible to use MPMoviePlayerController with a NSURLProtocol subclass at the moment!

嘿,

我不确定,但是有可能.我目前正在研究类似的东西,但还没有完全发挥作用.我发现MPMoviePlayerController与我的自定义NSURLProtocol子类进行交互,但是考虑NSURLRequest的HTTPHeaders似乎很重要,因为它们定义了MPMoviePlayerController需要的字节范围.

I am not sure but it could be possible. I am currently working on something similar but haven't got it fully working. What I have found out is that MPMoviePlayerController interacts with my custom NSURLProtocol subclass BUT it seems to be important to take the HTTPHeaders of the NSURLRequest into account because they define a range of bytes the MPMoviePlayerController needs.

如果将它们转储到您的NSURLProtocol子类中,您将获得两次类似的内容:

If you dump them in your NSURLProtocol subclass you will get something like this twice for the start:

2011-01-16 17:00:47.287 iPhoneApp[1177:5f03] Start loading from request: {
Range = "bytes=0-1";

}

所以我的主意是,只要您可以提供正确的范围并返回MPMoviePlayerController可以播放的mp4文件,就应该有可能!

So my GUESS is that as long as you can provide the correct range and return a mp4 file that can be played by the MPMoviePlayerController it should be possible!

这是一个有趣的链接:保护iPhone和iPad应用程序中的资源

Here is a interesting link: Protecting resources in iPhone and iPad apps

这篇关于如何使用自定义NSURLProtocol通过URL播放电影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-11 13:35