6

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..

3 Answers3

7

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

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:

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

Muaz Khan
  • 7,138
  • 9
  • 41
  • 77
  • Any way/api to capture local window screen on IE/Safari/Opera?thanks – cosmoloc Nov 24 '14 at 12:26
  • 1
    Safari/IE based WebRTC-native-plugins aren't supporting screen capturing. Mac/iOS itself maybe having native screen capturing API same as Andriod. BTW, regarding Opera, it'll not support screen capturing API until screen-capturing will be considered a "stable feature" in chromium project (because you know Opera is based on Chromium). You can try HTML2Canvas.js based solutions though: https://github.com/muaz-khan/WebRTC-Experiment/tree/master/part-of-screen-sharing – Muaz Khan Nov 25 '14 at 09:41
  • I tried the Share part of your screen link, but it supports only webpage div share and not a local app screen share. Will explore more on the provided link to see if can get Opera to share desktop app screen.Thanks a lot – cosmoloc Nov 25 '14 at 10:02
  • 1
    Nope. You can't share app's screen using Html2Canvas.js----it is merely a browser based javascript library that works in all Canvas2D compatible browsers. You can share or any element inside except or corss-domain – Muaz Khan Nov 25 '14 at 14:27
  • thanks @Muaz. Indeed this would require user to take screenshot/printscreen command and then only can be accomplished – cosmoloc Nov 26 '14 at 05:13
4

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.

lulop
  • 917
  • 8
  • 7
2

Yes it is. I recently worked on WebRTC and was able to stream desktop easily. Following links helped me implement my requirements :

cosmoloc
  • 2,884
  • 5
  • 29
  • 48