diff --git a/build/mediaelement-and-player.js b/build/mediaelement-and-player.js index ca25ecd41..5c971a61e 100644 --- a/build/mediaelement-and-player.js +++ b/build/mediaelement-and-player.js @@ -2783,7 +2783,8 @@ if (typeof jQuery != 'undefined') { // options $.extend(mejs.MepDefaults, { - duration: -1 + duration: -1, + timeAndDurationSeparator: ' | ' }); @@ -2810,7 +2811,7 @@ if (typeof jQuery != 'undefined') { var t = this; if (controls.children().last().find('.mejs-currenttime').length > 0) { - $(' | '+ + $(t.options.timeAndDurationSeparator + '' + (t.options.duration > 0 ? mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) : diff --git a/build/mediaelement-and-player.min.js b/build/mediaelement-and-player.min.js index 69251358f..cdb7ac11d 100644 --- a/build/mediaelement-and-player.min.js +++ b/build/mediaelement-and-player.min.js @@ -103,10 +103,10 @@ k=c.find(".mejs-time-handle"),i=c.find(".mejs-time-float"),m=c.find(".mejs-time- function(){q=true;mejs.MediaFeatures.hasTouch||i.show()}).bind("mouseleave",function(){q=false;i.hide()});f(document).bind("mouseup",function(){o=false;i.hide()}).bind("mousemove",function(j){if(o||q)l(j)});d.addEventListener("progress",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false);d.addEventListener("timeupdate",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false);this.loaded=b;this.total=e;this.current=g;this.handle=k},setProgressRail:function(a){var c=a!=undefined?a.target: this.media,b=null;if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=c.buffered.end(0)/c.duration;else if(c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined)b=c.bufferedBytes/c.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)b=a.loaded/a.total;if(b!==null){b=Math.min(1,Math.max(0,b));this.loaded&&this.total&&this.loaded.width(this.total.width()*b)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a= this.total.width()*this.media.currentTime/this.media.duration,c=a-this.handle.outerWidth(true)/2;this.current.width(a);this.handle.css("left",c)}}})})(mejs.$); -(function(f){f.extend(mejs.MepDefaults,{duration:-1});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,c,b,d){f('
'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"
").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,c,b,d){if(c.children().last().find(".mejs-currenttime").length> -0)f(' | '+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");f('
'+ -(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"
").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime, -this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$); +(function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" | "});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,c,b,d){f('
'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"
").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a, +c,b,d){if(c.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+''+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"); +f('
'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"
").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()}, +false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$); (function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,c,b,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=f('
').appendTo(c), g=e.find(".mejs-volume-slider"),k=e.find(".mejs-volume-total"),i=e.find(".mejs-volume-current"),m=e.find(".mejs-volume-handle"),l=function(h){if(g.is(":visible")){var n=k.height(),p=k.position();h=n-n*h;m.css("top",p.top+h-m.height()/2);i.height(n-h);i.css("top",p.top+h)}else{g.show();l(h);g.hide()}},o=function(h){var n=k.height(),p=k.offset(),s=parseInt(k.css("top").replace(/px/,""),10);h=h.pageY-p.top;var r=(n-h)/n;if(!(p.top==0||p.left==0)){r=Math.max(0,r);r=Math.min(r,1);if(h<0)h=0;else if(h> n)h=n;m.css("top",h-m.height()/2+s);i.height(n-h);i.css("top",h+s);if(r==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}r=Math.max(0,r);r=Math.min(r,1);d.setVolume(r)}},q=false,j=false;e.hover(function(){g.show();j=true},function(){j=false;q||g.hide()});g.bind("mouseover",function(){j=true}).bind("mousedown",function(h){o(h);q=true;return false});f(document).bind("mouseup",function(){q=false;j||g.hide()}).bind("mousemove", diff --git a/build/mediaelementplayer.js b/build/mediaelementplayer.js index 80c2baa16..c4edce9ef 100644 --- a/build/mediaelementplayer.js +++ b/build/mediaelementplayer.js @@ -1298,7 +1298,8 @@ if (typeof jQuery != 'undefined') { // options $.extend(mejs.MepDefaults, { - duration: -1 + duration: -1, + timeAndDurationSeparator: ' | ' }); @@ -1325,7 +1326,7 @@ if (typeof jQuery != 'undefined') { var t = this; if (controls.children().last().find('.mejs-currenttime').length > 0) { - $(' | '+ + $(t.options.timeAndDurationSeparator + '' + (t.options.duration > 0 ? mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) : diff --git a/build/mediaelementplayer.min.js b/build/mediaelementplayer.min.js index b061d432a..5462308d6 100644 --- a/build/mediaelementplayer.min.js +++ b/build/mediaelementplayer.min.js @@ -44,10 +44,10 @@ k=c.find(".mejs-time-handle"),i=c.find(".mejs-time-float"),m=c.find(".mejs-time- function(){q=true;mejs.MediaFeatures.hasTouch||i.show()}).bind("mouseleave",function(){q=false;i.hide()});f(document).bind("mouseup",function(){o=false;i.hide()}).bind("mousemove",function(j){if(o||q)l(j)});d.addEventListener("progress",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false);d.addEventListener("timeupdate",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false);this.loaded=b;this.total=e;this.current=g;this.handle=k},setProgressRail:function(a){var c=a!=undefined?a.target: this.media,b=null;if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=c.buffered.end(0)/c.duration;else if(c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined)b=c.bufferedBytes/c.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)b=a.loaded/a.total;if(b!==null){b=Math.min(1,Math.max(0,b));this.loaded&&this.total&&this.loaded.width(this.total.width()*b)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a= this.total.width()*this.media.currentTime/this.media.duration,c=a-this.handle.outerWidth(true)/2;this.current.width(a);this.handle.css("left",c)}}})})(mejs.$); -(function(f){f.extend(mejs.MepDefaults,{duration:-1});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,c,b,d){f('
'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"
").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,c,b,d){if(c.children().last().find(".mejs-currenttime").length> -0)f(' | '+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");f('
'+ -(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"
").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime, -this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$); +(function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" | "});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,c,b,d){f('
'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"
").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a, +c,b,d){if(c.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+''+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"); +f('
'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"
").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()}, +false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$); (function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,c,b,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=f('
').appendTo(c), g=e.find(".mejs-volume-slider"),k=e.find(".mejs-volume-total"),i=e.find(".mejs-volume-current"),m=e.find(".mejs-volume-handle"),l=function(h){if(g.is(":visible")){var n=k.height(),p=k.position();h=n-n*h;m.css("top",p.top+h-m.height()/2);i.height(n-h);i.css("top",p.top+h)}else{g.show();l(h);g.hide()}},o=function(h){var n=k.height(),p=k.offset(),s=parseInt(k.css("top").replace(/px/,""),10);h=h.pageY-p.top;var r=(n-h)/n;if(!(p.top==0||p.left==0)){r=Math.max(0,r);r=Math.min(r,1);if(h<0)h=0;else if(h> n)h=n;m.css("top",h-m.height()/2+s);i.height(n-h);i.css("top",h+s);if(r==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}r=Math.max(0,r);r=Math.min(r,1);d.setVolume(r)}},q=false,j=false;e.hover(function(){g.show();j=true},function(){j=false;q||g.hide()});g.bind("mouseover",function(){j=true}).bind("mousedown",function(h){o(h);q=true;return false});f(document).bind("mouseup",function(){q=false;j||g.hide()}).bind("mousemove", diff --git a/src/js/mep-feature-time.js b/src/js/mep-feature-time.js index 5adb962bf..c928b77d2 100644 --- a/src/js/mep-feature-time.js +++ b/src/js/mep-feature-time.js @@ -2,7 +2,8 @@ // options $.extend(mejs.MepDefaults, { - duration: -1 + duration: -1, + timeAndDurationSeparator: ' | ' }); @@ -29,7 +30,7 @@ var t = this; if (controls.children().last().find('.mejs-currenttime').length > 0) { - $(' | '+ + $(t.options.timeAndDurationSeparator + '' + (t.options.duration > 0 ? mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :