I have a resource sending a video stream via websockets (I have no control over the forwarding method). I can read from the socket using SocketRocket without any problems, but AVPlayerilk needs it NSURL, not a stream of NSDatabytes.
Here are some solutions I tried:
Custom NSURLProtocolto route bytes from socket to NSURLProtocolClient. It turns out, however, that AVPlayerthey are MPMoviePlayerViewControllernot used NSURLConnection.
This similar question tried to write bytes to disk and add them with bad results.
Use CocoaHTTPServer to stream proxy stream. The APIs here (unless I am missing something) are not conducive to writing an arbitrary amount of data into the response.
How can I trick AVPlayer into playing my video stream?
source
share