Description Usage Arguments Value Examples
Video player tag element
1 | dv_video_player(id, type, controls = FALSE, ...)
|
id |
string: the id of the tag |
type |
string: either "youtube" or "local" |
controls |
logical: add "previous", "next", "pause", and "stop" buttons. 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
library(shiny)
## hand-crafted playlist for this example
playlist <- data.frame(video_src = "xL7qEpOdtio",
start_time = c(5417, 7252, 6222, 7656, 7369),
duration = 8,
type = "youtube")
shinyApp(
ui = fluidPage(
dv_video_js(youtube = TRUE),
dv_video_player(id = "yt_player", type = "youtube", controls = TRUE,
style = "height: 480px; background-color: black;"),
tags$button("Go", onclick = dv_playlist_as_onclick(playlist, "yt_player"))
),
server = function(input, output) {},
)
shinyApp(
ui = fluidPage(
dv_video_js(youtube = TRUE),
dv_video_player(id = "yt_player", type = "youtube",
style = "height: 480px; background-color: black;",
controls = tags$button("Go",
onclick = dv_playlist_as_onclick(playlist, "yt_player")))
)),
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.