Socket
Book a DemoInstallSign in
Socket

@shelf/get-video-id

Package Overview
Dependencies
Maintainers
59
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shelf/get-video-id

Wrapper around https://github.com/radiovisual/get-video-id to return youtube start from query params

latest
npmnpm
Version
1.0.1
Version published
Maintainers
59
Created
Source

@shelf/get-video-id CircleCI

Wrapper around https://github.com/radiovisual/get-video-id to return video service query params (youtube starts from as an example )

Install

yarn add @shelf/get-video-id

Usage

import getVideoId from '@shelf/get-video-id';

getVideoId('https://youtu.be/LqTuxFElqag');
/** => {
  id: 'LqTuxFElqag',
  service: 'youtube',
  embedURL: 'https://www.youtube.com/embed/LqTuxFElqag'
} **/

getVideoId('https://youtu.be/LqTuxFElqag?t=7939'); // With time param
/** => {
  id: 'LqTuxFElqag',
  service: 'youtube',
  embedURL: 'https://www.youtube.com/embed/LqTuxFElqag?start=7939'
} **/

getVideoId('https://vimeo.com/259411563#t=50s');
/** => {
  id: '259411563',
  service: 'vimeo',
  embedURL: 'https://player.vimeo.com/video/259411563'
} **/

API

Documentation is available here

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT © Shelf

FAQs

Package last updated on 01 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts