Reputation: 51
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?
Upvotes: 5
Views: 2065
Reputation: 238
you may get some help from this demo https://github.com/LingyuCoder/SkyRTC-demo
Upvotes: 1