unvlogable

A simple interface that provides a standardized oembed output for video services.


Keywords
video, wrapper
License
MIT
Install
npm install unvlogable@0.1.0

Documentation

Unvlogable Build Status

A simple interface that provides a standardized oembed output for video services.

The inspiration comes from an old idea that served as the foundation of unvlog. Back then we had it implemented in this old and rusty ruby gem.

Usage

Calling unvlogable with a video url from the supported services will return an oembed object with type, version, provider_name, title, thumbnail_url, html, width and height.

const unvlogable = require('unvlogable');

await unvlogable('https://www.youtube.com/watch?v=_Nwn9ybsCRk');
/*=> { type: 'video',
  version: '1.0',
  provider_name: 'youtube',
  title: 'Can\'t Stop by Red Hot Chili Peppers but I can\'t start...',
  thumbnail_url: 'https://i.ytimg.com/vi/_Nwn9ybsCRk/maxresdefault.jpg',
  html: '<iframe width="480" height="270" src="https://www.youtube.com/embed/_Nwn9ybsCRk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
  width: 480,
  height: 270 }
*/

Configure the width and height of the embed code passing the desired values.

const unvlogable = require('unvlogable');

await unvlogable('https://www.youtube.com/watch?v=_Nwn9ybsCRk', {
  embed: { width: 800, height: 600 }
});
/*=> { type: 'video',
  version: '1.0',
  provider_name: 'youtube',
  title: 'Can\'t Stop by Red Hot Chili Peppers but I can\'t start...',
  thumbnail_url: 'https://i.ytimg.com/vi/_Nwn9ybsCRk/maxresdefault.jpg',
  html: '<iframe width="800" height="600" src="https://www.youtube.com/embed/_Nwn9ybsCRk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
  width: 800,
  height: 600 }
*/

Supported Services

Running tests

$ npm i -d && npm test

Contributing

For bugs and feature requests, please create an issue. Pull requests are always welcome.