Skip to content

Commit

Permalink
The media.duration property of the setMedia object is now used when d…
Browse files Browse the repository at this point in the history
…isplaying the jp-duration.
  • Loading branch information
thepag committed Apr 1, 2014
1 parent 95fb735 commit 3c74f75
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions jquery.jplayer/jquery.jplayer.js
Expand Up @@ -1666,12 +1666,22 @@
this.css.jq.currentTime.text(this._convertTime(this.status.currentTime));
}
}
var durationText = '';
var durationText = '',
duration = this.status.duration,
remaining = this.status.remaining;
if(this.css.jq.duration.length) {
if(this.options.remainingDuration) {
durationText = (this.status.remaining > 0 ? '-' : '') + this._convertTime(this.status.remaining);
if(typeof this.status.media.duration === 'string') {
durationText = this.status.media.duration;
} else {
durationText = this._convertTime(this.status.duration);
if(typeof this.status.media.duration === 'number') {
duration = this.status.media.duration;
remaining = duration - this.status.currentTime;
}
if(this.options.remainingDuration) {
durationText = (remaining > 0 ? '-' : '') + this._convertTime(remaining);
} else {
durationText = this._convertTime(duration);
}
}
if(durationText !== this.css.jq.duration.text()) {
this.css.jq.duration.text(durationText);
Expand Down

0 comments on commit 3c74f75

Please sign in to comment.