A very simple way to show a youtube playlist with jquery and fully responsive player. You can choose the following playlists. A regulair playlist (the default), user_uploads (channel), a custom playlist or make a list with search keywords
Just add a very small js ,css file and an empty div with an ID or class to your template and fill in a few variables in the $(document).ready(function() and youre done.
For a demo visit this page and resize your browser. You will see the responsive effect.
Thank you for purchasing the Responsive youtube auto playlist player. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
Here is the general structure. In this example I use html5 but it can also be used with any other DOCTYPE
<!DOCTYPE html> <html> <head> <title>Your site</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" type="text/css" href="./css/youtube-responsive.css" media="all" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.youtube-responsive.min.js"></script> <script type="text/javascript"> $(document).ready(function() { <!-- Example first player --> $('#youtubevideos').youTubePlaylistResponsive({ listtype : 'search', listvalue : 'hd', theme: true, center: true, maxwidth: '650px' lightsout: true }); <!-- Example second player --> $('#youtubevideos2').youTubePlaylistResponsive({ listtype : 'search', listvalue : 'jazz guitar', showInfo: false, autoHide: true }); <!-- Example third player --> $('#youtubevideos3').youTubePlaylistResponsive({ listtype : 'custom', listvalue : 'gFftC9O9EZ0,-Fv-iUhLcys,Vv2YXjCWg1A,eIa7YxlHq3A' }); }); </script>
Just add one of these tag's anywhere on your page where you want the youtube player
These ID names are just examples
<!-- First player --> <div id="youtubevideos"></div> <!-- END --> <!-- Second player --> <div id="youtubevideos2"></div> <!-- END --> <!-- third player --> <div id="youtubevideos3"></div> <!-- END -->
Be sure you set up your template with the right responsive tags
/* Example */ @media only screen and (max-width: 800px) { #container { width: 100%; } }
Here the stylesheet for the youtube player
File Name | Description |
---|---|
youtube-responsive.css |
The css file you need to include in your website |
The js needed for the youtube player
Tag | Description |
---|---|
jquery.js |
jQuery is a Javascript library that greatly reduces the amount of code that you must write. |
jquery.youtube-responsive.min.js |
The js code for the responsive youtube player |
Here all all the options available for the responsive youtube player
/* --- @ responsive youtube options ---*/ $('#youtubevideos').youTubePlaylistResponsive({ //listType playlist, user_uploads, custom or search (the default) listtype: 'search', listvalue: 'hd nature', autoplay: false, showrelated: false, showinfo: true, autohide: false, theme: false, modestbranding: true, iv_load_policy: false, allowfullscreen: true, controls: true, hd: false, maxwidth: '', center: false, lightsout: true });
Here's a brief information about the js options for the responsive youtube player
I've used the following files as listed.
Once again, thank you so much for purchasing this app. As I said at the beginning, I'd be glad to help you if you have any questions relating to this app. No guarantees, but I'll do my best to assist.
Ceasar