Skip to content

Commit

Permalink
- updated hours time feature
Browse files Browse the repository at this point in the history
  • Loading branch information
johndyer committed Apr 12, 2011
1 parent bb28002 commit 307c586
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/js/mep-feature-time.js
Expand Up @@ -2,7 +2,7 @@
// current and duration 00:00 / 00:00
MediaElementPlayer.prototype.buildcurrent = function(player, controls, layers, media) {
$('<div class="mejs-time">'+
'<span class="mejs-currenttime">' + (player.options.showHours ? '00:' : '') + '00:00</span>'+
'<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>'+
'</div>')
.appendTo(controls);

Expand All @@ -14,12 +14,12 @@
MediaElementPlayer.prototype.buildduration = function(player, controls, layers, media) {
if (controls.children().last().find('.mejs-currenttime').length > 0) {
$(' <span> | </span> '+
'<span class="mejs-duration">' + (player.options.showHours ? '00:' : '') + '00:00</span>')
'<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>')
.appendTo(controls.find('.mejs-time'));
} else {

$('<div class="mejs-time">'+
'<span class="mejs-duration">' + (player.options.showHours ? '00:' : '') + '00:00</span>'+
'<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>'+
'</div>')
.appendTo(controls);
}
Expand All @@ -33,14 +33,14 @@
var t = this;

//if (t.media.currentTime) {
t.controls.find('.mejs-currenttime').html(mejs.Utility.secondsToTimeCode(t.media.currentTime | 0, t.options.showHours || t.media.duration > 360 ));
t.controls.find('.mejs-currenttime').html(mejs.Utility.secondsToTimeCode(t.media.currentTime | 0, t.options.alwaysShowHours || t.media.duration > 360 ));
//}
}
MediaElementPlayer.prototype.updateDuration = function() {
var t = this;

if (t.media.duration) {
t.controls.find('.mejs-duration').html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.showHours));
t.controls.find('.mejs-duration').html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours));
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/js/mep-player.js
Expand Up @@ -23,7 +23,7 @@
// resize to media dimensions
enableAutosize: true,
// forces the hour marker (##:00:00)
showHours: false,
alwaysShowHours: false,
// features to show
features: ['playpause','current','progress','duration','tracks','volume','fullscreen']
};
Expand Down

0 comments on commit 307c586

Please sign in to comment.