From 8d8747e57a3c4c235160002b1e32c71023823786 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 22 Dec 2018 14:06:22 -0400 Subject: Seek, pause --- players.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'players.js') diff --git a/players.js b/players.js index cc20667..7810cde 100644 --- a/players.js +++ b/players.js @@ -90,6 +90,22 @@ module.exports.WebPlayer = class extends Player { this.audioEl.addEventListener('ended', handleEnded) }) } + + seekAhead(secs) { + this.audioEl.currentTime += secs + } + + seekBack(secs) { + this.audioEl.currentTime -= secs + } + + togglePause() { + if (this.audioEl.paused) { + this.audioEl.play() + } else { + this.audioEl.pause() + } + } } module.exports.MPVPlayer = class extends Player { -- cgit 1.3.0-6-gf8a5