Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Microsoft Playwright Screencast

From Leeroopedia
Revision as of 11:38, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Microsoft_Playwright_Screencast.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Implementation Page

Overview

Screencast manages page screencast capture and video recording, coordinating between browser screencast frames and the FFmpeg-based video recorder with intelligent frame throttling.

Description

The Screencast class handles two responsibilities: 1. Video recording -- Starts and stops VideoRecorder instances to capture page content as WebM video files 2. Frame throttling -- Uses the internal FrameThrottler class to control frame rate, aiming at 25fps for video recording and 5fps for tracing, with burst capability around user actions

The throttler maintains a "recharge" mechanism that allows temporary bursts of high-framerate capture around user interactions, then settles back to a lower rate for background recording.

Usage

Created internally per page when video recording or tracing with screenshots is enabled.

Code Reference

Source Location

packages/playwright-core/src/server/screencast.ts (224 lines)

Class Signature

export class Screencast {
  constructor(page: Page)
  stopFrameThrottler(): void
  setOptions(options: { width: number; height: number; quality: number } | null): void
  throttleFrameAck(ack: () => void): void
  temporarilyDisableThrottling(): void
  async startVideoRecording(options: types.VideoOptions): Promise<void>
  async stopVideoRecording(): Promise<void>
}

Import

import { Screencast } from './server/screencast';

I/O Contract

Inputs

  • page: Page -- the page to capture
  • Video options: output file path, width, height
  • Screencast options: width, height, quality

Outputs

  • WebM video files written to disk via VideoRecorder
  • Frame throttling callbacks for tracing integration

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment