2

I want to broadcast blob to the client,this is my sever side code:

fs.readFile('./message.webm',function(err,data) {
    if (err) throw err;
    // here i broadcast the blob data
    socket.broadcast.emit('message', {
     video: data
    });
});

on the client side,I don't know how to set a video element to get the blob,i have see a image example,it so hard,i don't know how to do with video.

haibo
  • 21
  • 3
  • 1
    Do you mean to be using `fs.readFile()`? And, why would you send video over a web socket? Why not send a URL and let the client fetch the video from the URL? – jfriend00 Oct 08 '14 at 18:09
  • use webRTC for your video broadcast, and socket.IO for signalling/control. – xShirase Oct 08 '14 at 18:14
  • I have seen http://socket.io/blog/introducing-socket-io-1-0/,it support send blob data,so what i want is to send blob data.but in the client side,it seems complex,this is a example for image:http://stackoverflow.com/questions/24107378/socket-io-began-to-support-binary-stream-from-1-0-is-there-a-complete-example-e – haibo Oct 09 '14 at 02:30
  • @haibo It's probably too long ago but.. have you been able to solve this riddle? – Stefan Falk Apr 24 '20 at 11:43

0 Answers0