From 06128c9d42060b7513fb5490982e7f42b0ee596b Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 9 Jul 2020 17:07:41 -0300 Subject: add seekTo player function --- players.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'players.js') 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) } -- cgit 1.3.0-6-gf8a5 From 05d29dff7b14bc1a1ea641bbb03314ec308610df Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 15 Sep 2020 17:01:58 -0300 Subject: rename "song" terminology to "track" We've always used "track" as the proper term, but these managed to slip by over time anyway. Oops! --- players.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'players.js') diff --git a/players.js b/players.js index 6624f0f..e22e505 100644 --- a/players.js +++ b/players.js @@ -126,7 +126,7 @@ module.exports.MPVPlayer = class extends Player { if (parseInt(percent) < lastPercent) { // mpv forgets commands you sent it whenever it loops, so you // have to specify them every time it loops. We do that whenever the - // position in the song decreases, since that means it may have + // position in the track decreases, since that means it may have // looped. this.setLoop(this.isLooping) } -- cgit 1.3.0-6-gf8a5