{"id":13681535,"url":"https://github.com/qawolf/playwright-video","last_synced_at":"2025-09-27T00:31:34.748Z","repository":{"id":49669502,"uuid":"243342386","full_name":"qawolf/playwright-video","owner":"qawolf","description":"🎬 Save a video of a Playwright page","archived":true,"fork":false,"pushed_at":"2021-06-11T04:07:01.000Z","size":1336,"stargazers_count":194,"open_issues_count":16,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-09-21T07:33:51.899Z","etag":null,"topics":["e2e","e2e-testing","playwright","video-capture"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qawolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-26T19:01:26.000Z","updated_at":"2024-08-23T18:25:34.000Z","dependencies_parsed_at":"2022-09-13T08:00:31.370Z","dependency_job_id":null,"html_url":"https://github.com/qawolf/playwright-video","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qawolf%2Fplaywright-video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qawolf%2Fplaywright-video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qawolf%2Fplaywright-video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qawolf%2Fplaywright-video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qawolf","download_url":"https://codeload.github.com/qawolf/playwright-video/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871828,"owners_count":16554457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["e2e","e2e-testing","playwright","video-capture"],"created_at":"2024-08-02T13:01:32.020Z","updated_at":"2025-09-27T00:31:29.362Z","avatar_url":"https://github.com/qawolf.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# playwright-video\n\n[![npm version](https://badge.fury.io/js/playwright-video.svg)](https://badge.fury.io/js/playwright-video) ![Unit Tests](https://github.com/qawolf/playwright-video/workflows/Unit%20Tests/badge.svg)\n\n🎬 Save a video recording of a [Playwright](https://github.com/microsoft/playwright) page (Chromium only for now)\n\nWhen Playwright adds support for the Screencast API in Firefox and WebKit, this will be updated to support these browsers.\n\n## Install\n\n```sh\nnpm i playwright playwright-video @ffmpeg-installer/ffmpeg\n```\n\nIf you already have [FFmpeg](https://www.ffmpeg.org) installed, you can skip the `@ffmpeg-installer/ffmpeg` installation by setting the `FFMPEG_PATH` environment variable.\n\n```sh\nnpm i playwright playwright-video\n```\n\n## Use\n\n```js\nconst { chromium } = require('playwright');\nconst { saveVideo } = require('playwright-video');\n\n(async () =\u003e {\n  const browser = await chromium.launch();\n  const context = await browser.newContext();\n  const page = await context.newPage();\n\n  await saveVideo(page, '/tmp/video.mp4');\n  await page.goto('http://example.org');\n  await page.click('a');\n\n  await browser.close();\n})();\n```\n\nThe video will be saved at the specified `savePath` (`/tmp/video.mp4` in the above example).\n\n## API\n\n#### playwright-video.saveVideo(page, savePath[, options])\n\n- `page` \u003c[Page]\u003e Save a video of this page. Only supports Chromium for now.\n- `savePath` \u003c[string]\u003e Where to save the video.\n- `options` \u003c[Object]\u003e\n  - `followPopups` \u003c[boolean]\u003e Whether or not to follow browser focus when popups are opened. Defaults to `false`. 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.\n  - `fps` \u003c[number]\u003e The frames per second for the recording. Defaults to `25`. A higher number will improve the recording quality but also increase the file size.\n- returns: \u003c[Promise]\u003c[PageVideoCapture](#class-pagevideocapture)\u003e\u003e\n\nRecords video of a page and saves it at the specified path.\n\n```js\nawait saveVideo(page, '/tmp/video.mp4');\n```\n\n### class: PageVideoCapture\n\nA `PageVideoCapture` is created when you call `saveVideo`. It manages capturing the video of your page and saving it.\n\n### pageVideoCapture.stop()\n\n- returns \u003c[Promise]\u003e\n\nStop the video capture if needed and save the video. The returned `Promise` resolves when the video is saved.\n\nThe 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.\n\n```js\nconst capture = await saveVideo(page, '/tmp/video.mp4');\nawait capture.stop();\n```\n\n[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object 'Object'\n[page]: https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page 'Page'\n[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise 'Promise'\n[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type 'string'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqawolf%2Fplaywright-video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqawolf%2Fplaywright-video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqawolf%2Fplaywright-video/lists"}