Skip to content

Latest commit

 

History

History
214 lines (160 loc) · 9.46 KB

File metadata and controls

214 lines (160 loc) · 9.46 KB
id class-video
title Video

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard';

When browser context is created with the recordVideo option, each page has a video object associated with it.

System.out.println(page.video().path());

Alternatively, you can use Video.start() and Video.stop() to record video manually. This approach is mutually exclusive with the recordVideo option.

page.video().start();
// ... perform actions ...
page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm")));

Methods

delete {#video-delete}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11video.delete

Deletes the video file. Will wait for the video to finish if necessary.

Usage

Video.delete();

Returns


path {#video-path}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9video.path

Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem upon closing the browser context. This method throws when connected remotely.

Usage

Video.path();

Returns


saveAs {#video-save-as}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11video.saveAs

Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or after the page has closed. This method waits until the page is closed and the video is fully saved.

Usage

Video.saveAs(path);

Arguments

  • path Path#

    Path where the video should be saved.

Returns


start {#video-start}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59video.start

Starts video recording. This method is mutually exclusive with the recordVideo context option.

Usage

page.video().start();
// ... perform actions ...
page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm")));

Arguments

  • options Video.StartOptions (optional)
    • setSize Size (optional)#

      • setWidth int

        Video frame width.

      • setHeight int

        Video frame height.

      Optional dimensions of the recorded video. If not specified the size will be equal to page viewport scaled down to fit into 800x800. Actual picture of the page will be scaled down if necessary to fit the specified size.

Returns


stop {#video-stop}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59video.stop

Stops video recording started with Video.start().

Usage

Video.stop();
Video.stop(options);

Arguments

  • options Video.StopOptions (optional)
    • setPath Path (optional)#

      Path where the video should be saved.

Returns