| video-server | R Documentation |
Change the state of the video player from the server.
playVideo, pauseVideo and stopVideo will all be applied to the current video.
changeVideo will update the track to the URL or file specified.
updatePlaybackRate will change how fast the video is playing.
playVideo(id, session = getDefaultReactiveDomain()) pauseVideo(id, session = getDefaultReactiveDomain()) stopVideo(id, session = getDefaultReactiveDomain()) seekVideo(id, seek, session = getDefaultReactiveDomain()) changeVideo(id, files, format = NULL, session = getDefaultReactiveDomain()) updatePlaybackRate(id, playrate = 1, session = getDefaultReactiveDomain())
id |
ID of the |
session |
Shiny session |
seek |
Time (in seconds) to set the position of the track |
files |
A vector of file paths or URLs pointing |
format |
An optional list of formats of |
playrate |
Speed of playback of the video. Default is set to 1 (normal speed) |
Updates the the state of the specified video in the shiny application.
if (interactive()) {
library(shiny)
ui <- fluidPage(
title = "howler.js Player",
video(
"https://vjs.zencdn.net/v/oceans.mp4",
elementId = "video"
),
actionButton("pause", "Pause Video")
)
server <- function(input, output) {
observeEvent(input$pause, pauseVideo("video"))
}
runShiny(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.