« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index ac86a47..371958d 100644
--- a/ui.js
+++ b/ui.js
@@ -95,9 +95,18 @@ class AppElement extends FocusElement {
 
   async setup() {
     this.player = await getPlayer()
+
+    if (!this.player) {
+      return {
+        error: "Sorry, it doesn't look like there's an audio player installed on your computer. Can you try installing MPV (https://mpv.io) or SoX?"
+      }
+    }
+
     this.player.on('printStatusLine', data => {
       this.playbackInfoElement.updateProgress(data)
     })
+
+    return true
   }
 
   async shutdown() {