diff options
author | Florrie <towerofnix@gmail.com> | 2018-06-13 21:03:30 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-06-13 21:03:30 -0300 |
commit | 3c0cd5c2a98685ab9fd0fdf97a1ac28ceb97dc74 (patch) | |
tree | 564dfa43da134f10cfaae9405a5152e3316ba51d /ui.js | |
parent | 4de13b1d3e1cff28e331607b262513a9583aa08a (diff) |
Error handling stuff
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 9 |
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() { |