# `PhxDemo.Timeline`
[🔗](https://github.com/thenatespack/phoenix_demo/blob/main/lib/phx_demo/timeline.ex#L1)

Records what happened during a demo, and when, relative to the start of the
demo setup. That is a few milliseconds after the video starts, because the
browser context (and so the recording) is created first.

Post-processing (captions, zoom, narration sync) reads the result from
`timeline.json`.

# `current`

# `last_event`

The most recent event of `type` on the current timeline, or nil.

# `last_scene`

Title of the current timeline's most recent scene, or nil.

# `last_scene`

Title of the most recent scene, or nil.

# `put_current`

# `record`

Records an event on the current timeline. Does nothing outside a demo, so
steps also work in a plain `test`.

# `record`

# `settings`

The current demo's settings (see `PhxDemo.settings/1`), or defaults outside a demo.

# `start`

Starts an unlinked timeline so it can be read from `on_exit`.

# `stop`

# `to_map`

The timeline as a JSON-friendly map, with events in order.

# `viewport`

The current demo's viewport, or the configured default outside a demo.

# `write!`

---

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