# `Playwright.Video`
[🔗](https://github.com/ftes/playwright_ex/blob/v1.65.0-rc.3/lib/playwright/api/video.ex#L7)

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

```elixir
IO.puts(Page.video(page) |> Video.path!())
```

*Since Playwright 1.8.*

The examples alias the modules they use (`alias Playwright.{Locator, Page}`).

# `t`

```elixir
@type t() :: %Playwright.Video{_artifact: term(), _isRemote: term()}
```

A `Video` handle. Compare handles with `==`, their fields are internal.

# `delete`

```elixir
@spec delete(t()) :: :ok | {:error, Playwright.error()}
```

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

*Since Playwright 1.11.*

# `delete!`

```elixir
@spec delete!(t()) :: :ok
```

Like `delete/1`, but returns the value and raises on error.

# `path`

```elixir
@spec path(t()) :: {:ok, String.t()} | {:error, Playwright.error()}
```

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 fails when connected remotely.

*Since Playwright 1.8.*

# `path!`

```elixir
@spec path!(t()) :: String.t()
```

Like `path/1`, but returns the value and raises on error.

# `save_as`

```elixir
@spec save_as(t(), String.t()) :: :ok | {:error, Playwright.error()}
```

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.

*Since Playwright 1.11.*

## Arguments

* `path` - Path where the video should be saved.

# `save_as!`

```elixir
@spec save_as!(t(), String.t()) :: :ok
```

Like `save_as/2`, but returns the value and raises on error.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
