« 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/players.js
diff options
context:
space:
mode:
Diffstat (limited to 'players.js')
-rw-r--r--players.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/players.js b/players.js
index 77f1246..1d64061 100644
--- a/players.js
+++ b/players.js
@@ -255,8 +255,15 @@ module.exports.ControllableMPVPlayer = class extends module.exports.MPVPlayer {
   }
 
   setPause(val) {
+    const wasPaused = this.isPaused
     this.isPaused = !!val
-    this.sendCommand('set', 'pause', this.isPaused)
+
+    if (this.isPaused !== wasPaused) {
+      this.sendCommand('cycle', 'pause')
+    }
+
+    // For some reason "set pause" doesn't seem to be working anymore:
+    // this.sendCommand('set', 'pause', this.isPaused)
   }
 
   setLoop(val) {