docs/api/puppeteer.page.screencast.md
Captures a screencast of this page.
class Page {
screencast(options?: Readonly<ScreencastOptions>): Promise<ScreenRecorder>;
}
Parameter
</th><th>Type
</th><th>Description
</th></tr></thead> <tbody><tr><td>options
</td><td>Readonly<ScreencastOptions>
</td><td>(Optional) Configures screencast behavior.
</td></tr> </tbody></table>Returns:
Promise<ScreenRecorder>
By default, all recordings will be WebM format using the VP9 video codec, with a frame rate of 30 FPS.
You must have ffmpeg installed on your system.
Recording a page:
import puppeteer from 'puppeteer';
// Launch a browser
const browser = await puppeteer.launch();
// Create a new page
const page = await browser.newPage();
// Go to your site.
await page.goto("https://www.example.com");
// Start recording.
const recorder = await page.screencast({path: 'recording.webm'});
// Do something.
// Stop recording.
await recorder.stop();
browser.close();