PuppeteerScreenRecorder class is responsible for managing the video
const screenRecorderOptions = { followNewTab: true, fps: 15,}const savePath = "./test/demo.mp4";const screenRecorder = new PuppeteerScreenRecorder(page, screenRecorderOptions);await screenRecorder.start(savePath); // some puppeteer action or testawait screenRecorder.stop() Copy
const screenRecorderOptions = { followNewTab: true, fps: 15,}const savePath = "./test/demo.mp4";const screenRecorder = new PuppeteerScreenRecorder(page, screenRecorderOptions);await screenRecorder.start(savePath); // some puppeteer action or testawait screenRecorder.stop()
total duration of video
getRecordDuration
return the total duration of the video recorded,
accepts a path string to store the video
PuppeteerScreenRecorder
start
Start the video capturing session
const savePath = './test/demo.mp4'; //.mp4 is required await recorder.start(savePath); Copy
const savePath = './test/demo.mp4'; //.mp4 is required await recorder.start(savePath);
startStream
Start the video capturing session in a stream
const stream = new PassThrough(); await recorder.startStream(stream); Copy
const stream = new PassThrough(); await recorder.startStream(stream);
indicate whether stop is completed correct or not, if true without any error else false.
stop
stop the video capturing session
PuppeteerScreenRecorder class is responsible for managing the video