suggest_embed: Suggest embed-code based on URL

Description Usage Arguments Details Value Examples

View source: R/parse.R

Description

This function is meant to work with URLs from any of the supported services.

Usage

1
2
3

Arguments

url

character, URL of web-page for video

Details

suggest_embed

called for the side-effect of printing suggested code the screen. If you have a recent version of usethis, the code will be copied to your clipboard

suggest_embed_pure

returns character string that represents the suggested code

Value

character, returns the suggested code (suggest_embed returns invisibly)

Examples

1
2
3
4
5
6
7
## Not run: 
  # not run because it may copy to your clipboard
  suggest_embed("https://youtu.be/1-vcErOPofQ?t=28s")
  suggest_embed("https://www.youtube.com/watch?v=1-vcErOPofQ")

## End(Not run)
  cat(suggest_embed_pure("https://youtu.be/1-vcErOPofQ?t=28"))

Example output

  embed_youtube("1-vcErOPofQ") %>%
  use_start_time("28s")
  embed_youtube("1-vcErOPofQ")
embed_youtube("1-vcErOPofQ") %>%
  use_start_time("28")

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