Youtube Playlist Thumbs

0

Demo Install and activate the plugin. Insert the [ypt playlist_id=] shortcode in your page or post and insert your playlist ID after the equal. When that content is published and viewed

Version
Last updated
Active installations
WordPress Version
Tested up to
Rating
Total ratings
Tag
This plugin is outdated and might not be supported anymore.

Description

Demo

Install and activate the plugin. Insert the [ypt playlist_id=] shortcode in your page or post and insert your playlist ID after the equal. When that content is published and viewed, a Youtube player will appear and a column of thumbnails will load to the right of the player. Clicking the thumbnails switches between videos.

This plugin includes a small CSS file for minimal styling that was written to target the specific IDs of the thumb list and player.

Youtube Playlist Thumbs plugin depends on the Youtube Iframe API. Any bugs experienced with that service will affect this plugin. Please check for bugs with Youtube Iframe API before reporting a bug for this plugin.

See “Other Notes” for usage.

Usage

Place this shortcode in your posts or pages and insert your Youtube Playlist ID after the equal.

[ypt playlist_id=]

To get a Youtube Playlist ID, copy the string after ‘&list=’ when viewing a playlist on Youtube.com. See screenshot #3.

To trigger the playback of an ordered video in the playlist, add this attribute to the clickable element:

data-ypt-index="X"

Where ‘X’ is the order number of the video with the first video starting at 0. The third video would be 2. For example:

<button data-ypt-index="2">Click to play the third video.</button>

The ‘Now Playing’ thumbnail text and arrow is inserted by CSS. Add this rule to your CSS to change it:

#ypt_thumbs .ypt-now-playing > span::after {
  content: "YOUR NEW TEXT" !important;
}

The height of the list of thumbnails is set by Javascript. It is first set when the player is ready and it adjusts when the window changes size. If you are using modals or any dynamic method to show/hide the player, you will need to trigger this function when the player is shown:

yptThumbHeight();

For example, with Bootstrap modals:

$('#videoModal').on('shown.bs.modal', function (e) { //modal shows
     yptThumbHeight(); //update the thumb height
});

A Javascript event triggers at the end of a playlist. It can used to trigger other events:

jQuery(document).on('playlistEnd', function () { //playlist finished last video
    alert("That's all, thanks for watching!"); //do something
});