anime_playback: Configure animation playback

View source: R/playback.R

anime_playbackR Documentation

Configure animation playback

Description

Sets autoplay, looping, direction, speed, and optional controls UI on an anime_timeline or anime_animation. Arguments left as NULL keep the settings already stored on the object.

Usage

anime_playback(
  x,
  autoplay = NULL,
  loop = NULL,
  loop_delay = NULL,
  playback_rate = NULL,
  reversed = NULL,
  alternate = NULL,
  controls = NULL
)

Arguments

x

An anime_timeline or anime_animation object.

autoplay

Logical. Start playing immediately on load.

loop

Logical or positive integer. FALSE for no looping, TRUE for infinite looping, or a fixed number of iterations.

loop_delay

Numeric. Delay in milliseconds between iterations.

playback_rate

Numeric. Playback speed multiplier (1 is normal speed).

reversed

Logical. Play in reverse from the end.

alternate

Logical. Alternate direction on each iteration (requires loop to be TRUE or a positive integer to have any visible effect).

controls

Logical. Inject a play/pause/seek control bar into the widget container.

Value

The modified anime_timeline or anime_animation object.

Examples

anime_timeline() |>
  anime_playback(loop = TRUE, alternate = TRUE, controls = TRUE)


animejs documentation built on Aug. 21, 2026, 5:17 p.m.