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

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

html - Cut text on left side inside button while centering -

plugins - CodeIgniter support on netbeans 8.0 -