Reproducción de un flujo de bytes en el iPhone MPMoviePlayerController

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?

preguntado el 08 de enero de 11 a las 15:01

Could you please comment on whether the custom URL route worked for you? Or did you resort to NSPipe? -

1 Respuestas

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: ¿Cómo reproducir películas con una URL usando un protocolo NSURL personalizado?

Entonces lee el Sistema de carga de URL docs.

contestado el 23 de mayo de 17 a las 13:05

Wow! It is really great answer! So helpful! Thank you very much! - Alexander Tkachenko

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.