FreezeFrame starts any gifs on a slide when you turn to that slide. This helps This helps alleviate the awkward pause that can happen when you turn to a slide with a gif that has already started and you have to wait until it loops back around. You can also directly click on the gif to stop or start it.
use_freezeframe(
selector = "img[src$=\"gif\"]",
trigger = c("click", "hover", "none"),
overlay = FALSE,
responsive = TRUE,
warnings = TRUE
)html_dependency_freezeframe()
An htmltools::tagList() with the FreezeFrame dependencies, or an
htmltools::htmlDependency().
The selector used to search for .gifs to freeze.
The trigger event to start animation for non-touch devices.
One of "click" (default), "hover" or "none".
Whether or not to display a play icon on top of the paused
image, default: FALSE.
Whether or not to make the image responsive (100% width),
default: TRUE.
Whether or not to issue warnings in the browser console if an image doesn't appear to be a gif.
use_freezeframe(): Adds FreezeFrame to your xaringan slides.
html_dependency_freezeframe(): Returns an htmltools::htmlDependency() with the
FreezeFrame dependencies for use in xaringan and R Markdown documents.
Most users will want to use use_freezeframe() instead.
To add FreezeFrame to your xaringan presentation,
add the following code chunk to your slides' R Markdown file.
```{r xaringanExtra-freezeframe, echo=FALSE}
xaringanExtra::use_freezeframe()
```
http://ctrl-freaks.github.io/freezeframe.js/, https://github.com/ctrl-freaks/freezeframe.js/