1

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

suresh
  • 49
  • 2
  • 10
  • I tried with peer js, If someone need to check. [link to screen sharing demo](https://github.com/Abhi5h3k/WebRTC-PeerJs-Demo) – Abhi Dec 28 '22 at 06:32

2 Answers2

0

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.

  • i tried easyrtc demo example . https://demo.easyrtc.com/demos/demo_screen_send.html https://demo.easyrtc.com/demos/demo_screen_receive.html i got LocalMedia Error – suresh Jun 26 '18 at 03:41
  • can you provide exact link for easyrtc screensharing. – suresh Jun 26 '18 at 03:42
  • Sure, I edited the answer. I haven't tried easyrtc but the example I linked above also requires a plugin. – Elias Ousghir Jun 26 '18 at 12:40
  • is it possible to share screen to particular user – suresh Jun 27 '18 at 06:17
  • yes, and only to that particular user, as it's P2P. – Elias Ousghir Jun 27 '18 at 13:36
  • thank you for your suggestions. I want to share screen for particular user that mean i have login form and user give the credenticilas. Then i want share screen to particular user based on texfield value. is it possible in webrtc. – suresh Jun 28 '18 at 04:03
  • Yes, this process of establishing contact between two particular users is called signaling, read more here: https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling – Elias Ousghir Jun 28 '18 at 12:58
0

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

Kyle Baker
  • 3,424
  • 2
  • 23
  • 33