Learn R Programming

dqshiny (version 0.0.4)

video_box: Adds a video box to the app

Description

video_box adds a box holding the given video file, which will be hidden initially. Supports multiple sources.

video_tag adds a small button to show the corresponding video box and jump directly to the given position in the video.

Usage

video_box(id, src, title = NULL, type = "video/mp4")

video_tag(id, time = NULL, title = NULL)

Arguments

id

id of the video element

src

source(s) for the video,

title

title to be shown above the video

type

character specifying the video type(s)

time

optional integer specifying the time to jump to (in seconds)

Examples

Run this code
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {

library(shiny)
base_url <- "http://download.blender.org/peach/bigbuckbunny_movies/"
shinyApp(
  ui = fluidPage(
    video_box("lowRes",
      paste0(base_url, "BigBuckBunny_320x180.mp4"),
      "Low Resolution"
    ),
    video_box("highRes", type = "audio/ogg",
      paste0(base_url, "big_buck_bunny_720p_stereo.ogg")
    ),
    fluidRow(column(12,
      "Low resolution: ", video_tag("lowRes"), br(),
      "Higher resolution: ", video_tag("highRes", 300, "Bookmark at 5min")
    ))
  ),
  server = function(input, output) {}
)

}
# }

Run the code above in your browser using DataLab