jQuery Plugin To Replace Youtube Links With Thumbnails shyt js - Download jQuery Plugin To Replace Youtube Links With Thumbnails - shyt.js

Download jQuery Plugin To Replace Youtube Links With Thumbnails – shyt.js

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin To Replace Youtube Links With Thumbnails – shyt.js, hope it will help you in programming stack.

jQuery Plugin To Replace Youtube Links With Thumbnails shyt js - Download jQuery Plugin To Replace Youtube Links With Thumbnails - shyt.js
File Size: 3.86 KB
Views Total: 1157
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

shyt.js is a lightweight and easy-to-use jQuery plugin which gets and displays video thumbnails to replace the regular Youtube links. 

How to use it:

1. To use this plugin, you must get an Youtube Data API key from the Google Developers Console.

2. Place both jQuery library and the shyt.js script right before the closing body tag.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="js/shyt.js"></script>

3. Call the function on the Youtube video links and insert your own Youtube API key.

1 $('a.ytvideo').shyt({
2   API_KEY: 'YOUR API KEY HERE'
3 });

4. Specify the quality of the thumbnail you want to fetch from an Youtube video.

1 $('a.ytvideo').shyt({
2   API_KEY: 'YOUR API KEY HERE'
3   size: "medium", // default, high, standard, maxres
4 });

5. You can also apply the plugin to any DIV element using HTML5 data attribute as follows:

1 $('div').shyt({
2   API_KEY: 'YOUR API KEY HERE'
3   size: "medium",
4   attribute: "data-yt-link",
5   wrap: true
6 });

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

source : jqueryscript.net