Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
713
increased by3.18%
Maintainers
59
Weekly downloads
 
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc