Skip to content

Instantly share code, notes, and snippets.

@cronco
Created July 28, 2014 18:31
Show Gist options
  • Save cronco/eb8211c9316bdfb27318 to your computer and use it in GitHub Desktop.
Save cronco/eb8211c9316bdfb27318 to your computer and use it in GitHub Desktop.
ClassOwl watch video (slightly edited)
//$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