最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is it possible to use navigator.getDisplayMedia without user authentication? - Stack Overflow

programmeradmin4浏览0评论
 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
 |  Show 2 more ments

1 Answer 1

Reset to default 6

For 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

发布评论

评论列表(0)

  1. 暂无评论