Webrtc peer to peer screen sharing

3.5k views Asked by At

I am new to webrtc. is it possible to share screen from peer to peer?

I am new to easyrtc. is it possible to share screen from peer to peer?

I tried screen share demo example of easyrtc but i got "LocalMediaError" and i installed all required plugins also. please let me know if it possible

2

There are 2 answers

7
Elias Ousghir On

WebRTC is a Peer-To-Peer service where each peer is a browser, with all the constraints that it implies.

So as you've seen with easyRTC, the only way to get desktop screen sharing would be to use a browser extension.

Edit: Here is the example I came across.

0
Kyle Baker On

You don't need a plugin, you can simply use navigator.mediaDevices.getDisplayMedia and easyrtc.register3rdPartyLocalMediaStream.

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia

Example:

navigator.mediaDevices.getDisplayMedia({video: true}).then(function (stream) {
    easyrtc.register3rdPartyLocalMediaStream(stream, 'screen:1');

    // Then to add to existing connection
    easyrtc.addStreamToCall(easyrtcId, 'screen:1', function (caller, streamName) {

    });
})

https://github.com/open-easyrtc/open-easyrtc/issues/42