Allows you to use a YouTube video within Video.js and control it the same way as a regular video (the same methods and events are availables within the tech). It also add the video quality and let you change it as if you were on YouTube.
All you need is vjs.youtube.js. You can install it through bower: bower install videojs-youtube
or by simply downloading the last version on GitHub.
Including the script vjs.youtube.js will add the YouTube as a tech. You just have to add it to your techOrder option. Then, you add the option src with your YouTube URL.
It supports:
- youtube.com as well as youtu.be
- Regular URLs: http://www.youtube.com/watch?v=xjS6SftYQaQ
- Embeded URLs: http://www.youtube.com/embed/xjS6SftYQaQ
- Playlist URLs: http://www.youtube.com/playlist?list=PLA60DCEB33156E51F OR http://www.youtube.com/watch?v=xjS6SftYQaQ&list=SPA60DCEB33156E51F
See the examples
This plugin exposes the following additional player options:
ytcontrols
(Boolean): Display the YouTube player controls instead of the Video.js player controls.quality
(String): Set the default video quality. Should be one of1080p
,720p
,480p
,360p
,240p
,144p
.playsInline
(Boolean): Sets theplaysinline
YouTube player parameter to enable inline playback on iOStoggleOnClick
(Boolean): Enable default YouTube behaviour of toggling video playback on clicking videoforceHTML5
(Boolean): Forces loading the YouTube HTML5 playerforceSSL
(Boolean): Forces loading the YouTube API over https
##Special Thank You Thanks to John Hurliman for the original code on the old Video.js