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

前端 未结 4 513
日久生厌
日久生厌 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:43

    There is one more solution as of iOS 7. You can use a AVAssetResourceLoaderDelegate for AVAssetResourceLoader. But this will only work with AVPlayer then.

    There is a demo project by apple called AVARLDelegateDemo have a look at it and you should find what you need. (I think linking to it isn't a good idea, so just search for it in the Developer Library on developer.apple.com) Then use any custom URL scheme (without declaring a NSURLProtocol) and handle that URL scheme in the AVAssetResourceLoaderDelegate.

    If there is a huge interest I could provide a proof of concept gist.

提交回复
热议问题