diff options
author | Florrie <towerofnix@gmail.com> | 2018-12-22 14:06:22 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-12-22 14:06:22 -0400 |
commit | 8d8747e57a3c4c235160002b1e32c71023823786 (patch) | |
tree | 98a773a1cfbbaab1c8a3907278c7fab943ee3935 | |
parent | 6fd767ec7aa32adab4143a4057f58a71d6205c6f (diff) |
Seek, pause
-rw-r--r-- | players.js | 16 |
1 files changed, 16 insertions, 0 deletions
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 { |