Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain usage #5

Open
vasekch opened this issue May 16, 2018 · 2 comments
Open

Explain usage #5

vasekch opened this issue May 16, 2018 · 2 comments

Comments

@vasekch
Copy link

vasekch commented May 16, 2018

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!

@maietta
Copy link

maietta commented Apr 13, 2019

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.

@shirshak55
Copy link

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants