Skip to content

Fix web player auto-playing after error when paused #4632 - #5624

Closed
Jdban wants to merge 1 commit into
advplyr:masterfrom
Jdban:fix/web-player-autoplay-on-error
Closed

Jdban wants to merge 1 commit into
advplyr:masterfrom
Jdban:fix/web-player-autoplay-on-error

Conversation

@Jdban

@Jdban Jdban commented Sep 30, 2026

Copy link
Copy Markdown

Brief summary

A paused web player can start playing by itself when another device syncs progress on the same book.
It only happens when the web player's session has already been dropped on the server.

Which issue is fixed?

Fixes #4632

In-depth Description

When another device syncs progress, the paused web player seeks to that position, and since its session no longer exists on the server, the audio request 404s and triggers the player's error handler.

When that happens, the web player falls back to a new stream, and it was reusing a "play when ready" flag left over from the last time you pressed Play. So a paused player that hit an error started playing again.

The fix sets that flag in playerError() from what the player was doing at the moment of the error. If it was playing, or about to play, the fallback plays. If it was paused, it stays paused.

At least two other people are knowingly impacted via #4632.

This has hit me twice at least (since I usually leave my home PC on with a book session paused) and I was finally able to diagnose the issue the second time it happened.

How have you tested this?

Steps to reproduce issue

Tested in 2.37.1 with Chrome.

  1. In the web client, play any book for a few seconds, then pause. Leave the tab open.
  2. Restart the server. This drops the web player's session without telling the tab. In normal use, the 36+h stale-session cleanup does the same thing.
  3. On another device, play the same book, then pause, so it syncs a position that's at least an hour away from where the web player is.
  4. The paused web player jumps to that position and starts playing on its own.

(The position in step 3 needs to be well past what the browser has buffered. A jump of only a few minutes can be served from the buffer, and then nothing happens.)

Testing

I performed the above steps with the fix applied, and the tab didn't confusingly unpause the book.
Also normal playback worked fine.

@nichwall

nichwall commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for opening a PR, but no frontend changes are being reviewed or merged at this time due to the ongoing React rewrite.

If you want to check if this issue still affects the new React client, you can test and open a PR there. https://github.com/audiobookshelf/audiobookshelf-client-react

@Jdban

Jdban commented Oct 1, 2026

Copy link
Copy Markdown
Author

Will do. Thanks!

@Jdban Jdban closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Web Player starts playing triggered by the Android app, gets out of sync

2 participants