var html5Player={init:function(slug,autoplay){var self=this;self.autoplay=autoplay||false;self.duration=0;self.playing=false;self.muted=false;self.video=$("video","div#"+slug);self.video.parent().width(self.video.width());self.video.parent().height(self.video.height());self.video.parent().css("margin","0 auto");self.pLink=$(".poster_link",self.video.parent());self.video.bind("canplay",function(){self.pLink.width(self.video.width());self.pLink.height(self.video.height());self.duration=this.duration;if(self.autoplay){self.pause(false)}});self.video.bind("ended",function(){self.playing=false});self.video.bind("timeupdate",function(){self.duration=this.duration
});return self},play:function(){var self=this;if(!self.playing){self.pLink.hide();self.video.get(0).play();self.playing=true}},pause:function(action){var self=this;if(action){self.video.get(0).pause();self.playing=false}else{self.play()}}};function cleantime(seconds){var m=Math.floor(seconds/60)<10?"0"+Math.floor(seconds/60):Math.floor(seconds/60);var s=Math.floor(seconds-(m*60))<10?"0"+Math.floor(seconds-(m*60)):Math.floor(seconds-(m*60));return m+":"+s};