Hi All,
I'm building an application with the implementation using easyrtc. My concept is quite simple that the users will be on real time communication and i want to recording happen to node server directly.
Initially i used recordrtc to make it possible but it records the data at client side only and then upload to the server. it runs fine in case of file of small size but as the file size grows, the browser get hang and stops responding.
Then i heard about binaryjs library, which can make it possible, My idea is the capture the streaming from video element and upload the stream in chunks using binaryjs.
please see the client side sample code for the same:
var client = new BinaryClient('ws://localhost:3000');
// wait for connection to binaryjs server
client.on('open', function(){
var box = $('#selfVideo');
var video = document.querySelector('#selfVideo');
box.on('dragenter', doNothing);
box.on('dragover', doNothing);
box.on('play', function(e){
e.originalEvent.preventDefault();
//var file = e.originalEvent.dataTransfer.files[0];
var file = easyrtc.getLocalStream();
alert(file);
// `client.send` is a helper function that creates a stream with the
// given metadata, and then chunks up and streams the data.
var stream = client.send(file, {name: 'demo.wav', size: file.size});
});
});
But im not able to upload this stream to node js server. a file with size of zero bytes gets uploaded and nothing......
please help me achieve this