ov_playlist_to_html | R Documentation |
Converts a playlist object to an HTML file that can be opened in any browser. Note that if the playlist uses local video files, the HTML file will only work on a device that has access to those files. If the playlist uses YouTube (or other external) video URLs, the HTML file will be usable on any network-connected device.
ov_playlist_to_html(
playlist,
playlist_name = "Playlist",
outfile,
no_paths = FALSE,
table_cols = c(),
loop = FALSE,
...
)
playlist |
data.frame: as returned by |
playlist_name |
string: the name to use for the playlist |
outfile |
string: the file name to write to. If not supplied, a file will be created in the temporary directory. Note that the directory of |
no_paths |
logical: if |
table_cols |
character: the names of columns in |
loop |
logical: should we loop endlessly over the playlist? |
... |
: additional arguments passed to the Rmd file used to generate the HTML. Currently these are:
|
The path to the HTML file
ov_video_playlist()
ov_playlist_to_vlc()
## Not run:
## use data from the ovdata package
library(ovdata) ## install via remotes::install_github("openvolley/ovdata") if needed
x <- ovdata_example("190301_kats_beds-clip", as = "parsed")
## make sure its video element points to our local copy of the corresponding video clip
dv_meta_video(x) <- ovdata_example_video("190301_kats_beds")
## extract the plays
px <- datavolley::plays(x)
## it's a single rally, so we'll use all rows (just exclude NA skill rows)
px <- px[!is.na(px$skill), ]
## define columns to show in the table
extra_cols <- c("home_team", "visiting_team", "video_time", "code", "set_number",
"home_team_score", "visiting_team_score")
## make the playlist with extra columns included
ply <- ov_video_playlist(px, x$meta, extra_cols = c(extra_cols, "player_name"))
## use player name as the subtitle
ply$subtitle <- ply$player_name
## convert to HTML
f <- ov_playlist_to_html(ply, table_cols = extra_cols)
## and finally open it!
browseFile(f)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.