R/embed.R
, R/service-box.R
, R/service-msstream.R
, and 2 more
embed.Rd
These functions are used to embed video into your rmarkdown html-documents, or into your shiny apps. There are functions to embed from YouTube, Vimeo, Microsoft Channel 9 (who host the UseR! 2016 videos), and Box.
embed_box(
id,
custom_domain = getOption("vembedr.box_custom_domain"),
width = NULL,
height = 300,
ratio = c("16by9", "4by3"),
frameborder = 0,
allowfullscreen = TRUE
)
embed_msstream(
id,
width = NULL,
height = 300,
ratio = c("16by9", "4by3"),
query = NULL
)
embed_vimeo(
id,
width = NULL,
height = 300,
ratio = c("16by9", "4by3"),
frameborder = 0,
allowfullscreen = TRUE,
query = NULL,
fragment = NULL
)
embed_youtube(
id,
width = NULL,
height = 300,
ratio = c("16by9", "4by3"),
frameborder = 0,
allowfullscreen = TRUE,
query = NULL
)
character
, identifier provided by the service
character
, (used by Box) name of Box-instance
to use. It can be useful to use getOption("vembedr.box_custom_domain")
if you are using a corporate instance of Box. If NULL
, it will use
the standard Box instance.
numeric
, width of iframe (px)
numeric
, height of iframe (px)
character
, indicates aspect ratio for the <iframe/>
numeric
, size of frame border (px)
logical
, indicates if to allow fullscreen
list
, items to include in url-query string
character
, string to include as url-fragment
Object with S3 class vembedr_embed
.
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:
embed_youtube("dQw4w9WgXcQ")
#> <div class="vembedr">
#> <div>
#> <iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" width="533" height="300" frameborder="0" allowfullscreen="" data-external="1"></iframe>
#> </div>
#> </div>
embed_vimeo("45196609")
#> <div class="vembedr">
#> <div>
#> <iframe class="vimeo-embed" src="https://player.vimeo.com/video/45196609" width="533" height="300" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" data-external="1"></iframe>
#> </div>
#> </div>
embed_box("m5do45hvzw32iv2aors3urf5pgkxxazx")
#> <div class="vembedr">
#> <div>
#> <iframe src="https://app.box.com/embed/s/m5do45hvzw32iv2aors3urf5pgkxxazx" width="533" height="360" frameborder="0" allowfullscreen="" webkitallowfullscreen="" msallowfullscreen="" data-external="1"></iframe>
#> </div>
#> </div>
embed_msstream("ae21b0ac-4a2b-41f4-b3fc-f1720dd20f48")
#> <div class="vembedr">
#> <div>
#> <iframe src="https://web.microsoftstream.com/embed/video/ae21b0ac-4a2b-41f4-b3fc-f1720dd20f48?autoplay=false&showinfo=true" width="533" height="300" style="border:none;" data-external="1"></iframe>
#> </div>
#> </div>