Need help with playwright-video?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

177 Stars 14 Forks BSD 3-Clause "New" or "Revised" License 130 Commits 16 Opened issues


ğŸŽ¬ Save a video of a Playwright page

Services available


Need anything else?

Contributors list


npm version Unit Tests

ğŸŽ¬ Save a video recording of a Playwright page (Chromium only for now)

When Playwright adds support for the Screencast API in Firefox and WebKit, this will be updated to support these browsers.


npm i playwright playwright-video @ffmpeg-installer/ffmpeg

If you already have FFmpeg installed, you can skip the

installation by setting the
environment variable.
npm i playwright playwright-video


const { chromium } = require('playwright');
const { saveVideo } = require('playwright-video');

(async () => { const browser = await chromium.launch(); const context = await browser.newContext(); const page = await context.newPage();

await saveVideo(page, '/tmp/video.mp4'); await page.goto(''); await'a');

await browser.close(); })();

The video will be saved at the specified

in the above example).


playwright-video.saveVideo(page, savePath[, options])

  • page
    <Page> Save a video of this page. Only supports Chromium for now.
  • savePath
    <string> Where to save the video.
  • options
    • followPopups
      <[boolean]> Whether or not to follow browser focus when popups are opened. Defaults to
      . Note: this option will only work correctly if the popups opened are the same size as the original page. If a smaller or larger popup is open, frames will be scaled to fit the original size.
    • fps
      <[number]> The frames per second for the recording. Defaults to
      . A higher number will improve the recording quality but also increase the file size.
  • returns: <Promise<PageVideoCapture>>

Records video of a page and saves it at the specified path.

await saveVideo(page, '/tmp/video.mp4');

class: PageVideoCapture


is created when you call
. It manages capturing the video of your page and saving it.


Stop the video capture if needed and save the video. The returned

resolves when the video is saved.

The video capture will be stopped automatically if you close the page, so you should not need to call this unless you want to explicitly wait until the video is saved.

const capture = await saveVideo(page, '/tmp/video.mp4');
await capture.stop();

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.