javascript - Using websocket to stream in video tag -
i'm trying stream (webm or mp4) video node.js html5 using websockets (the websocket library socket.io on both server , client). browser in use latest version of chrome (version 26.0.1410.64 m).
i saw here it's possible push video stream in video tag file using mediasource object.
my idea read chunks of data websocket instead of file. can please post example using websockets accomplish or explain me how it?
thanks in advance.
in addition text (string) messages, websocket api allows send binary data, useful implement binary protocols. such binary protocols can standard internet protocols typically layered on top of tcp, payload can either blob or arraybuffer.
// send blob var blob = new blob("blob contents"); ws.send(blob); // send arraybuffer var = new uint8array([8,6,7,5,3,0,9]); ws.send(a.buffer); blob objects particularly useful when combined javascript file api sending , receiving files, multimedia files, images, video, , audio.
also suggest see webrtc (technology associated websockets) web real-time communication (webrtc) effort enhance communication capabilities of modern web browsers. webrtc peer-to-peer technology web. first applications webrtc real-time voice , video chat. webrtc compelling new technology media applications, , there many available sample applications online enable test out video , audio on web. please check this link
Comments
Post a Comment