Records the pointer, touches and scrolling the browser sends, when
:pointer is configured.
PhoenixReplay.Recorder tells the browser to record, and with which
:pointer settings, on the connected mount, with its
"phx_replay:record" event. The client module's
replayRecorder/1 then samples positions and scroll offsets and sends
them in batches as an "phx_replay:pointer" event, which the recorder
hands here and halts, so the view never sees it. A batch is:
"span"— milliseconds from the batch's first sample to sending it"m"— moves, flattened[dt, x, y, slot]tuples"p"— presses,[dt, kind, x, y, slot, type, target, fx, fy]:kindis0for down and1for up,type0for a mouse,1for touch and2for a pen, andtargetthe id of the pressed element, withfx,fythe point within it in thousandths"s"— scroll offsets, flattened[dt, x, y]tuples
dt counts milliseconds from the batch's first sample, x and y are
CSS pixels in the viewport, and slot tells concurrent touches apart.
Batches come from the browser, so anything malformed is dropped, numbers
are clamped and each batch holds at most :max_points entries. Each is
recorded as a :pointer event, outside :max_events, up to :limit per
session.
Summary
Functions
Records a batch sent by the browser for the session pid records.
The event name batches arrive as.
Validates a batch: returns its moves, presses and scrolls, each within
max_points, or :error when nothing usable is in it.
The settings the browser records with, for Phoenix.LiveView.push_event/3.
Functions
@spec capture(pid(), map(), PhoenixReplay.Config.pointer()) :: :ok | :dropped | :error
Records a batch sent by the browser for the session pid records.
@spec event() :: String.t()
The event name batches arrive as.
@spec parse(map(), pos_integer()) :: {:ok, map()} | :error
Validates a batch: returns its moves, presses and scrolls, each within
max_points, or :error when nothing usable is in it.
@spec settings(PhoenixReplay.Config.pointer()) :: map()
The settings the browser records with, for Phoenix.LiveView.push_event/3.