Originally created by @dchawisher on GitHub (Jun 20, 2022).
Steps to reproduce
Close the android app entirely and open it again. (Note: Other means of closing the socket, e.g. logging out of the android app, do not cause the issue.)
Press the Chromecast button and select a player. (If you like, press the button to stop casting, then start another Chromecast session. It makes no difference.)
Play any multitrack audiobook in which the saved position is beyond the first track. (Alternatively, play the audiobook, then press Chromecast. It makes no difference.)
Expected behaviour
Book begins playing from the Chromecast device from the last position.
The progress bar on the android app player displays that position.
Actual behaviour
The listening position within the track is treated as the listening position for the audiobook as a whole.
So, e.g., if you are at 1:20:10 of your audiobook, which is 0:15:02 of the second track, playback begins at 0:15:02 of the audiobook (that is, 0:15:02 of the first track).
This new position is saved, resulting in lost progress.
Note: On one occasion (out of more than a dozen controlled attempts), this bug did not occur, and the behavior described in the following bullet point occurred instead. I have no idea why.
Subsequent plays via Chromecast begin playing at the correct position, but only until the app is closed. (In those plays, the progress bar briefly displays the "track" position, but the audio that plays is from the correct position, and the progress bar corrects itself in a few seconds.)
Environment data
Audiobookshelf Version: 2.0.22, 2.0.21.
Android App? Version 0.9.49 (installed from play store).
iOS App?
Android Issue
Android version: 12
Device model: Pixel 4a
Stock or customized system: Stock
Originally created by @dchawisher on GitHub (Jun 20, 2022).
### Steps to reproduce
1. Close the android app entirely and open it again. (Note: Other means of closing the socket, e.g. logging out of the android app, do not cause the issue.)
2. Press the Chromecast button and select a player. (If you like, press the button to stop casting, then start another Chromecast session. It makes no difference.)
3. Play any multitrack audiobook in which the saved position is beyond the first track. (Alternatively, play the audiobook, then press Chromecast. It makes no difference.)
### Expected behaviour
- Book begins playing from the Chromecast device from the last position.
- The progress bar on the android app player displays that position.
### Actual behaviour
- The listening position **within the track** is treated as the listening position for the audiobook as a whole.
- So, e.g., if you are at 1:20:10 of your audiobook, which is 0:15:02 of the second track, playback begins at 0:15:02 of the audiobook (that is, 0:15:02 of the first track).
- This new position is saved, resulting in lost progress.
- Note: On one occasion (out of more than a dozen controlled attempts), this bug did not occur, and the behavior described in the following bullet point occurred instead. I have no idea why.
- Subsequent plays via Chromecast begin playing at the correct position, but only until the app is closed. (In those plays, the progress bar briefly displays the "track" position, but the audio that plays is from the correct position, and the progress bar corrects itself in a few seconds.)
### Environment data
Audiobookshelf Version: 2.0.22, 2.0.21.
- [X] Android App? Version 0.9.49 (installed from play store).
- [ ] iOS App?
#### Android Issue
Android version: 12
Device model: Pixel 4a
Stock or customized system: Stock
adam
added the bug label 2026-04-24 23:12:04 +02:00
I have no idea what I'm doing with Android Studio, but it seems like these log items might have something to do with the issue?
2022-06-21 15:05:39.040 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo 0 position 1163969
2022-06-21 15:05:39.040 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo: Changing media item index from 2 to 0
I'm assuming "1163969" is the position in milliseconds and "0" is the first track. (That matches the position it went to during this test run.) The corresponding log lines from a playback that didn't have the problem (that is, a second or subsequent playback) were as follows:
2022-06-21 15:06:27.705 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo 0 position 114203
2022-06-21 15:06:27.705 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo: Same media index seek to position 114203
@dchawisher commented on GitHub (Jun 21, 2022):
I have no idea what I'm doing with Android Studio, but it seems like these log items might have something to do with the issue?
```
2022-06-21 15:05:39.040 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo 0 position 1163969
2022-06-21 15:05:39.040 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo: Changing media item index from 2 to 0
```
I'm assuming "1163969" is the position in milliseconds and "0" is the first track. (That matches the position it went to during this test run.) The corresponding log lines from a playback that didn't have the problem (that is, a second or subsequent playback) were as follows:
```
2022-06-21 15:06:27.705 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo 0 position 114203
2022-06-21 15:06:27.705 28002-28002/com.audiobookshelf.app D/CastPlayer: seekTo: Same media index seek to position 114203
```
I was able to replicate this. The audio player on the phone is always showing the first track, but if you first press play on an audiobook while already casting it will show correctly and play correctly on the chromecast device.
@advplyr commented on GitHub (Jun 21, 2022):
I was able to replicate this. The audio player on the phone is always showing the first track, but if you first press play on an audiobook while already casting it will show correctly and play correctly on the chromecast device.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @dchawisher on GitHub (Jun 20, 2022).
Steps to reproduce
Expected behaviour
Actual behaviour
Environment data
Audiobookshelf Version: 2.0.22, 2.0.21.
Android Issue
Android version: 12
Device model: Pixel 4a
Stock or customized system: Stock
@dchawisher commented on GitHub (Jun 21, 2022):
I have no idea what I'm doing with Android Studio, but it seems like these log items might have something to do with the issue?
I'm assuming "1163969" is the position in milliseconds and "0" is the first track. (That matches the position it went to during this test run.) The corresponding log lines from a playback that didn't have the problem (that is, a second or subsequent playback) were as follows:
@advplyr commented on GitHub (Jun 21, 2022):
I was able to replicate this. The audio player on the phone is always showing the first track, but if you first press play on an audiobook while already casting it will show correctly and play correctly on the chromecast device.
@advplyr commented on GitHub (Jun 22, 2022):
I found the issue, will be fixed in the next release
@dchawisher commented on GitHub (Jun 22, 2022):
Wow. Thanks!
@dchawisher commented on GitHub (Jun 22, 2022):
The fix works perfectly. Thanks again!
@advplyr commented on GitHub (Jul 3, 2022):
Fixed in 0.9.50-beta