bux23
12/4/2016 - 11:54 PM

add title above video

add title above video

////////////////////////////////////////////////////////////////////////////////
// PREPEND TITLE TO VIDEO
////////////////////////////////////////////////////////////////////////////////
jQuery(document).ready(function($){
	$('video').each(function(){
	    var src = $(this).get(0).currentSrc;
	    var fileNameIndex = src.lastIndexOf("/") + 1;
		var dotIndex = src.lastIndexOf('.');
		var title = src.substr(fileNameIndex, dotIndex < fileNameIndex ? src.length : dotIndex);
		$(this).before("<h5>" + title + "<h5>");
	});
});