mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 18:15:01 +02:00
Update:Scale chapter times with playback rate #726
This commit is contained in:
parent
b067a2d3d5
commit
c093548b71
3 changed files with 18 additions and 8 deletions
|
@ -13,6 +13,7 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
this.playWhenReady = false
|
||||
this.playableMimeTypes = {}
|
||||
this.playbackSession = null
|
||||
this.playbackRate = 1
|
||||
this.audioTracks = []
|
||||
this.startTime = 0
|
||||
this.trackStartTime = 0
|
||||
|
@ -53,9 +54,11 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
}
|
||||
|
||||
// PluginMethod
|
||||
async prepareLibraryItem({ libraryItemId, episodeId, playWhenReady, startTime }) {
|
||||
async prepareLibraryItem({ libraryItemId, episodeId, playWhenReady, startTime, playbackRate }) {
|
||||
console.log('[AbsAudioPlayer] Prepare library item', libraryItemId)
|
||||
|
||||
if (!isNaN(playbackRate) && playbackRate) this.playbackRate = playbackRate
|
||||
|
||||
if (libraryItemId.startsWith('local_')) {
|
||||
// Fetch Local - local not implemented on web
|
||||
} else {
|
||||
|
@ -134,6 +137,7 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
|
||||
// PluginMethod
|
||||
setPlaybackSpeed({ value }) {
|
||||
this.playbackRate = value
|
||||
if (this.player) this.player.playbackRate = value
|
||||
}
|
||||
|
||||
|
@ -229,6 +233,7 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
this.player.src = `${vuexStore.getters['user/getServerAddress']}${this.currentTrack.contentUrl}?token=${vuexStore.getters['user/getToken']}`
|
||||
console.log(`[AbsAudioPlayer] Loading track src ${this.player.src}`)
|
||||
this.player.load()
|
||||
this.player.playbackRate = this.playbackRate
|
||||
}
|
||||
|
||||
setAudioPlayer(playbackSession, playWhenReady = false) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue