Skip to main content

Screencast

Interface for capturing screencast frames from a page.


Methods

HideActionsAsync

Added in: v1.59 screencast.HideActionsAsync

Removes action decorations.

Usage

await Screencast.HideActionsAsync();

Returns


HideOverlaysAsync

Added in: v1.59 screencast.HideOverlaysAsync

Hides overlays without removing them.

Usage

await Screencast.HideOverlaysAsync();

Returns


ShowActionsAsync

Added in: v1.59 screencast.ShowActionsAsync

Enables visual annotations on interacted elements. Returns a disposable that stops showing actions when disposed.

Usage

await Screencast.ShowActionsAsync(options);

Arguments

  • options ScreencastShowActionsOptions? (optional)
    • Cursor enum ScreencastCursor { None, Pointer }? (optional) Added in: v1.61#

      Cursor decoration shown for pointer actions. "pointer" (the default) renders a mouse pointer that animates from the previous action point to the next one. "none" disables the cursor decoration.

    • Duration [float]? (optional)#

      How long each annotation is displayed in milliseconds. Defaults to 500.

    • FontSize int? (optional)#

      Font size of the action title in pixels. Defaults to 24.

    • Position enum AnnotatePosition { TopLeft, Top, TopRight, BottomLeft, Bottom, BottomRight }? (optional)#

      Position of the action title overlay. Defaults to "top-right".

Returns

  • [Disposable]#

ShowChapterAsync

Added in: v1.59 screencast.ShowChapterAsync

Shows a chapter overlay with a title and optional description, centered on the page with a blurred backdrop. Useful for narrating video recordings. The overlay is removed after the specified duration, or 2000ms.

Usage

await Screencast.ShowChapterAsync(title, options);

Arguments

  • title string#

    Title text displayed prominently in the overlay.

  • options ScreencastShowChapterOptions? (optional)

    • Description string? (optional)#

      Optional description text displayed below the title.

    • Duration [float]? (optional)#

      Duration in milliseconds after which the overlay is automatically removed. Defaults to 2000.

Returns


ShowOverlayAsync

Added in: v1.59 screencast.ShowOverlayAsync

Adds an overlay with the given HTML content. The overlay is displayed on top of the page until removed. Returns a disposable that removes the overlay when disposed.

Usage

await Screencast.ShowOverlayAsync(html, options);

Arguments

  • html string#

    HTML content for the overlay.

  • options ScreencastShowOverlayOptions? (optional)

    • Duration [float]? (optional)#

      Duration in milliseconds after which the overlay is automatically removed. Overlay stays until dismissed if not provided.

Returns

  • [Disposable]#

ShowOverlaysAsync

Added in: v1.59 screencast.ShowOverlaysAsync

Shows overlays.

Usage

await Screencast.ShowOverlaysAsync();

Returns


StartAsync

Added in: v1.59 screencast.StartAsync

Starts the screencast. When Path is provided, it saves video recording to the specified file. When OnFrame is provided, delivers JPEG-encoded frames to the callback. Both can be used together.

Usage

Arguments

  • options ScreencastStartOptions? (optional)
    • OnFrame Func<[ScreencastFrame], Task> (optional)#

      • Data byte[]

        JPEG-encoded frame data.

      • Timestamp [float]

        The timestamp of when the frame was presented by the browser, in milliseconds since the Unix epoch.

      • ViewportWidth int

        Width of the page viewport at the time the frame was captured.

      • ViewportHeight int

        Height of the page viewport at the time the frame was captured.

      Callback that receives JPEG-encoded frame data along with the page viewport size at the time of capture.

    • Path string? (optional)#

      Path where the video should be saved when the screencast is stopped. When provided, video recording is started.

    • Quality int? (optional)#

      The quality of the image, between 0-100.

    • Size Size? (optional)#

      • Width int

        Max frame width in pixels.

      • Height int

        Max frame height in pixels.

      Specifies the dimensions of screencast frames. The actual frame is scaled to preserve the page's aspect ratio and may be smaller than these bounds. If a screencast is already active (e.g. started by tracing or video recording), the existing configuration takes precedence and the frame size may exceed these bounds or this option may be ignored. If not specified the size will be equal to page viewport scaled down to fit into 800×800.

Returns

  • [Disposable]#

StopAsync

Added in: v1.59 screencast.StopAsync

Stops the screencast and video recording if active. If a video was being recorded, saves it to the path specified in Screencast.StartAsync().

Usage

await Screencast.StopAsync();

Returns