jjzjj

desktopCapturer

全部标签

javascript - 将 desktopCapturer 保存到 Electron 中的视频文件

desktopCapturerapi示例显示了如何将屏幕捕获流写入元素。//Intherendererprocess.vardesktopCapturer=require('electron').desktopCapturer;desktopCapturer.getSources({types:['window','screen']},function(error,sources){if(error)throwerror;for(vari=0;i我尝试用以下内容替换gotStream函数:functiongotStream(stream){varfs=require('fs');fs.

javascript - 如何在 Chrome DesktopCapture API 中监听 "Stop sharing"点击

我目前正在编写一个使用Chrome'sDesktopCaptureAPI的chrome扩展程序.当有人点击“停止共享”时,我很难设置回调。我尝试使用onendedEventHandler的MediaStream,但MediaStream的ended属性在单击按钮后仍设置为true。我能在流(单击按钮之前和之后)之间找到的唯一区别是videoTracks.readyState设置为ended。编辑:我还想注意用户是否关闭了他们之前正在播放的窗口。 最佳答案 我通过在videoTrack的onended属性上分配一个EventHandl