how to use navigator.getDisplayMedia with auto selecting the screen?

Viewed 33
navigator.mediaDevices.getDisplayMedia({
    audio: false,
    video: true
  }).then(gotMedia).catch(function(e) {
    console.log('getDisplayMedia() error: ', e);
  });

Will cause a pop up like this

enter image description here

I can see in another question that using --auto-select-desktop-capture-source in a headless browser can fix the issue but how can implement it in the JavaScript section? I wish the screen capture automatically starts from the current tab without any popups to select which tab.

0 Answers
Related