ov_video_player | R Documentation |
Video player tag element
ov_video_player(
id,
type,
controls = FALSE,
version = 1,
controller_var = paste0(id, "_controller"),
with_js = FALSE,
...
)
id |
string: the id of the tag |
type |
string: either "youtube", "twitch" (only with |
controls |
logical: if |
version |
numeric: code version. Default = 1, sort-of-experimental = 2. Version 2 supports multiple players on a single page, as well as |
controller_var |
string: (for version 2 only) the js variable name to use for the controller object that controls this video player |
with_js |
logical: if |
... |
: other attributes of the player element (passed to the player |
HTML tags. The outermost element is a div with id paste0(id, "_container")
, with the player and optionally buttons nested within it.
## Not run:
library(shiny)
## hand-crafted playlist for this example
playlist <- data.frame(video_src = "NisDpPFPQwU",
start_time = c(589, 1036, 1163, 2731, 4594),
duration = 8,
type = "youtube")
shinyApp(
ui = fluidPage(
ov_video_js(youtube = TRUE, version = 2),
ov_video_player(id = "yt_player", type = "youtube",
version = 2, controller_var = "my_dv",
style = "height: 480px; background-color: black;",
controls = tags$button("Go",
onclick = ov_playlist_as_onclick(playlist, "yt_player",
controller_var = "my_dv")))
),
server = function(input, output) {},
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.