DEV Community

Discussion on: Screen Recording in 10 lines of Vanilla JS

Collapse
 
jhonatanalanferreira profile image
jhonatan

Very nice hehe.. Is there a way I can record the window and stream it in real time?

Collapse
 
sebastianstamm profile image
Sebastian Stamm

Sure! Instead of pushing the data into an array in the ondataavailable handler, you could also send it to a server or connected peers. For real-time, you probably want to specify the timeslice argument when starting the recording, like recorder.start(100); to make sure you data handler is called periodically instead of at the end

Collapse
 
sanidhyajain1 profile image
sanidhyajain1

but how do you pass it to the server ?
in the form of a blob or something else?
cause i wanted to emit it using socket.io