Use our generator to easily embed YouTube videos on your site for your channel, search query, or playlist. This will create the video player and video list on your website and is fully customizable.
Want to get started? Use our Youtube video embed generator below with a real time preview.
Generator
This generator will help you create the HTML needed to get your video embeds working. You can copy & paste this into your website, optimize your layout (css) and you're done.
Examples
The installation is very simple, provides super fast results, and has a wide set of features. Lets continue with some examples:
All YouTube videos about: "music video"
A YouTube playlist: Music Videos by VEVO
YouTube User videos: yvo
A simple inline YouTube video search
Installation
To install the YouTube video thumbnail results you can use the generator or follow the instruction below.
First: download this javascript file (4kb), and upload it to your server. On the page that you want the YouTube video thumbnail results to appear include this line in your document:
<script src='/ytembed.js'></script>
Up next is finding a nice spot where you want to have the YouTube video thumbnails. Insert there this html code that creates a block with the ID youtubeDiv (must be unique).
<div id="youtubeDiv"></div>
Directly below the code provide the configuration of the YouTube video thumbnails you want to show. An example:
The detailed explanation is below, but this code will do a YouTube video search on the newest videos uploaded on "baby laughing" and have 4 thumbnails returned that link to the YouTube video player.
And now comes the part to configure the script to your liking. You must tell the script what kind of videos you want to display on your page, this is done by providing several settings. You can do this by hand as explained below, or with our generator. The settings that are available:
key - obligated YouTube developer API key.
block - obligated ID of the html element (<div id='this_is_the_block_id'>) where you want the results thumbnails to appear.
type - obligated setting that provides the function you want to execute:
search - YouTube searches for a video with the string set by 'q'.
playlist - results of a YouTube playlist set by playlist id in 'q'.
user - results of a YouTube user videos set by user name in 'q'.
q - obligated string to identify your results, see 'type' above.
results - the number of results you want to show.
meta - set to true to display duration and views.
player - decide if you want to play the video on youtube.com or embed on your page:
embed - plays the video on your page.
link - plays the video on youtube.com
display_first - display the player and queu first video results (needs player set to embed)
true
width: embed player width
height: embed player height
layout - how do you want the results to appear:
thumbnails - only a list of thumbnails as result.
full - list of results with thumbnail, description, rating and user
You use these settings by placing them in this template style 'what':'value'. Separated by a comma. This is then placed within this function ytEmbed.init({'what':'value','what2':'value2'}); surrounded by <script> tags, again an example below: