ov_video_playlist | R Documentation |
Create video playlist
ov_video_playlist(
x,
meta,
type = NULL,
timing = ov_video_timing(),
extra_cols = NULL,
normalize_paths = TRUE
)
x |
data.frame: a datavolleyplays object. Normally this will be a selected subset of the |
meta |
list: either the |
type |
string: currently "youtube", "twitch", or "local". If |
timing |
list: the relative timing for each skill type, either a named list as returned by |
extra_cols |
character: names of additional columns from |
normalize_paths |
logical: if |
A data.frame with columns src
, start_time
, duration
, plus any extras specified in extra_cols
## read data file
x <- datavolley::dv_read(datavolley::dv_example_file())
## note that this data file has no video specified, so put a dummy value in
dv_meta_video(x) <- "c:\\my_video.mp4"
## extract play-by-play data
px <- datavolley::plays(x)
## and put dummy video_time values in, because those are missing too
px$video_time <- sample.int(2e3, size = nrow(px))
## find pipe (XP) attacks in transition
px <- px[which(px$attack_code == "XP" & px$phase == "Transition"), ]
## create playlist
ply <- ov_video_playlist(px, x$meta, timing = ov_video_timing())
## with custom timing
ply <- ov_video_playlist(px, x$meta,
timing = ov_video_timing_df(data.frame(skill = "Attack", phase = "Transition",
start_offset = -5, duration = 10, stringsAsFactors = FALSE)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.