How to play movie with a URL using a custom NSURLProtocol?

前端 未结 4 478
日久生厌
日久生厌 2020-12-08 05:48

As you know,play a movie with MPMoviePlayerController object using

[[MPMoviePlayerController alloc] initWithContentURL: aURL];

now ,i want

4条回答
  •  醉梦人生
    2020-12-08 06:28

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


    Hej,

    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.

    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";
    

    }

    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!

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

提交回复
热议问题