//tabNav V1.0 //(c) 2018 by yangyuhui. // Please retain this copyright header in all versions of the software (function($){$.fn.autoVideo=function(opts){var defaults={videoSource:"video",videoSwitch:".same-switch",curTime:".curr-time",totalTime:".total-time",};var options=$.extend({},defaults,opts),videoSource=$(this).find(options.videoSource),videoSwitch=$(this).find(options.videoSwitch),curTime=$(this).find(options.curTime),totalTime=$(this).find(options.totalTime);videoSwitch.on("click",function(){if(videoSource.trigger("pause")){videoSource.trigger("play")}else{videoSource.get(0).paused}});videoSource.on("play",function(){var aTime=getTimeStr($(this).get(0).duration);totalTime.html(aTime)});videoSource.on("timeupdate",function(){var cTimeStr=getTimeStr($(this).get(0).currentTime);curTime.html("/ "+cTimeStr)});function getTimeStr(time){var h=Math.floor(time/3600);var m=Math.floor(time%3600/60);var s=Math.floor(time%60);h=h>=10?h:"0"+h;m=m>=10?m:"0"+m;s=s>=10?s:"0"+s;return h+":"+m+":"+s}}})(jQuery);