You won't want each video to play as soon as they're loaded on the page. So, I took autoplay
out from the <video>
elements.
Here's what I came up with to play/pause videos on each of your "slides" ('.full')
http://jsfiddle.net/zyglobe/DW5CV/22/
function advanceToSlide(slidePos){
slide = $('.full').eq(slidePos);
slide.show();
var video = $('video', slide);
$('video').each(function(){
$(this).get(0).pause();
})
if(video.length){
console.log(video.get(0).play());
}
}
$('.full').on('click', function(){
$('.full').hide();
if(currentSlide < numSlides - 1){
currentSlide = currentSlide + 1;
} else{
currentSlide = 0;
}
advanceToSlide(currentSlide);
});
It's not the most elegant solution, but it works. You might look into using an existing jQuery slideshow solution.