« get me outta code hell

add seekTo player function - 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>2020-07-09 17:07:41 -0300
committerFlorrie <towerofnix@gmail.com>2020-07-09 17:07:53 -0300
commit71dd9675e8ceef415eb629895e1abe90eca2e2f0 (patch)
tree7dd78fb52228c67f8c75679abc87eff944a1aa7d /players.js
parent580f427cbf549bbb3943d85465901a995acebb0f (diff)
add seekTo player function
Diffstat (limited to 'players.js')
-rw-r--r--players.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/players.js b/players.js
index 5fe4714..6624f0f 100644
--- a/players.js
+++ b/players.js
@@ -40,6 +40,7 @@ class Player extends EventEmitter {
   playFile(file) {}
   seekAhead(secs) {}
   seekBack(secs) {}
+  seekTo(timeInSecs) {}
   volUp(amount) {}
   volDown(amount) {}
   setVolume(value) {}
@@ -189,6 +190,10 @@ module.exports.ControllableMPVPlayer = class extends module.exports.MPVPlayer {
     this.sendCommand('seek', -secs)
   }
 
+  seekTo(timeInSecs) {
+    this.sendCommand('seek', timeInSecs, 'absolute')
+  }
+
   volUp(amount) {
     this.setVolume(this.volume + amount)
   }