Google Meet 如何让您从另一个标签共享屏幕?

How does Google Meet allow you to screen share from another tab?

Google Meet, if you click "Present Now" then "A Chrome Tab", it brings up a window that lets you share from another tab. This is different to the standard Screen Capture API 中就像您只是 运行

navigator.mediaDevices.getDisplayMedia({
    video: true,
    audio: true,
})

您会看到 window,您可以在其中选择共享整个屏幕、共享 window 或共享标签。我想将其限制为仅限选项卡。我尝试过应用约束,例如:

video: { displaySurface: 'browser' }

video: { displaySurface: { exact: 'browser' } }

然而,the specs say that this doesn't work而且确实不是。但如果是这样的话,那么GoogleMeet是怎么做到的呢?

Google Meet 使用较旧的扩展程序 API 进行屏幕共享。 This API 允许限制源类型。它仍然可用,但需要扩展(Google meet 提供了预安装的扩展)。

标准的 getDisplayMedia 不允许限制 displaySurface 的类型。