video {video} | R Documentation |
Video Player
Description
A video player that can be embedded in HTML pages.
Usage
video(
files,
format = NULL,
options = list(),
seek_ping_rate = 1000,
width = NULL,
height = NULL,
elementId = NULL
)
Arguments
files |
A vector of file paths or URLs pointing |
format |
An optional list of formats of |
options |
A named list of options to apply to the video. List of available options available in Details |
seek_ping_rate |
Number of milliseconds between each update of 'input${id}_seek' while playing. Default is set to 1000. If set to 0, then 'input${id}_seek' will not exist. |
width , height |
Must be a valid CSS unit (like |
elementId |
HTML id tag to be given to the video player element |
Details
Here are some more common options to implement:
- autoplay
-
Whether or not the video will autoplay on load. NOTE: There is not a guarantee autoplay will work in the browser.
FALSE
Default: Video won't autoplay
TRUE
Video will use browser's autoplay
"muted"
Will mute the video and then manually call
play()
onloadstart()
. Likely to work on browsers"play"
Will call
play()
onloadstart()
, similar to browser autoplay
- controls
-
Determines whether or not the player has controls that the user can interact with. By default
video
will include controls even if not specified in the options. - poster
-
A URL to an image that displays before the video begins playing. This is often a frame of the video or a custom title screen.
For a full list of available options check out https://videojs.com/guides/options/
Value
A shiny.tag containing all of the required options for a videojs
JS object to be initialised in a shiny application.
On the server side there will be up to four additional objects available as inputs:
{id}_playing
A logical value as to whether or not the
video
is playing audio{id}_seek
(If
seek_ping_rate > 0
) the current time of the track loaded{id}_duration
The duration of the track loaded
Examples
if (interactive()) {
library(shiny)
ui <- fluidPage(
title = "howler.js Player",
video("https://vjs.zencdn.net/v/oceans.mp4")
)
server <- function(input, output) {
}
runShiny(ui, server)
}