@shelf/get-video-id
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @shelf/get-video-id

Weekly Downloads

613

Version

1.0.1

License

MIT

Unpacked Size

5.35 kB

Total Files

10

Last publish

Collaborators

  • ksenia_holovko
  • petro.bodnarchuk
  • kateryna-kochina
  • maksym.tarnavskyi
  • andrii-nastenko
  • mykhailo.yatsko
  • ahavrysh
  • nikita_shelf
  • maciej.orlowski
  • monopotan
  • andrew214
  • bogdan.kolesnyk
  • andrii.batutin
  • kristina.zhak
  • anton-russo
  • mmazurowski
  • toms-shelf
  • mateuszgajdashelf
  • kchlon
  • dmytro.harazdovskiy
  • duch0416
  • i5adovyi
  • olesiamuller
  • mykola.khytra
  • yuliiakovalchuk
  • el_scrambone
  • bodyaflesh
  • slavammellnikov
  • andriisermiahin
  • mpushkin
  • batovpavlo
  • domovoj
  • vozemer
  • oleksii.dymnich
  • dima-bond
  • maksym.hayovets
  • oles.zadorozhnyy
  • ss1l
  • gemshelf
  • hartzler
  • vladgolubev
  • hmelenok
  • knupman
  • maaraanas
  • terret
  • chapelskyi.slavik
  • pihorb
  • irynah
  • diana.kryskuv
  • andy.raven
  • rafler
  • sskalp88
  • demiansua
  • yuriil
  • ktv18
  • drews_abuse
  • rostyslav-horytskyi
  • whodeen