YouTube-utilities
A module for ease access of YouTube unique identifier, video thumbnail and embedded markup.
installation
npm install youtube-utilities
usage
var utility = ; // To get unique identifier from youtube url var url = "https://www.youtube.com/watch?v=XL9Ri8pO68w";var id = utility;console;// output -> XL9Ri8pO68w // To get embedded markup from youtube urlvar url = "https://www.youtube.com/watch?v=XL9Ri8pO68w";var markup = utility; console;// output -> <iframe src="https://youtube.com/embed/XL9Ri8pO68w?rel=0&controls=2&enablejsapi=1&yt:stretch=16:9&version=3&autoplay=0&autohide=1&playerapiid=ytplayer&theme=dark" frameborder="0" width="100%" height="300px" style="" frameborder="0" allowfullscreen></iframe> // To get thumbnail image from youtube urlvar url = "https://www.youtube.com/watch?v=XL9Ri8pO68w";var images = utility;// output -> {"default":{"url":"http://img.youtube.com/vi/XL9Ri8pO68w/default.jpg","width":120,"height":90},"medium":{"url":"http://img.youtube.com/vi/XL9Ri8pO68w/mqdefault.jpg","width":320,"height":180},"high":{"url":"http://img.youtube.com/vi/XL9Ri8pO68w/hqdefault.jpg","width":480,"height":360}}
API
; ; ;