MediaTrackSupportedConstraints: echoCancellation 属性
MediaTrackSupportedConstraints 字典的 echoCancellation 属性是一个只读的布尔值。如果 用户代理 支持 echoCancellation 约束,则该属性会出现在由 MediaDevices.getSupportedConstraints() 返回的对象中(且值为 true)。如果不支持该约束,则它不会包含在列表中,因此此值永远不会是 false。
您可以通过调用 navigator.mediaDevices.getSupportedConstraints() 来访问支持的约束字典。
值
如果用户代理支持 echoCancellation 约束,则此属性会出现在字典中(且其值始终为 true)。如果此属性不存在,则表示它在支持的约束字典中缺失,如果您尝试查看其值,将会得到 undefined。
示例
js
const result = document.getElementById("result");
const supported =
navigator.mediaDevices.getSupportedConstraints().echoCancellation;
result.textContent = supported ? "Supported!" : "Not supported!";
结果
规范
| 规范 |
|---|
| 媒体捕获和流 # dom-mediatrackconstraintset-echocancellation |
浏览器兼容性
加载中…