WebRTC plugin free screen sharing / Demo
Share entire screen directly without any single installation!
=
- Open
chrome://flags
in the latest chrome (canary/beta). - Scroll to the bottom of the page.
- Enable flag
Enable screen capture support in getUserMedia()
That flag allows web pages to request access to the screen contents via the getUserMedia() API
.
var video_constraints = {
mandatory: { chromeMediaSource: 'screen' },
optional: []
};
navigator.webkitGetUserMedia({
audio: false,
video: video_constraints
}, onstreaming, onfailure);
There is another experiment: WebRTC Tab Sharing using experimental tabCapture APIs
=
It is a big wish to share desktop using RTCWeb peer connection APIs but unfortunately currently it is not possible.
Current experiment is using chrome screen sharing APIs (media/constraints) which allows end-users to view the screen....nothing else!
=
Test it on HTTPS. Because, screen capturing (currently) only works on SSL domains.
Chrome denies request automatically in the following cases:
-
Screen capturing is not enabled via command line switch. mandatory: {chromeMediaSource: 'screen'} must be there
-
Audio stream was requested (it's not supported yet).
navigator.webkitGetUserMedia({
audio: false /* MUST be false because audio capturer not works with screen capturer */
});
- Request from a page that was not loaded from a secure origin.
Here is their C++ code that denies screen capturing:
if (!screen_capture_enabled ||
request.audio_type != content::MEDIA_NO_SERVICE ||
!request.security_origin.SchemeIsSecure()) {
callback.Run(content::MediaStreamDevices());
return;
}
Personally I don’t know why they deny non-SSL requests. Maybe they’re using iframes in sandbox mode or something else that runs only on HTTPS.
Browsers who don't understand {chromeMediaSource: 'screen'} constraint will simply get video like chrome stable or Firefox.
=
For signaling; please check following page:
https://github.com/muaz-khan/WebRTC-Experiment/blob/master/Signaling.md
Remember, you can use any signaling implementation exists out there without modifying any single line! Just skip below code and open above link!
=
WebRTC plugin free screen sharing experiment works fine on following web-browsers:
Browser | Support |
---|---|
Firefox | Stable / Aurora / Nightly |
Google Chrome | Stable / Canary / Beta / Dev |
Android | Chrome Beta |
=
WebRTC plugin free screen sharing experiment is released under MIT licence . Copyright (c) 2013 Muaz Khan.