Video (YouTube/Vimeo/local) url to HTML iframe/video Tag

Usage

YT(path = "clipboard", width = 640, height = 360, copy2clip = interactive(), print = FALSE)

VM(path = "clipboard", width = 640, height = 360, copy2clip = interactive(), print = FALSE)

VD(path = "clipboard", video.js.path = "assets/js/vidscript.js", width = "100%", 
  height = 520, indent.controls = 4, copy2clip = interactive(), print = FALSE)

Arguments

path
A url/tag/path. Default is to read from the clipboard. Note that VD requires a .mp4 file.
width
The width of the player.
height
The height of the player.
copy2clip
logical. If TRUE attempts to copy the output to the clipboard.
print
logical. If TRUE cat prints the output to the console. If FALSE returns to the console.
video.js.path
The path to the vidscript.js. If the file is not found in the dirname of video.js.path then js_copy will be utilized to place the appropriate video file in the correct location.
indent.controls
An integer value for number of indents to push the control panel.

Value

Returns a character vector of an HTML iframe tag that embeds a YouTube or Vimeo video.

Description

YT - Wrap a YouTube tag or url to generate an HTML iframe tag.

VM - Wrap a Vimeo tag or url OR to generate an HTML iframe tag.

VD - Wrap a local path to generate an HTML video tag.

Details

Use YT for YouTube videos and VM for Vimeo videos.

Note

For YouTube videos it may be better to utilize a slide layout class as a slide with a link followed by a slide with a youtube video may cause the link to become in active. To create a youtube slide use the form: --- .YT yt:ArHQjQyIS70 &youtube where the portion after yt: is the youtube tag.

Examples

YT("ArHQjQyIS70", print = TRUE)
YT("http://www.youtube.com/watch?v=ArHQjQyIS70", print = TRUE)
VM("http://vimeo.com/54007714", print = TRUE)

See also

slidify_layouts, js_copy