From 9a1d0c26338a7d0851c60b99296669cdc80673f2 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 14 May 2023 19:53:31 -0300 Subject: new GhostPlayer class & support 👻 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also makes the UI not explode when duration strings aren't available for progress bar display, and shows getTimeStringsFromSec how to handle that. --- ui.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ui.js') diff --git a/ui.js b/ui.js index 371da80..ed046c0 100644 --- a/ui.js +++ b/ui.js @@ -4511,9 +4511,14 @@ class PlaybackInfoElement extends FocusElement { this.isLooping = player.isLooping this.isPaused = player.isPaused - this.progressBarLabel.text = '-'.repeat(Math.floor(this.w / lenSecTotal * curSecTotal)) + if (duration) { + this.progressBarLabel.text = '-'.repeat(Math.floor(this.w / lenSecTotal * curSecTotal)) + this.progressTextLabel.text = timeDone + ' / ' + duration + } else { + this.progressBarLabel.text = '' + this.progressTextLabel.text = timeDone + } - this.progressTextLabel.text = timeDone + ' / ' + duration if (player.isLooping) { this.progressTextLabel.text += ' [Looping]' } -- cgit 1.3.0-6-gf8a5