Re: [mediacapture-screen-share] Multi-capture (concurrent capture of multiple surfaces) (#204)

Love this idea. I developed a native Mac app called Screegle that allows a user to select one or more window and overlay them over a background picture of their choosing.
This is very useful during Google Meet or Zoom meetings, where instead of sharing their entire screen or having to pick just one window, people can flexibly share several windows at once.

As you point out, getDisplayMedia could be called several times, but it is not user-friendly.
Also, once the web application gets several streams, it still doesn't know where to paint them.
I.e if the application wants to render selected streams onto a virtual desktop (like Screegle does), it needs access to the X,Y positions of the originating windows (I assume getDisplayMedia's stream's width/height are the actual window width/height?)

My current workaround is ugly and very inefficient: first the user is asked to share their entire screen by clicking "Share Screen", which calls getDisplayMedia and checks that the capabilities' deviceId contains `screen:`.

Users then can pick individual windows by clicking "Share Window", which calls again getDisplayMedia and checks that the deviceId contains `window:`.

The really slow part is determining where each window appears in the overall screen image.
The prototype currently uses a brute force pixel matching by sliding the image of each window across the screen image, modulo a boost in speed by examining every 16 pixels instead of each.

It would be great if the browser had 2 new things:
- a way to let users pick several windows at once (as you suggested)
- add a new API that, given an opaque streamID, gives back the X,Y,W,H of the corresponding window on the desktop


GitHub Notification of comment by ldenoue
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Saturday, 12 February 2022 15:57:48 UTC