Model: The user selects a mp4 file from his mobile on a static page hosted by a node.js express server on the same network, the file stream is received by busboy in the same server. Now the file stream has to be read in parts/segments/buffers and sent ahead through websocket to be added to the MediaSource buffer on the other screen.
Question: How to read x numbers of bytes of data from a paused readable stream?
Code(not working):
function ReadData(stream, BytesToRead){
stream.resume();
var data = stream.read(BytesToRead);
stream.pause();
return data;
}
Kindly help!