1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 09:53:17 +00:00
musix-oss/node_modules/video-thumbnail-url
2020-03-03 22:30:50 +02:00
..
dist Modules 2020-03-03 22:30:50 +02:00
src Modules 2020-03-03 22:30:50 +02:00
tests Modules 2020-03-03 22:30:50 +02:00
.babelrc Modules 2020-03-03 22:30:50 +02:00
.npmignore Modules 2020-03-03 22:30:50 +02:00
.travis.yml Modules 2020-03-03 22:30:50 +02:00
index.js Modules 2020-03-03 22:30:50 +02:00
package.json Modules 2020-03-03 22:30:50 +02:00
README.md Modules 2020-03-03 22:30:50 +02:00

Build Status

video-thumbnail-url

Get thumbnail URL for a given video URL. Supports youtube, vimeo and facebook.

Install

npm install video-thumbnail-url

Usage

import getThumb from 'video-thumbnail-url';

getThumb('https://www.youtube.com/watch?v=dQw4w9WgXcQ').then(thumb_url => { // thumb_url is  url or null
    console.log(thumb_url); // http://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg
});

Recognized video urls

Youtube:

https://www.youtube.com/embed/[video-id]'
https://youtu.be/[video-id]'
https://www.youtube.com/watch?v=[video-id]'

Vimeo:

http://vimeo.com/[video-id]
http://player.vimeo.com/video/[video-id]
https://vimeo.com/channels/[channel]/[video-id]
https://vimeo.com/groups/[group]/videos/[video-id]

Facebook:

https://www.facebook.com/[user]/videos/[video-id]/

Test

npm test