Screen Sharing on webRTC
Asked Answered
H

3

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

Herrle answered 9/11, 2014 at 10:55 Comment(0)
I
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

Inkle answered 9/11, 2014 at 11:32 Comment(5)
Any way/api to capture local window screen on IE/Safari/Opera?thanksBullwhip
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: github.com/muaz-khan/WebRTC-Experiment/tree/master/…Inkle
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 lotBullwhip
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 <BODY> or any element inside <BODY> except <Object> or corss-domain <iframe> etc. This library simply renders <BODY> over Canvas2D and returns Screenshot as <Canvas> object. You can invoke Canvas.toDataURL('image/type') to get a specific image format.Inkle
thanks @Muaz. Indeed this would require user to take screenshot/printscreen command and then only can be accomplishedBullwhip
E
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.

Efrem answered 9/11, 2014 at 11:28 Comment(0)
B
2

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

Bullwhip answered 20/11, 2014 at 12:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.