ios - Method to consume web socket video stream with AVFoundation? -


i have resource sending video stream via websockets (i don't have control on transimission method). able read socket using socketrocket without problems, avplayer , ilk need nsurl, not stream of nsdata bytes.

here couple of solutions have tried:

  1. custom nsurlprotocol route bytes socket nsurlprotocolclient. turns out, though, avplayer , mpmovieplayerviewcontroller not use nsurlconnection.

  2. this worded question tried writing bytes disk , appending them poor results.

  3. use cocoahttpserver proxy stream. apis here (unless i'm missing something) aren't conducive writing arbitrary amount of data response.

how can trick avplayer playing video stream?

you should take @ avassetresourceloaderdelegate. allows initialize avasset custom url myapp://path/that/means/something/to/myapp , if have set [[avasset resourceloader] setdelegate:myobj queue:myqueue] media playback pipeline ask data , merely requires respond nsdata - see avassetresourceloadingdatarequest respondwithdata:.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -