Screencast

Playwright\Screencast\ScreencastInterface

Records a video of a page and draws annotations over it. The overlay and action methods work whether or not a recording is running, so they can also be used to decorate a page on their own.

Methods

hideActions()

void

Stops decorating actions and removes the decorations already on screen.

function hideActions(): void

hideOverlays()

void

Stops rendering the overlays without discarding them, so showOverlays() can bring them back.

function hideOverlays(): void

showActions()

void

Decorates every later action with a cursor and a title, until hideActions() is called.

function showActions(array $options = []): void

showChapter()

void

Shows a title card over a blurred backdrop, removed once its duration elapses.

function showChapter(string $title, array $options = []): void

showOverlay()

void

Draws HTML over the page; without a duration the overlay stays until hideOverlays().

function showOverlay(string $html, array $options = []): void

showOverlays()

void

Renders the overlays that hideOverlays() had suppressed.

function showOverlays(): void

start()

void

Starts recording; without a path the frames are captured but never written anywhere. Throws when a screencast is already running on the page.

function start(array $options = []): void

stop()

void

Writes the video to the path given to start(); does nothing when no screencast is running.

function stop(): void