admin管理员组文章数量:1315061
I'm encountering an issue with Puppeteer and the MediaRecorder API when trying to capture display media on Ubuntu Linux. On Windows it works well it captures screen and video chunks are generated which are playable also but on Ubuntu linux this below mentioned error is occuring. Here's the relevant part of my code:
const stream = await navigator.mediaDevices.getDisplayMedia({
video: {
displaySurface: "monitor",
width: 1368,
height: 768,
},
// audio: { deviceId: "default" },
});
const mediaRecorder = new MediaRecorder(stream);
mediaRecorder.ondataavailable = (event) => {
// ... processing chunks ...
};
I'm encountering an issue with Puppeteer and the MediaRecorder API when trying to capture display media on Ubuntu Linux. On Windows it works well it captures screen and video chunks are generated which are playable also but on Ubuntu linux this below mentioned error is occuring. Here's the relevant part of my code:
const stream = await navigator.mediaDevices.getDisplayMedia({
video: {
displaySurface: "monitor",
width: 1368,
height: 768,
},
// audio: { deviceId: "default" },
});
const mediaRecorder = new MediaRecorder(stream);
mediaRecorder.ondataavailable = (event) => {
// ... processing chunks ...
};
When I run this code on Ubuntu Linux, I get the error:
Error getting display media: NotReadableError
Additional Context
- The Puppeteer browser is launched with following parameters and in non-headless mode
--use-fake-ui-for-media-stream,
--auto-select-desktop-capture-source=Entire screen,
--enable-features=AudioServiceOutOfProcess,
--no-sandbox,
--disable-setuid-sandbox,
--disable-features=IsolateOrigins,site-per-process
- This issue does not occur on Windows OS. Everything works fine there.
What I've Tried
Using --use-fake-ui-for-media-stream flag
Using --auto-select-desktop-capture-source=Entire screen flag,
Enabling AudioServiceOutOfProcess
Disabling sandbox features
Expected Behavior
I expect to be able to capture the entire screen using the MediaRecorder API on Ubuntu Linux.
Actual Behavior
The getDisplayMedia() call fails with a NotReadableError on Ubuntu Linux.
Share Improve this question edited Jan 30 at 10:35 Shubham More asked Jan 30 at 10:30 Shubham MoreShubham More 12 bronze badges1 Answer
Reset to default 0const stream = await navigator.mediaDevices.getDisplayMedia({
video: {
displaySurface: "cell",
width: 1368,
height: 768,
},
// audio: { deviceId: "default" },
});
const mediaRecorder = new MediaRecorder(stream);
mediaRecorder.ondataavailable = (event) => {
// ... processing chunks ...
};
本文标签:
版权声明:本文标题:windows - Puppeteer MediaRecorder API error: NotReadableError when capturing display media on Ubuntu Linux - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741972888a2407946.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论