mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Fix:Mark media as finished if less than 5 seconds remain on a sync and call progress sync again when last track ends #635
This commit is contained in:
parent
6161daeef0
commit
93b8e11378
5 changed files with 18 additions and 6 deletions
|
@ -101,6 +101,7 @@ export default class PlayerHandler {
|
|||
this.player.on('timeupdate', this.playerTimeupdate.bind(this))
|
||||
this.player.on('buffertimeUpdate', this.playerBufferTimeUpdate.bind(this))
|
||||
this.player.on('error', this.playerError.bind(this))
|
||||
this.player.on('finished', this.playerFinished.bind(this))
|
||||
}
|
||||
|
||||
playerError() {
|
||||
|
@ -111,6 +112,16 @@ export default class PlayerHandler {
|
|||
}
|
||||
}
|
||||
|
||||
playerFinished() {
|
||||
this.stopPlayInterval()
|
||||
|
||||
var currentTime = this.player.getCurrentTime()
|
||||
this.ctx.setCurrentTime(currentTime)
|
||||
|
||||
// TODO: Add listening time between last sync and now?
|
||||
this.sendProgressSync(currentTime)
|
||||
}
|
||||
|
||||
playerStateChange(state) {
|
||||
console.log('[PlayerHandler] Player state change', state)
|
||||
this.playerState = state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue