mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:56 -05:00
[Bug]: Cast Playrate Wrong and Not Updating #2271
Labels
No labels
authentication
awaiting release
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/audiobookshelf#2271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @jrpetersjr on GitHub (Jul 10, 2024).
What happened?
When casting an audiobook from the web there are several bugs when it comes to the playback rate of the book.
What did you expect to happen?
The audiobook should be playing at the playback rate that I have set no matter how I start the casting session. While casting I should be able to update the playbackrate and it reflect correctly on the remote device.
Steps to reproduce the issue
1 Start book and set speed to 2x
2 Hit Cast Button and select device
3 Start book
...Book will play at 1x speed
1 Start casting at any speed
2 Change speed
...book will play at speed it was already playing
Audiobookshelf version
V2.11.0
How are you running audiobookshelf?
Docker
What OS is your Audiobookshelf server hosted from?
Linux
If the issue is being seen in the UI, what browsers are you seeing the problem on?
Chrome
Logs
No response
Additional Notes
I downloaded everything to make the fix myself, but couldn't cast working locally from the dev setup. From what I saw while looking through the code and getting it running I believe the answer is in a couple places.
I believe the above may fix everything, but will be slower and more chattery. Below would clean it up a bit and make less castLoadMedia calls so it would be better with an extra update.
switchPlayer method
The only call to SetPlayerRate is in playerStateChange if the player gets turned on, but by that time the player is already playing and wont' have the correct playRate...this works with LocalAudioPlayer and LocalVideoPlayer because they are working correctly, and one the above is working it will work too. If it's moved away from every time the player is started to only when the player is first created or when the user actively changes it and setPlayerRate is called then castLoadMedia won't be called every time something is started or stopped.
I'm probably missing something, but that's what I saw with my initial lookthrough and it's all dependent on when the playBackRate is changed on the web app that the new value will be passed to playerHandler.setPlayBackRate.
@jrpetersjr commented on GitHub (Jul 10, 2024):
Let me know if you need anything else from me.
@jrpetersjr commented on GitHub (Jul 10, 2024):
This could be the same issue as https://github.com/advplyr/audiobookshelf-app/issues/1254