1

I am writing code for which is supposed to make screenshots of user monitor. I am using getDisplayMedia function to capture user screen and then making image from current frame in some intervals.

I call for getDisplayMedia with function:

await navigator.mediaDevices.getDisplayMedia({
       audio: false,
       video: {
         displaySurface: 'monitor',
         width: { ideal: 1280, max: 1920 },
         height: { ideal: 720, max: 1080 },
       },
     });

It seems that setting displaySurface to monitor only sets fullscreen tab as default. User can still change it to browser tab or window. Is there any option to allow only recording of fullscreen?

I am using Brave browser (based on Chromium) on macOS Ventura.

BobiDaHombre
  • 193
  • 1
  • 4
  • 19

0 Answers0