« get me outta code hell

"Pause when this track ends" option - 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:
authorFlorrie <towerofnix@gmail.com>2019-07-30 21:49:04 -0300
committerFlorrie <towerofnix@gmail.com>2019-07-30 21:49:04 -0300
commit0e9b316165f8b6585d5822a8a3b8199b7ec3e671 (patch)
tree3f9a7810d524319591ca7b05de303a9b4a9c5816 /players.js
parent182514a1e8170d124907b982f5f87f1bffad147c (diff)
"Pause when this track ends" option
Diffstat (limited to 'players.js')
-rw-r--r--players.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/players.js b/players.js
index 0c296b3..a61e545 100644
--- a/players.js
+++ b/players.js
@@ -63,6 +63,9 @@ module.exports.MPVPlayer = class extends Player {
     if (this.isLooping) {
       opts.unshift('--loop')
     }
+    if (this.isPaused) {
+      opts.unshift('--pause')
+    }
     opts.unshift('--volume', this.volume)
     return opts
   }
@@ -71,7 +74,6 @@ module.exports.MPVPlayer = class extends Player {
     // The more powerful MPV player. MPV is virtually impossible for a human
     // being to install; if you're having trouble with it, try the SoX player.
 
-    this.isPaused = false
     this.process = spawn('mpv', this.getMPVOptions(file))
 
     let lastPercent = 0