0
我流ID从desktopCapture.chooseDesktopMedia API,但getUserMedia失败getUserMedia抛出错误NavigatorUserMediaError:InvalidStateError
navigator.mediaDevices.getUserMedia({
audio: {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: streamId
}
},
video: {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: streamId,
maxWidth: window.screen.width,
maxHeight: window.screen.height
}
}
}).then(function(stream) {
}).catch(function(err) {
// The error show here
console.log(err)
});
感谢
对不起。我是编辑说明\t。错误显示在catch –
你得到了什么错误。 – Kumar
@Kumar响应于tabCapture.capture的错误:第一个参数是必需的。 运行时未经检查的runtime.lastError tabCapture.capture:尚未为当前页面调用扩展(请参阅activeTab权限)。 Chrome页面无法捕获。 –