if (FALSE) { # interactive()
library(shiny)
library(shinyLottie)
ui <- fluidPage(
include_lottie(),
lottie_animation(
path = "shinyLottie/example.json",
name = "my_animation"
),
actionButton("callMethod", "Call Method (Reverse Direction)")
)
server <- function(input, output, session) {
observeEvent(input$callMethod, {
lottie_callMethod(name = "my_animation", method = "setDirection", argument = "-1")
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab