embed: Embed video from service

Description Usage Arguments Details Value See Also Examples

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
embed_user2016(
  id,
  width = NULL,
  height = 300,
  ratio = c("16by9", "4by3"),
  frameborder = 0,
  allowfullscreen = TRUE
)

embed_user2017(
  id,
  width = NULL,
  height = 300,
  ratio = c("16by9", "4by3"),
  frameborder = 0,
  allowfullscreen = TRUE
)

embed_box(
  id,
  custom_domain = getOption("vembedr.box_custom_domain"),
  width = NULL,
  height = 300,
  ratio = c("16by9", "4by3"),
  frameborder = 0,
  allowfullscreen = TRUE
)

embed_channel9(
  id,
  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
)

Arguments

id

character, identifier provided by the service

width

numeric, width of iframe (px)

height

numeric, height of iframe (px)

ratio

character, indicates aspect ratio for the <iframe/>

frameborder

numeric, size of frame border (px)

allowfullscreen

logical, indicates if to allow fullscreen

custom_domain

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.

query

list, items to include in url-query string

fragment

character, string to include as url-fragment

Details

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

Microsoft Channel 9

https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Forty-years-of-S (click the Embed tab)

Box

https://developer.box.com/docs/box-embed#section-build-box-embed-programatically

Microsoft Stream

https://docs.microsoft.com/en-us/stream/portal-embed-video

Value

Object with S3 class vembedr_embed

See Also

use_start_time()

Examples

1
2
3
4
5
6
embed_youtube("dQw4w9WgXcQ")
embed_vimeo("45196609")
embed_user2016("Literate-Programming")
embed_user2017("Room-202-Lightning-Talks") %>% use_start_time("26m35s")
embed_box("m5do45hvzw32iv2aors3urf5pgkxxazx")
embed_msstream("ae21b0ac-4a2b-41f4-b3fc-f1720dd20f48")

vembedr documentation built on Oct. 23, 2020, 8:26 p.m.