Is there a way to auto-select specific tab when using navigator.mediaDevices.getDisplayMedia?

Viewed 1268

I am currently working on a screen capturing feature in chrome using

navigator.mediaDevices.getDisplayMedia

I am only able to open a user selection where the user can choose from all the given displaymedias. Is there any way to go around the selection and select a tab via the tab name automaticly?

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia I have read the privacy and security part in which it says that

In addition, user permission is always required to access the user's audio and video inputs.

but im still wondering if there is a way?

1 Answers

very few available constrains for getDisplayMedia

getDisplayMedia({preferCurrentTab:true}) // in chrome 96

hopefully getViewportMedia, getViewportScreenshot coming soon

Related