From 0de889248dda2e1bb7156a8ba9d617a22f9c7b47 Mon Sep 17 00:00:00 2001 From: Santiago Saavedra Date: Fri, 20 Nov 2015 18:01:15 +0100 Subject: [PATCH] Bug 1207192 - [Flame][Music] The playback times in the Music app do not increase and decrease in sync in both NGA and OGA --- apps/music/elements/music-seek-bar.js | 2 +- dev_apps/music-oga/js/ui/views/player_view.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/music/elements/music-seek-bar.js b/apps/music/elements/music-seek-bar.js index 867dc40b964d..5562162ce2e5 100644 --- a/apps/music/elements/music-seek-bar.js +++ b/apps/music/elements/music-seek-bar.js @@ -240,7 +240,7 @@ Object.defineProperty(proto, 'remainingTime', { IntlHelper.get('duration').then((duration) => { this.els.remainingTime.textContent = - duration.format(-this._remainingTime * 1000); + duration.format(-(Math.floor(this.duration) - this._remainingTime) * 1000); this.els.elapsedTime.textContent = duration.format(this._elapsedTime * 1000); }); diff --git a/dev_apps/music-oga/js/ui/views/player_view.js b/dev_apps/music-oga/js/ui/views/player_view.js index 2c9e0eef83d9..5d2197f737da 100755 --- a/dev_apps/music-oga/js/ui/views/player_view.js +++ b/dev_apps/music-oga/js/ui/views/player_view.js @@ -560,7 +560,7 @@ var PlayerView = { this.seekBar.max = isFinite(endTime) ? endTime : 0; this.seekBar.value = currentTime; - var formattedCurrentTime = formatTime(currentTime); + var formattedCurrentTime = formatTime(Math.floor(currentTime)); // Adjust values for accessibility this.seekSlider.setAttribute('aria-valuetext', formattedCurrentTime); this.seekSlider.setAttribute('aria-valuemax', this.seekBar.max); @@ -587,7 +587,7 @@ var PlayerView = { this.seekIndicator.style.transform = 'translateX(' + x + ')'; this.seekElapsed.textContent = formattedCurrentTime; - var remainingTime = endTime - currentTime; + var remainingTime = Math.floor(endTime - currentTime); // Check if there is remaining time to show, avoiding to display "-00:00" // while song is loading (Bug 833710) this.seekRemaining.textContent =