I have a stream of bytes that represent a movie with H264 video and AAC audio. I got it using an RTMP library (rtmp-dump) and the data is comming through the network to my iOS simulator.
However I have no idea how to show it to the user. The MPMoviePlayerController seems to accept only an URL. Is there a way to play videos by supplying something like a NSPipe or similar to the player?
You could try implementing a custom URL protocol (see NSURLProtocol). Basically you create the protocol and register it, then any in-app requests to load a url having this protocol will be routed to your protocol instance. You'd likely have to mimic the responses that a HTTP server would send for a progressive-download of the file.
This wont work if MPMoviePlayerController uses lower-level CFNetwork calls vs. NSURLConnection to make its requests. This question implies that MPMoviePlayerController DOES make use of NSURLConnectino: How to play movie with a URL using a custom NSURLProtocol?
Also read the URL Loading System docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With