diff options
author | Sam Potts <me@sampotts.me> | 2015-03-30 19:17:27 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2015-03-30 19:17:27 +1100 |
commit | aa1fed0b16bd73418cceb23526c0660d551265eb (patch) | |
tree | 70208c18cb7997ac0a794875283328972ac47b79 /src | |
parent | 22331ae9f1b0b6282f808ae3fff01d0d9ae29e42 (diff) | |
download | plyr-aa1fed0b16bd73418cceb23526c0660d551265eb.tar.lz plyr-aa1fed0b16bd73418cceb23526c0660d551265eb.tar.xz plyr-aa1fed0b16bd73418cceb23526c0660d551265eb.zip |
Fixed bug with media longer than 60 minutes (Fixes #69)
Diffstat (limited to 'src')
-rw-r--r-- | src/js/plyr.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 4665a2a1..9128ad99 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1153,13 +1153,14 @@ function _updateTimeDisplay() { player.secs = parseInt(player.media.currentTime % 60); player.mins = parseInt((player.media.currentTime / 60) % 60); + player.hours = parseInt(((player.media.currentTime / 60) / 60) % 60); // Ensure it"s two digits. For example, 03 rather than 3. player.secs = ("0" + player.secs).slice(-2); player.mins = ("0" + player.mins).slice(-2); // Render - player.duration.innerHTML = player.mins + ":" + player.secs; + player.duration.innerHTML = (player.hours > 0 ? player.hours + ":" : "") + player.mins + ":" + player.secs; } // Handle time change event @@ -1303,7 +1304,6 @@ // Captions _on(player.buttons.captions, "change", function() { - console.log(this.checked); _toggleCaptions(this.checked); }); |