#' @export
video_status <- function(video) {
# focus_last_window()
p <- get_browser()
# cost about 0.05s
info <- p$executeScript("
var video = arguments[0];
return {
currentTime: video.currentTime,
duration: video.duration
}
", list(video))
info$perc <- info %$% currentTime / duration * 100
as.data.table(info)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.