Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen Sharing on webRTC

Is it possible to capture desktop screen sharing through webRTC.. As we know that it just captures the screen on the browser tab but is it possible to capture the whole desktop screen like navigating through files on computer or opening and viewing files like pdf etc..

like image 611
Talib Shabbir Hussain Avatar asked Nov 09 '14 10:11

Talib Shabbir Hussain


People also ask

How do I share my screen to a website?

Instead, you can start screen sharing by clicking on a button in-browser. Some screen sharing websites also make you create a login before starting a call, but all attendees have to do is click on a join link to enter it. In all, screen sharing websites save both you and your attendees a lot of time.

How do you implement screen sharing feature?

Start sharing a screenOpen the index. html file and add: a button with the id start-screenshare-btn as a child of the actions div. a div with the id screenshare-container after the video-container div.

How do I stop a screen share in WebRTC?

According to MediaStream API, the stop() function should be called to stop sharing.


2 Answers

Currently, only "stateless" screen capturing is available in RTCWeb implementations (both chrome & firefox). E.g.

  • Install chrome extension and then try this demo

Above demo will simply capture screen of "any" opened application's screen. Though, such screen capturing API fails to capture screens of full-screen game applications.

More information available here:

  • https://developer.chrome.com/extensions/desktopCapture (HTTPs+getUserMedia+postMessage)

Regarding remote desktop sharing from a web-browser, it has a pile more security risks associated with it compared to screen sharing. The UI/security aspects will be tough to deal with, and the feature will be very susceptible to social engineering -- phone call: "this is Google/Dell/Computer-Management; we've detected your machine has a virus on it; could you browse to and we'll assist you in removing it" -- etc. Ref

like image 124
Muaz Khan Avatar answered Oct 24 '22 09:10

Muaz Khan


Yes, it's possible. At least using Chrome. There are several ways of doing it, but the simplest one is:

  1. Add this constaint when you invoke getUserMedia:

    constraints.video.mandatory.chromeMediaSource = 'screen'

  2. When starting chrome, use this argument (chrome version > 35):

    --enable-usermedia-screen-capturing

You can find an example of sharing screen and recording the shared screen at a remote server repository here: https://github.com/Kurento/kurento-tutorial-js/blob/develop/kurento-recorder-screen/static/index.js

If you try to execute that example, play close attention to the security restrictions. All signalling needs to travel using TLS. Using raw HTTP will produce chrome to refuse sharing screen.

like image 35
lulop Avatar answered Oct 24 '22 10:10

lulop