Discussion on: Screen Recording in 10 lines of Vanilla JS

jhonatanalanferreira profile image

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

sebastianstamm profile image
Sebastian Stamm Author

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

sanidhyajain1 profile image

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