如何停止由 chrome.tabCapture API 在 chrome 中启动的捕获媒体流
How to stop the capturing mediastream that is started by chrome.tabCapture API in chrome
我正在开发 chrome 扩展,我使用 chrome.tabCapture API to capture the stream from a tab of the chrome browser and to record the stream using MediaStreamRecorder.js。我可以使用 mediaRecorder.stop() 停止流的记录,但是 chrome.tabCapture API 不会结束。它不断发送流。我需要停止特定选项卡的 chrome.tabCapture API 运行。
尝试:
stream.getVideoTracks()[0].stop();
要提高视频质量,请指定 videoConstraints
:
chrome.tabCapture.capture({
videoConstraints: { mandatory: { maxWidth: 4000,
maxHeight: 4000}
}}, callbackFunction);
我正在开发 chrome 扩展,我使用 chrome.tabCapture API to capture the stream from a tab of the chrome browser and to record the stream using MediaStreamRecorder.js。我可以使用 mediaRecorder.stop() 停止流的记录,但是 chrome.tabCapture API 不会结束。它不断发送流。我需要停止特定选项卡的 chrome.tabCapture API 运行。
尝试:
stream.getVideoTracks()[0].stop();
要提高视频质量,请指定 videoConstraints
:
chrome.tabCapture.capture({
videoConstraints: { mandatory: { maxWidth: 4000,
maxHeight: 4000}
}}, callbackFunction);