« 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
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-07-09 17:07:41 -0300
committerFlorrie <towerofnix@gmail.com>2020-07-09 17:10:47 -0300
commit06128c9d42060b7513fb5490982e7f42b0ee596b (patch)
tree3a74e52eae2db9000bc606cc3ed1aaa0e8d08651
parentbefceed00ce677befe0ae9fa5122390e391207d4 (diff)
add seekTo player function
-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)
   }