Custom Youtube Playlist Player Plugin For jQuery

File Size: 68.3 KB
Views Total: 6528
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Custom Youtube Playlist Player Plugin For jQuery

A jQuery based custom Youtube video player that enables you to create your own playlist from any Youtube videos you specify.

How to use it:

1. Create an empty container for the Youtube playlist player.

<div id="player"></div>

2. Put jQuery library and the minified version of the Youtube Playlist Player plugin at the bottom of the webpage.

<script src="https://code.jquery.com/jquery-3.3.1.min.js"
        integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
        crossorigin="anonymous">
</script>
<script src="youtube-playlist-player.min.js"></script>

3. Initialize the Youtube player and specify an array of video IDs for the playlist.

var myPlayer = $("#player").YTPL(
    ['video-id-1','video-id-2']
);

4. Execute a function on video change.

myPlayer.on('changed',function(event,index){
  console.log(index);
});

5. Possible options to customize the Youtube playlist player.

var myPlayer = $("#player").YTPL(
    width:640,
    height:340,
    autoplay:1,
    loop:1, 
    controls: 1,
    iv_load_policy:3,
    modestbranding:1,
    rel:0,
    showinfo:0
);

This awesome jQuery plugin is developed by kiaonline. For more Advanced Usages, please check the demo page or visit the official website.