PhxDemo.Timeline (phx_demo v0.1.1)

Copy Markdown View Source

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.

Summary

Functions

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

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

Title of the most recent scene, or nil.

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

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

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

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

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

Functions

current()

last_event(type)

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(pid)

Title of the most recent scene, or nil.

put_current(pid)

record(type, data \\ %{})

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

record(pid, type, data)

settings()

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

start(info)

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

stop(pid)

to_map(pid)

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!(pid, path)