1.0.2 • Published 1 year ago

@cuisine/video-helper v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

video-helper

Embed url generator for video streaming platforms.

Currently supported platforms:

  • youtube
  • vimeo

How to install

npm install @cuisine/video-helper

generateEmbedUrl(url: string)

Receives an url from a video provider and returns the provider specific embed url

Supported url formats

Example

generateEmbedUrl("https://www.youtube.com/watch?v=123456") will output https://www.youtube.com/embed/123456

generateEmbedUrlFromProvider(id: string, provider: VideoProvider)

Receives a video id and a specific provider (from the list of supported providers) and returns the provider specific embed url

Supported providers

  • youtube
  • vimeo

Example

generateEmbedUrlFromProvider("123456", "youtube") will output https://www.youtube.com/embed/123456

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago