using puppeteer-recorder to record video of browser
Add two empty functions called prepare
and render
in the options.
await record({
browser: global_browser, // Optional: a puppeteer Browser instance,
page, // Optional: a puppeteer Page instance,
output: path + 'output.webm',
fps: 60,
frames: 60 * 5, // 5 seconds at 60 fps,
prepare: function () {}, // <-- add this line
render: function () {} // <-- add this line
});
Basically it's missing some default functions and the error is not handled properly.
I know this would be a very late response to your question, but nevertheless.
A years ago, I visited this same stack-overflow thread and I had similar challenge of finding a screen recorder library which does a good job a capturing the video as well as offers an options to manually start and stop the recording.
Finally I wrote one for myself and distributed as NPM library...!!
https://www.npmjs.com/package/puppeteer-screen-recorder
Hope this is helpful...!!