advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.2k stars 432 forks source link

[Bug]: Cast Playrate Wrong and Not Updating #3147

Open jrpetersjr opened 1 month ago

jrpetersjr commented 1 month ago

What happened?

When casting an audiobook from the web there are several bugs when it comes to the playback rate of the book.

1) If you were listening to a book a X speed (1.2x for example) and then press the Cast button to switch players, once you start the book back on the remote device it will always play at 1x speed. 2) The only way to play over Cast at the speed you want is to play the book, change the speed to what you want. Close the player connect to a Cast capable device, and then start the book again. It will play at the speed you've set. 3) The audiobook will always be at the same speed that it was started at and won't be updated.

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.

1) CastPlayer.js -> setPlaybackRate method

2) PlayerHandler.js

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 1 month ago

Let me know if you need anything else from me.

jrpetersjr commented 1 month ago

This could be the same issue as https://github.com/advplyr/audiobookshelf-app/issues/1254