【发布时间】:2017-06-27 00:13:17
【问题描述】:
在 chrome 扩展中,我使用以下行来捕获屏幕
chrome.desktopCapture.chooseDesktopMedia
通过此屏幕(桌面)流工作正常,但是当我尝试使用
捕获音频时constraints = {
audio: {
mandatory: {
chromeMediaSource: 'system',
chromeMediaSourceId: audioSource,
}
},
video: {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: event.data.sourceId,
maxWidth: window.screen.width,
maxHeight: window.screen.height,
maxFrameRate: 3
},
optional: [
{ googLeakyBucket: true },
{ googTemporalLayeredScreencast: true }
]
}
};
注意:已经在音频块中测试了 event.data.sourceId 代替 audioSource。
音频不工作,我可以从流中看到(在控制台中)音频媒体轨道
this app 也有同样的功能
【问题讨论】:
标签: javascript google-chrome-extension screen html5-audio