# `PhoenixReplay.Export.Screenshots`
[🔗](https://github.com/elixir-vibe/phoenix_replay/blob/v0.6.2/lib/phoenix_replay/export/screenshots.ex#L2)

Screenshots each shot of a `PhoenixReplay.Export.Schedule` in Chromium.

It opens `PhoenixReplay.Web.Export.Stage` in a browser context the size
of the schedule's canvas, at its device pixel ratio, waits until the
stage's frame is ready, then has the stage show each shot's moment and
saves a PNG of it. The stage seeks its frame itself. The browser is
closed whatever happens, and a `{PhoenixReplay.Export, :cancel}` message
stops it between screenshots.

# `run`

```elixir
@spec run(
  PhoenixReplay.Export.Runtime.t(),
  PhoenixReplay.Recording.id(),
  PhoenixReplay.Export.Schedule.t(),
  Path.t(),
  map(),
  PhoenixReplay.Export.Options.t(),
  (float() -&gt; any())
) :: {:ok, PhoenixReplay.Export.Encoder.shots()} | {:error, term()}
```

Captures the shots of a recording's schedule into `dir`, reporting
progress from 0 to 1.

---

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