Skip to content

Instantly share code, notes, and snippets.

@douglasback
Created May 10, 2012 16:15
Show Gist options
  • Save douglasback/2654215 to your computer and use it in GitHub Desktop.
Save douglasback/2654215 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function(){
$('.close-reveal-modal').on("click", function(e){
e.preventDefault();
for (var i=0; i<window.player.length; i++){
window.player[i].pauseVideo();
}
});
});
function onYouTubePlayerAPIReady(){
var videos = jQuery('.youtube-player'),
l = videos.length;
window.players = [];
for (var i=0; i < l; i++){
window.players.push(new YT.Player(videos[i].id, {
events: {
}
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment