{
  "slug": "playwright-page-screencast-records-videos-streams-frames-and-manages-annotations-00eb8f27722c",
  "title": "Playwright page.screencast records videos, streams frames and manages annotations",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-01T00:27:06.000Z",
  "announced_at": "2026-04-01T00:27:06.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When preparing browser workflow evidence, record activity or capture JPEG frames with `page.screencast.start()` and finish with `page.screencast.stop()`; add action annotations or overlays as needed. In Playwright Test fixtures, configure annotations under the `video` option.",
    "examples": [
      "await page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });\n// ... perform actions ...\nawait page.screencast.stop();",
      "await page.screencast.start({\n  onFrame: ({ data, timestamp, viewportWidth, viewportHeight }) => {\n    processFrame(data, timestamp, viewportWidth, viewportHeight);\n  },\n  size: { width: 800, height: 600 },\n});\n// ... perform actions ...\nawait page.screencast.stop();",
      "await page.screencast.start({ path: 'video.webm' });\nawait page.screencast.showActions({ position: 'top-right' });\nawait page.screencast.showChapter('Verification', { description: 'Browser workflow evidence' });\n// ... perform actions ...\nawait page.screencast.stop();"
    ],
    "gotchas": [
      "Version: v1.59.0",
      "start({ path }): `path` is optional; when supplied, starts recording to that file. `size` optionally sets maximum frame width and height; `onFrame` optionally receives JPEG frame data and viewport dimensions.",
      "showActions({ position, duration, fontSize }): All options are optional. `position` selects the title overlay position; `duration` sets annotation display time in milliseconds (default 500); `fontSize` sets title size in pixels (default 24). Returns a disposable that stops annotations when disposed.",
      "showChapter(title, { description, duration }) (required): `title` is required. `description` and `duration` are optional; duration is milliseconds and defaults to 2000.",
      "showOverlay(html, { duration }) (required): `html` is required. Optional `duration` is milliseconds; without it, the overlay stays until dismissed or disposed.",
      "video.show.actions.position: In the Playwright Test `video` option, `show.actions.position` selects the annotation title position; `show.test.position` selects the test annotation position.",
      "Prerequisite: The screencast methods are documented as added in Playwright v1.59.",
      "Prerequisite: For Playwright Test fixture video annotations, configure the `video` option under `use`; the release-note example sets `mode: 'on'`.",
      "`showActions()` accepts `position` values `'top-left'`, `'top'`, `'top-right'`, `'bottom-left'`, `'bottom'`, and `'bottom-right'`, `duration` in milliseconds per annotation, and `fontSize` in pixels; it returns a disposable to stop showing actions.",
      "Docs conflict: The current API docs include later additions: `cursor` since v1.61 and `style` since v1.64; they also mark `fontSize` deprecated. Those later changes do not establish v1.59 behavior."
    ]
  },
  "why_it_matters": "When verifying a repository's browser workflow and preparing evidence for review, record the page activity with annotations or capture frames for processing.",
  "before": "The v1.59 release note describes `page.screencast.start()` and `stop()` as an alternative to the `recordVideo` browser-context option.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.59.0",
    "https://playwright.dev/docs/api/class-screencast"
  ],
  "rank": 0.93042,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-c895c80e51052b9f-0:gate",
    "evidence_hash": "30b837f8ffc622b81590dae29ec5e3dfaebcd07c790a4f14dc0a6b78c001ee6a"
  },
  "review": {
    "draft_hash": "fbd982a76c73a73f5b58853a35865eb7c0073928401c7c7b6ca2fa3083e8d3ea",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.93 >= 0.9; 2 needed) and Jev gave 0.79 (>= 0.6 needed)."
  }
}
