kaan_atakan
kaan_atakan

Reputation: 4047

How to tell what kind of screen sharing the user selected?

One can retrieve a stream of the users display using navigator.mediaDevices.getDisplayMedia . On some browsers I can also preselect the entire screens tab like so:

const stream = await navigator.mediaDevices.getDisplayMedia({
  // Pre-select the "Entire Screen" pane in the media picker.
  video: { displaySurface: "monitor" },
});

However the user is still free to pick any tab, window or screen they choose. Is there a way to find out what the user picked?

Upvotes: 4

Views: 260

Answers (0)

Related Questions