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?
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?
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/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?
Share Improve this question asked Apr 22, 2021 at 13:55 Marcus LanversMarcus Lanvers 4116 silver badges21 bronze badges2 Answers
Reset to default 15very few available constrains for getDisplayMedia
getDisplayMedia({preferCurrentTab:true}) // in chrome 96
hopefully getViewportMedia, getViewportScreenshot ing soon
Try this mand-line flag:
--auto-select-tab-capture-source-by-title="The target tab's title"