navigator.mediaDevices.getDisplayMedia({
audio: false,
video: true
}).then(gotMedia).catch(function(e) {
console.log('getDisplayMedia() error: ', e);
});
when executing the above code it prompts with a popup asking user to select what to share. Can we get rid of that popup and directly get the stream of the entire screen?
Would be glad if someone can help with the same. Thanks in advance
navigator.mediaDevices.getDisplayMedia({
audio: false,
video: true
}).then(gotMedia).catch(function(e) {
console.log('getDisplayMedia() error: ', e);
});
when executing the above code it prompts with a popup asking user to select what to share. Can we get rid of that popup and directly get the stream of the entire screen?
Would be glad if someone can help with the same. Thanks in advance
Share Improve this question edited Sep 18, 2020 at 13:07 Pradipta Dey asked Sep 18, 2020 at 13:01 Pradipta DeyPradipta Dey 1631 gold badge2 silver badges11 bronze badges 7-
one word ... security
get the stream of the whole puter
... the what? the stream? I've build hundreds of puters in my time, and not one contains a stream (except that time I screwed up a connection on the water cooling, but that was more of a leak) – Jaromanda X Commented Sep 18, 2020 at 13:03 - Added a screenshot and changed the minor word flaw. – Pradipta Dey Commented Sep 18, 2020 at 13:09
- so, you addressed the frivolous part of my ment, and decided there is no security issue with what you want to do? Do you understand why this would be a bad thing? – Jaromanda X Commented Sep 18, 2020 at 13:18
- Sorry could not figure out your ment first. Yes I know there is a security issue. Still I need clear idea on this. Can you please explain a bit in detail. Thanks – Pradipta Dey Commented Sep 18, 2020 at 13:24
- 2 Yes but in case of getUserMedia to access camera we provide the authentication once and after that the browser does not ask for the same. But for the getDisplayMedia it is not the same. It always asks even if we are using the same tab. – Pradipta Dey Commented Sep 18, 2020 at 15:35
1 Answer
Reset to default 6For automated testing it is possible to preselect a window with a Chrome mand line argument --auto-select-desktop-capture-source
This Chrome issue is the best available documentation: https://bugs.chromium/p/chromium/issues/detail?id=459532