首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >电子18.2 desktopCapturer不在Ubuntu22LTS和Fedora 34中工作

电子18.2 desktopCapturer不在Ubuntu22LTS和Fedora 34中工作
EN

Stack Overflow用户
提问于 2022-05-12 06:22:03
回答 1查看 152关注 0票数 1
代码语言:javascript
复制
desktopCapturer.getSources({ types: ['screen'] }).then( sources => {
  fs.writeFile(`screenshot.jpg`, sources[0].thumbnail.toJPEG(25), (err) => {
    if (err) throw err
      console.log('Image Saved')
  })
})

上面的代码在ubuntu 18和20中进行了测试和工作,但它在Ubuntu22LTS和Fedora 34中不起作用。我在电子17中测试了这个应用程序。生成的屏幕截图图像是空的,不能工作(大小为0 kb)。

代码语言:javascript
复制
app.commandLine.appendSwitch('enable-features', 'WebRTCPipeWireCapturer');

我还在运行时启用了WebRTCPipeWireCapturer ( main.js )。

https://gitlab.com/seantaylor/electron-17-desktopcapturer-not-working

我在上面的存储库中添加了全部代码。有关安装说明和运行应用程序,请检查自述文件。

我也在电子github上提出了一张票,但没有得到解决办法。https://github.com/electron/electron/issues/33961

提前谢谢你

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-11 06:35:36

找到解决办法了。在ubuntu中禁用wayland解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72210913

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档