Bootstrap Youtube Playlist Popup Player Plugin

DEMO | Download

Requirements:

  • You will need Bootstrap v3.0.0 or above.
  • Bootstrap CSS and JavaScript (complete or modal, popover)
  • jQuery Library which is required by Bootstrap.
  • Bootstrap Youtube Playlist Popup Plugin Library which you can get from GitHub.
  • Use comma separated list of YouTube Id's in the data-playlist attribute of your elements.
  • For single video's you can use my smaller version: Bootstrap YouTube Popup Player Plugin.

Usage:

  • Use link tags on your page:
    <a class="youtube" href="#" data-playlist="4eYSpIz2FjU,gzKAut3sVrw,vlIm-riMN6Q">Link title</a>
  • OR, use <button> element with comma separated YouTube id playlist in data-playlist attribute:
    <button class="youtube" data-playlist="4eYSpIz2FjU,gzKAut3sVrw,vlIm-riMN6Q">Click me</button>
  • OR, use <img> element with comma separated YouTube id playlist in data-playlist attribute:
    <img class="youtube" data-playlist="4eYSpIz2FjU,gzKAut3sVrw,vlIm-riMN6Q" src="..." />
  • And finally, initialize the Plugin on page load:
    <script type="text/javascript">
      $(function () {
        $(".youtube").YouTubePlaylistModal({autoplay:0, width:640, height:480});
      });
    </script>
  • Configure the plugin using options listed below.

Configuration Options:

  • playList: Use it to override the Playlist using JavaScript.
  • title: Override the title text. To get the title from YouTube, leave this blank.
  • cssClass: (default: empty string) Attribute containing the CSS class to be assigned to the popup div.
  • width: (default: 640) Width of the YouTube player.
  • height: (default: 480) Height of the YouTube player.
  • icons: (default: Bootstrap Glyphicons) Icons for player controls.
  • translations: (default: English translations) Text used for the controls. Override this for any other Locale you want to use.
  • errors: (default: English translations) Error messages disaplyed on the modal. Override this for any other Locale you want to use.
  • onOpen: (default: null) Function you want to execute after the modal opens.
  • onClose: (default: null) Function you want to execute after the modal closes.
  • Rest of the options are used to configure the YouTube player. For more help on these options, please refer YouTube Embedded Player Parameters on YouTube API website.