Learn R Programming

vembedr (version 0.1.0)

embed: Creates an iframe for video-embedding

Description

These functions are used to embed video into your RMarkdown html documents, or into your Shiny apps. There are currently functions for you to embed from either YouTube or Vimeo.

Usage

embed_vimeo(id, width = 500, height = 281, frameborder = 0, allow_full_screen = TRUE, query = NULL)
embed_youtube(id, width = 420, height = 315, frameborder = 0, allow_full_screen = TRUE, query = NULL)

Arguments

id
character, identifier provided by the service
width
numeric, width of iframe (px)
height
numeric, height of iframe (px)
frameborder
numeric, size of frame border (px)
allow_full_screen
logical, indicates if to allow fullscreen
query
list of items to include in query string

Value

html element

Details

Both of these services allow you to customize a lot of things by specifying an optional query string. The specification for the query string will differ according to the service being used:

YouTube
https://developers.google.com/youtube/player_parameters

Vimeo
https://developer.vimeo.com/player/embedding

Examples

Run this code
embed_vimeo("45196609")
embed_youtube("dQw4w9WgXcQ")
embed_youtube("8SGif63VW6E", query = list(start = secs("4m12s")))

Run the code above in your browser using DataLab