9

I am able to achive it in firefox by folowing below steps:

  1. make my server https
  2. append my domain to the user preference media.getusermedia.screensharing.allowed_domains in about:config to whitelist it for screen sharing.
  3. use constraint like {video: {mediaSource: "screen"}},

but in chrome, I am getting totally lost.

most places keep telling: You'll need to first enable the flag called Enable screen capture support in getUserMedia() in chrome://flags. ( but I am unable to find this flag anywhere)

I have checked Muaz Khan's screen share plugin, it works great, but afraid that it is coupled with other WebRTC experiment projects, and I am not sure how to customize the plugin to my project.

At this junction, I have come to an understanding that, without plug-in or flags, cannot capture the desktop mediastream.

so what I would like to know is, what is the flag I must enable/ what must be part of a plug-in written from scratch to make chrome support capturing desktop the same way it allows us to capture camera.

mido
  • 24,198
  • 15
  • 92
  • 117
  • This is why you cannot find anymore https://code.google.com/p/chromium/issues/detail?id=347641 – Luizgrs Apr 06 '15 at 12:05
  • 2
    Just to confirm, [that plugin](https://github.com/muaz-khan/Chrome-Extensions/tree/master/desktopCapture) isn't having any single dependency. It is 100% standalone; and it can be used within any 3rd party WebRTC code. Many "big-well-known" companies are already using it in their products :) – Muaz Khan Apr 06 '15 at 12:59

2 Answers2

9

In Chrome/Chromium you cannot use "standard" Javascript to capture users screen anymore.

It was replaced by the chrome.desktopCapture API, which is exclusive for Chrome extensions.

The example you're providing rely in this API and an extensions. It's plugin free but not extension free.

Luizgrs
  • 4,765
  • 1
  • 22
  • 28
2

The enable-usermedia-screen-capture flag was removed from chrome://flags/ in Chrome M36 (Chromium Issue 347641).

For testing or experimenting, the feature can still be enabled when starting Chrome with chrome --enable-usermedia-screen-capturing (tested in Chrome 68).

Screenshot:

enter image description here

The Chrome Platform Status also highlights a MediaStream.getDisplayMedia() implementation, which will allow developers to record or share the screen from the browser without any plugin. The specification for this can be found in the Screen Capture Editor's Draft.

Benny Code
  • 51,456
  • 28
  • 233
  • 198