mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Enhancement]: If Web Player is currently playing a book, exiting page should bring up prompt to confirm page exit and update player position #2641
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ZLoth on GitHub (Mar 8, 2025).
Type of Enhancement
None
Describe the Feature/Enhancement
When you are leaving the ABS page while an audiobook is playing, you are prompted if you really want to leave the page. This is to preserve progress and prevent accidental clicks. This may be accomplished with the Javascript function window.onbeforeunload .
Why would this be helpful?
As currently coded, if you have the web player playing a book and you exit the web page, the page exits immediately and your position is lost. By providing a prompt, this allows you to confirm before accidentally exiting the page and losing your progress.
Future Implementation (Screenshot)
Not applicable.
Audiobookshelf Server Version
2.19.5
Current Implementation (Screenshot)
https://github.com/user-attachments/assets/c4972077-4e56-411c-8f0f-f17c8761de41
@nichwall commented on GitHub (Mar 8, 2025):
Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client?
@ZLoth commented on GitHub (Mar 8, 2025):
Oh, so that explains it. When I played 40 seconds into the chapter then left the page, I was still able to get back to the position. I was testing with only about 10 seconds played.
I still think it would be nice to have a warning come up if the player is playing media.
@june012006 commented on GitHub (Apr 28, 2025):
It isn't sync'd though. Just spent an hour listening to a book, on 2.19.2 while on my computer. Then, I switched to my phone, and it started at the point before, and the webui had no record of listening on the web
@nichwall commented on GitHub (Apr 28, 2025):
There are still sync issues when switching between devices, particularly when opening the app from the background instead of fully closing the app when not using it.