(function(a){a.fn.gVideo=function(b){var c={theme:"",childtheme:""};var b=a.extend(c,b);return this.each(function(){try{if(navigator.platform.indexOf("iPad")!=-1||navigator.platform.indexOf("iPhone")!=-1||navigator.platform.indexOf("iPod")!=-1){return}}catch(p){}var e=a(this);var l=a("<div></div>").addClass("ghinda-video-player").addClass(b.theme).addClass(b.childtheme);var g=a('<div class="ghinda-video-controls"><a class="ghinda-video-play" title="Play/Pause"></a><div class="ghinda-video-seek"></div><div class="ghinda-video-timer">00:00</div><div class="ghinda-volume-box"><div class="ghinda-volume-slider"></div><a class="ghinda-volume-button" title="Mute/Unmute"></a></div></div>');e.wrap(l);e.after(g);var f=e.parent(".ghinda-video-player");var g=a(".ghinda-video-controls",f);var r=a(".ghinda-video-play",f);var m=a(".ghinda-video-seek",f);var n=a(".ghinda-video-timer",f);var j=a(".ghinda-volume-slider",f);var i=a(".ghinda-volume-button",f);g.hide();var o=function(){if(e.attr("paused")==false){e[0].pause()}else{e[0].play()}};r.click(o);e.click(o);e.bind("play",function(){r.addClass("ghinda-paused-button")});e.bind("pause",function(){r.removeClass("ghinda-paused-button")});e.bind("ended",function(){r.removeClass("ghinda-paused-button")});var h;var q=function(){if(e.attr("readyState")){var u=e.attr("duration");m.slider({value:0,step:0.01,orientation:"horizontal",range:"min",max:u,animate:true,slide:function(){h=true},stop:function(w,v){h=false;e.attr("currentTime",v.value)}});g.show()}else{setTimeout(q,150)}};q();var d=function(w){var u=Math.floor(w/60)<10?"0"+Math.floor(w/60):Math.floor(w/60);var v=Math.floor(w-(u*60))<10?"0"+Math.floor(w-(u*60)):Math.floor(w-(u*60));return u+":"+v};var k=function(){var u=e.attr("currentTime");if(!h){m.slider("value",u)}n.text(d(u))};e.bind("timeupdate",k);var t=1;j.slider({value:1,orientation:"vertical",range:"min",max:1,step:0.05,animate:true,slide:function(v,u){e.attr("muted",false);t=u.value;e.attr("volume",u.value)}});var s=function(){if(e.attr("muted")==true){e.attr("muted",false);j.slider("value",t);i.removeClass("ghinda-volume-mute")}else{e.attr("muted",true);j.slider("value","0");i.addClass("ghinda-volume-mute")}};i.click(s);e.removeAttr("controls")})};a.fn.gVideo.defaults={}})(jQuery);
