vembedr (version 0.1.4)

suggest_embed: Suggest embed-code based on URL

Description

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

Usage

suggest_embed(url)

suggest_embed_pure(url)

Arguments

url

character, URL of web-page for video

Value

character, returns the suggested code (suggest_embed returns invisibly)

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

Examples

Run this code
# 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")
# }
# NOT RUN {
  cat(suggest_embed_pure("https://youtu.be/1-vcErOPofQ?t=28"))
# }

Run the code above in your browser using DataLab