This time I will share jQuery Plugin and tutorial about jQuery Plugin For Custom Youtube Video Controler, hope it will help you in programming stack.
YouTube_Controller.js is a jQuery wrapper around the latest Youtube Data API which makes it easier to control the Youtube video player embedded in the document.
How to use it:
1. Include the youtube_controller.js
JavaScript file on your HTML page after referencing jQuery library.
1 |
< script src = "//code.jquery.com/jquery.min.js" ></ script > |
2 |
< script src = "youtube_controller.js" ></ script > |
2. Create a container element to place the Youtube video player.
1 |
< div id = "playerContainer" > |
3. Call the function on the player container and insert your own API key & video ID.
1 |
$( "#playerContainer" ).YTController({ |
2 |
videoId: "6k8qeqZycgE" , |
3 |
apiKey: "AIzaSyCmq9OXz3ezp883KTeRFSyygzvzdnRKHJ4" |
4. All possible options to config the Youtube video player.
01 |
$( "#playerContainer" ).YTController({ |
04 |
displayPlaylist: false , |
07 |
playerVars: undefined, |
16 |
listItemClickHandler: function (){}, |
19 |
listItemHTMLTemplate: "<div><img src='[playlistItem_thumb]'/><span>[playlistItem_timestamp]</span><h4>[playlistItem_title]</h4><p>[playlistItem_description]</p></div>" , |
23 |
listItemThumbNailJSONPath: "thumbnails.default" , |
29 |
onApiChangeHandler: $.noop, |
30 |
onErrorHandler: $.noop, |
31 |
onPlaybackQChangeHandler: $.noop, |
32 |
onPlaybackRChangeHandler: $.noop, |
33 |
onReadyEvtHandler: $.noop, |
34 |
onStateChangeHandler: $.noop, |
37 |
playListId: undefined, |
40 |
playListParentId: undefined |
5. API methods:
01 |
var myControler = $( "#playerContainer" ).YTController({ |
17 |
myControler.previous() |
32 |
myControler.getPlayer() |
This awesome jQuery plugin is developed by WatersChurch. For more Advanced Usages, please check the demo page or visit the official website.