From 3c0cd5c2a98685ab9fd0fdf97a1ac28ceb97dc74 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 13 Jun 2018 21:03:30 -0300 Subject: Error handling stuff --- ui.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ui.js') 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() { -- cgit 1.3.0-6-gf8a5