puppeteer-recorder
puppeteer-recorder copied to clipboard
Explain usage
I'd like to refer to #4, could someone elaborate on @maxschmeling's
It's built to record rendered frames. So you have to explicitly control the timing.
I still think this is worth demonstrating in the README.md, I'll happily make a PR once I'm confident how to use this.
How do I record (stupid) scenario like this?
const puppeteer = require('puppeteer');
const { record } = require('puppeteer-recorder');
(async () => {
const browser = await puppeteer.launch({
slowMo: 1000,
headless: false
});
const page = await browser.newPage();
// // HOW TO USE THIS?
// await record({
// browser: browser, // Optional: a puppeteer Browser instance,
// page: page, // Optional: a puppeteer Page instance,
// output: 'output.webm',
// fps: 5,
// frames: 60 * 50, // 5 seconds at 60 fps
// prepare: function (browser, page) { /* executed before first capture */ },
// render: function (browser, page, frame) { /* executed before each capture */ }
// });
//
await page.goto('https://example.com');
await page.goto('https://google.com');
await page.goto('https://example.com');
await page.goto('https://google.com');
await browser.close();
})();
Thanks!
The author doesn't care to answer. I appreciate the codebase, but without basic working example, this is virtually useless to nearly everyone. Once i have an answer figured out, i'll update here. It's 2019. Perhaps the author died or something.
@maietta its a bit rude to say author died isn't it? He shared his code and he is not making dime from it and even if he don't care to answer he has no obligation.
If u think u can do better then please fork it and move ahead :)