I find myself puzzled by this particular line of code: $("a[href*='video']")
. It seems to hold an enigma that I can't quite unravel.
$("a[href*='video']").click(function() {
var id = $(this).attr("href");
playVideo(id);
});
function playVideo(id) {
var $video = $(id + " video")[0];
$video.play();
$(".close").click(function() {
$video.pause();
$video.currentTime = 0;
});
}