var audio = new Audio(); audio.setSinkId("communications");
我将收到此错误:
DOMException: No permission to use requested device
因此,为了获得许可,我试图这样做:
navigator.webkitGetUserMedia({ audio: true }, (stream) => { console.log("stream: ", stream); }, (error) => { console.log("error: ", error); });
但是现在我明白了:
error: NavigatorUserMediaError {name: "InvalidStateError", message: "", constraintName: ""}
我不知道,是否
- 'audio' is not available (but actually it should)
- I need a secure connection (but how do I get this at a chrome app?)
我正在尝试在chrome应用程序的音频元素中更改sinkId。代码:var audio = new Audio(); audio.setSinkId(“通讯”);我将收到此错误:DOMException:没有使用权限...
根据规格,应该有一个Permission.request()
方法,该方法应该接受PermissionDescriptor