
Embed a vhsR recording as an HTML widget
vhsr_widget.RdReturns an htmltools::tagList() containing the recorded GIF /
video, suitable for embedding in an Rmarkdown chunk
(results = "asis") or a Shiny UI. Auto-detects the format from
file's extension: .gif becomes a styled <img>,
.mp4 / .webm become a <video controls loop muted playsinline>.
Arguments
- file
Path to a
.gif,.mp4, or.webmfile produced byrecord_demo()/vhsr_run_tape().- width, height
Optional CSS dimensions. Numeric values are treated as pixels (e.g.
800→"800px"); strings pass through verbatim (e.g."100%").
Examples
if (FALSE) { # \dontrun{
record_demo({ x <- 1:5; mean(x) }, output = "demo.gif")
vhsr_widget("demo.gif")
} # }