video-server {video} | R Documentation |
Update video.js Server-Side
Description
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.
Usage
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())
Arguments
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) |
Value
Updates the the state of the specified video
in the shiny application.
Examples
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)
}
[Package video version 0.1.1 Index]