Replay: lastTick property
Available since
@irtio/client 5.0BrowsersNodeThe lastTick read-only property of the Replay interface is the last room tick the replay can show, where playback ends.
Value
A number, at least firstTick.
Description
seek() clamps a tick after lastTick to it, step() returns false there, and reaching it while playing fires the ended event.
Examples
Showing playback progress
A progress bar shows how much of the replay has been played.
// progress.ts
import type { Replay } from "@irtio/client/replay";
export function bindProgress(replay: Replay, bar: HTMLProgressElement): void {
bar.max = replay.lastTick - replay.firstTick;
replay.addEventListener("tick", () => (bar.value = replay.tick - replay.firstTick));
}
See also
Runtime availability
| Browsers | Node | |
|---|---|---|
lastTick | 5.0 | 5.0 |