浏览器屏幕截图API中的逻辑显示面是什么?

问题描述 投票:0回答:1

我想知道逻辑显示表面到底是什么?

在 MDN 文档中:

A logical display surface is one which is in part or completely obscured, either by being overlapped by another object to some extent, or by being entirely hidden or offscreen. How these are handled by the Screen Capture API varies. Generally, the browser will provide an image which obscures the hidden portion of the logical display surface in some way, such as by blurring or replacing with a color or pattern. This is done for security reasons, as the content that cannot be seen by the user may contain data which they do not want to share.

但是当我将

logicalSurface: true
添加到视频常数中时,没有任何变化。当我将其设置为
logicalSurface: false
时,也没有任何变化。大家能给我一个真实的例子吗?

const constraints = {
    video: {
                logicalSurface: true // True and False are same :'(
    },
    audio: true
}
const stream = await navigator.mediaDevices.getDisplayMedia(constraints);
localVideo.srcObject = stream;

谢谢你。

javascript web frontend webapi get-display-media
1个回答
0
投票

您可以通过查看

logicalSurface
的输出来检查浏览器是否支持
navigator.mediaDevices.getSupportedConstraints()
,例如在控制台中。

如果没有字段

logicalSurface
,您的浏览器不支持。

令我惊讶的是,甚至 Chrome v.124 也不支持它。

© www.soinside.com 2019 - 2024. All rights reserved.