1.1.4 • Published 9 months ago

@cuisine/video-helper v1.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months 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

isSupported(url: string)

Receives an url and returns if it is supported by the library

isYoutubeShortsUrl(url: string)

Receives an url and returns true if it belongs to a Youtube short

Supported providers

  • youtube
  • vimeo

Example

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

1.1.1

9 months ago

1.1.0

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago