mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Update jump forwards and jump backwards to handle user state values in PlayerHandler
This commit is contained in:
parent
fa89ed9d87
commit
968c6e4ffb
1 changed files with 10 additions and 2 deletions
|
|
@ -51,6 +51,12 @@ export default class PlayerHandler {
|
||||||
if (!this.episodeId) return null
|
if (!this.episodeId) return null
|
||||||
return this.libraryItem.media.episodes.find(ep => ep.id === this.episodeId)
|
return this.libraryItem.media.episodes.find(ep => ep.id === this.episodeId)
|
||||||
}
|
}
|
||||||
|
get jumpForwardAmount() {
|
||||||
|
return this.ctx.$store.getters['user/getUserSetting']('jumpForwardAmount')
|
||||||
|
}
|
||||||
|
get jumpBackwardAmount() {
|
||||||
|
return this.ctx.$store.getters['user/getUserSetting']('jumpBackwardAmount')
|
||||||
|
}
|
||||||
|
|
||||||
setSessionId(sessionId) {
|
setSessionId(sessionId) {
|
||||||
this.currentSessionId = sessionId
|
this.currentSessionId = sessionId
|
||||||
|
|
@ -381,13 +387,15 @@ export default class PlayerHandler {
|
||||||
jumpBackward() {
|
jumpBackward() {
|
||||||
if (!this.player) return
|
if (!this.player) return
|
||||||
var currentTime = this.getCurrentTime()
|
var currentTime = this.getCurrentTime()
|
||||||
this.seek(Math.max(0, currentTime - 10))
|
const jumpAmount = this.jumpBackwardAmount
|
||||||
|
this.seek(Math.max(0, currentTime - jumpAmount))
|
||||||
}
|
}
|
||||||
|
|
||||||
jumpForward() {
|
jumpForward() {
|
||||||
if (!this.player) return
|
if (!this.player) return
|
||||||
var currentTime = this.getCurrentTime()
|
var currentTime = this.getCurrentTime()
|
||||||
this.seek(Math.min(currentTime + 10, this.getDuration()))
|
const jumpAmount = this.jumpForwardAmount
|
||||||
|
this.seek(Math.min(currentTime + jumpAmount, this.getDuration()))
|
||||||
}
|
}
|
||||||
|
|
||||||
setVolume(volume) {
|
setVolume(volume) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue