Created
July 28, 2014 18:31
-
-
Save cronco/eb8211c9316bdfb27318 to your computer and use it in GitHub Desktop.
ClassOwl watch video (slightly edited)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//$videoContent, $videoOverlay initialized elsewhere... | |
var watchVideo = function(e) { | |
e.preventDefault(); | |
var container = $('.video-container'); | |
$('html, body').animate({ | |
scrollTop: parseInt(container.offset().top, 10) | |
}, function() { | |
playVideo(e); | |
}); | |
return false; | |
}, | |
playVideo = function(e) { | |
e.preventDefault(); | |
$videoOverlay.show(100); | |
$videoContent.addClass('shown'); | |
$videoContent.show(400, function() { | |
if (player.playVideo) { | |
player.setPlaybackQuality('hd720'); | |
player.playVideo(); | |
} | |
}); | |
return false; | |
}; | |
$(document).ready(function() { | |
$('#watch-video').on('click', watchVideo); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment