Categories
Code

Embed YouTube Videos with JavaScript

This explains how you can embed YouTube videos using the Google+ approach – only the video thumbnail is loaded along with the page and the actual player loads when the user hits the play button.

 


<script> // Find all the YouTube video embedded on a page var videos = document.getElementsByClassName("youtube"); for (var i=0; i