Which moments of a recording a video shows, and for how long.
The video runs at a constant frame rate from the first render to the
end of the recording or its pointer track, and holds the last moment
for :hold milliseconds so it is seen. Each frame shows the moment
of the recording it falls on, except that a stretch without activity
longer than :idle is shortened to :idle, half of it after the
activity before and half before the activity after.
Consecutive frames that would look the same share one shot/0: the
same event, the same scroll position, the same pointer presses and
moves, and no pointer animation running. While the pointer moves, and
for as long as its trail and press ripples take to fade, every frame is
a shot of its own. So capturing takes a screenshot per shot, not per
frame.
Summary
Types
One screenshot: the event index and the moment at of the recording
to show, the viewport the page had, with its media features when they
were recorded (see PhoenixReplay.Recording.Client.media/1), and how
many frames it lasts.
The shots in order, the canvas every viewport fits in, in CSS pixels,
the device pixel ratio to render at, and the frame rate.
Functions
The video's length in milliseconds.
The number of frames in the video.
Plans the video of a recording laid out by PhoenixReplay.Recording.Timeline.for_playback/1
and its pointer track.
Types
@type shot() :: %{ index: non_neg_integer(), at: non_neg_integer(), viewport: %{ :width => pos_integer(), :height => pos_integer(), optional(:media) => %{required(String.t()) => String.t()} }, frames: pos_integer() }
One screenshot: the event index and the moment at of the recording
to show, the viewport the page had, with its media features when they
were recorded (see PhoenixReplay.Recording.Client.media/1), and how
many frames it lasts.
@type t() :: %PhoenixReplay.Export.Schedule{ canvas: %{width: pos_integer(), height: pos_integer()}, dpr: number(), fps: pos_integer(), shots: [shot()] }
The shots in order, the canvas every viewport fits in, in CSS pixels,
the device pixel ratio to render at, and the frame rate.
Functions
@spec duration_ms(t()) :: non_neg_integer()
The video's length in milliseconds.
@spec frames(t()) :: non_neg_integer()
The number of frames in the video.
@spec new( PhoenixReplay.Recording.t(), PhoenixReplay.Recording.PointerTrack.t(), keyword() ) :: t()
Plans the video of a recording laid out by PhoenixReplay.Recording.Timeline.for_playback/1
and its pointer track.
Options
:fps— frames per second (required):idle— milliseconds a stretch without activity is shortened to, ornilto keep it whole (required):max_dpr— the highest device pixel ratio to render at (required):hold— milliseconds the last moment is held (required):fromand:to— the range of the recording to show, in milliseconds;nilfor its first render and its end