Skip to main content

Screencast

Interface for capturing screencast frames from a page.


Methods

hide_actions

Added in: v1.59 screencast.hide_actions

Removes action decorations.

Usage

screencast.hide_actions()

Returns


hide_overlays

Added in: v1.59 screencast.hide_overlays

Hides overlays without removing them.

Usage

screencast.hide_overlays()

Returns


show_actions

Added in: v1.59 screencast.show_actions

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

Usage

screencast.show_actions()
screencast.show_actions(**kwargs)

Arguments

  • duration float (optional)#

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

  • font_size int (optional)#

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

  • position "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" (optional)#

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

Returns

  • [Disposable]#

show_chapter

Added in: v1.59 screencast.show_chapter

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

screencast.show_chapter(title)
screencast.show_chapter(title, **kwargs)

Arguments

  • title str#

    Title text displayed prominently in the overlay.

  • description str (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


show_overlay

Added in: v1.59 screencast.show_overlay

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

screencast.show_overlay(html)
screencast.show_overlay(html, **kwargs)

Arguments

  • html str#

    HTML content for the overlay.

  • duration float (optional)#

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

Returns

  • [Disposable]#

show_overlays

Added in: v1.59 screencast.show_overlays

Shows overlays.

Usage

screencast.show_overlays()

Returns


start

Added in: v1.59 screencast.start

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

Usage

Arguments

  • on_frame Callable[Dict]:Promise (optional)#

    • data bytes

      JPEG-encoded frame data.

    Callback that receives JPEG-encoded frame data.

  • path Union[str, pathlib.Path] (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.

Returns

  • [Disposable]#

stop

Added in: v1.59 screencast.stop

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

Usage

screencast.stop()

Returns