I have separate 3 folders, video1, video2, video3 - it all contains video1.mp4, video2.mp4, video3.mp4. by default, my html5 video has the video1-th folder's video1.mp4. but while the user click on other 2 thumbnail the video need to change according to the link what they click. so i need to change the src of the video.. for that i used this function
$('#video2 img').click(function(){
var id = $(this).parent().attr('id');
var lastChar = id.substr(id.length - 1);
alert(lastChar);
var path = $('video').attr('src').substr(12,1);
$(path).replaceWith(lastChar);
alert(lastChar+'::'+path);
});
but not work well... i have 3 links with id of #video1, #video2, #video3 - all need to load separate video from their named folder.. any help?