Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send a video blob to a node.js server by converting it to binary packets?

I am using html5 getUserMedia to attain the user's webcam stream and is stored into an object namely stream now i want to send it to the server using socket.io. When I use follwing code i get an array

    navigator.getUserMedia  = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
var video=document.querySelector("#outputview");
if( navigator.getUserMedia ) 
{
    navigator.getUserMedia( {video: true, audio: true},successcallback,errorcallback);
    function successcallback( stream ) 
    {
        video.src = window.URL.createObjectURL(stream);
        var socket = io('http://192.168.1.102:8000');
        socket.emit('data',stream);`

How to convert this into a data stream so that i could send this stream to view in another page?

like image 645
Vishnu Prakash Avatar asked Nov 10 '22 05:11

Vishnu Prakash


1 Answers

you may get some help from this demo https://github.com/LingyuCoder/SkyRTC-demo

like image 159
foghost Avatar answered Nov 14 '22 22:11

foghost