DEV Community

Discussion on: An introduction to the MediaRecorder API

Collapse
 
flozero profile image
florent giraud • Edited

Maybe you will know this too so !

Can we stream just a part of the screen or can we take just a specific window

Do you know how to send this media stream to a rtmp flux ?

Thread Thread
 
philnash profile image
Phil Nash

This isn’t something I’ve done, but I’m interested!

Within the getDisplayMedia permissions dialog, the user gets to choose whether they share the whole screen or just a window.

To stream just part of the screen, you could copy the video to a canvas element and crop it there, then export the canvas back to a MediaStream using the captureStream method.

As for streaming to RTMP, that is not something built into the browser. You’ll need to stream to a server using webRTC or web sockets and then have the server turn it into a RTMP stream.