Description Usage Arguments Value Examples
Convert playlist to 'onclick' string
1 2 3 4 5 6 | dv_playlist_as_onclick(
playlist,
video_id,
normalize_paths = TRUE,
dvjs_fun = "dvjs_set_playlist_and_play"
)
|
playlist |
data.frame: a playlist as returned by |
video_id |
string: the id of the HTML video element to attach the playlist to |
normalize_paths |
logical: if |
dvjs_fun |
string: the javascript function to use |
A string suitable for inclusion as an 'onclick' tag attribute
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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", style = "height: 480px; background-color: black;"),
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.