Re: [w3ctag/design-reviews] Screen Capture API (#309)

I have just (yesterday) updated the demo on the WebRTC samples page so that it shows a more relevant example. Please have a look.

Currently, this (i.e., `navigator.getDisplayMedia()`) is only supported in Chrome if you enable Experimental Web Platform features. Firefox currently implements this through `navigator.mediaDevices.getUserMedia()` by passing in a MediaStreamConstraint matching the screen. This is a potential privacy issue, as this is the same API that opens the camera (thanks @kenchris for noticing). This is how I've done it in the sample at the moment:
```
if (navigator.getDisplayMedia) {
  return navigator.getDisplayMedia({video: true});
} else {
  return navigator.mediaDevices.getUserMedia({video: {mediaSource: 'screen'}});
}
``` 
If the code above would run on a browser that doesn't support screen capturing (`navigator.getDisplayMedia` missing and no support for `mediaSource` constraint), the default video camera will be opened instead (because the value for the `video` key is truthy).

I'm thinking of dropping the Firefox support in the sample and only allow `getDisplayMedia()` for that reason.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/309#issuecomment-434674786

Received on Wednesday, 31 October 2018 12:53:13 UTC