Skip to content

Commit

Permalink
Handle paused-but-downloading streamed books correctly (PP-1852).
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Nov 5, 2024
1 parent ca87901 commit 9369d3d
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,18 @@ class ExoAdapter(
) {
this.logger.debug("onPlayWhenReadyChanged: {} {})", playWhenReady, reason)

if (this.exoPlayer.isPlaying) {
this.newState(ExoPlayerPlaybackStatus.PLAYING)
} else {
if (this.exoPlayer.isLoading) {
this.isBufferingNow = true
this.newState(ExoPlayerPlaybackStatus.BUFFERING)
} else {
when (playWhenReady) {
true -> {
if (this.exoPlayer.isPlaying) {
this.newState(ExoPlayerPlaybackStatus.PLAYING)
return
}
if (this.exoPlayer.isLoading) {
this.isBufferingNow = true
this.newState(ExoPlayerPlaybackStatus.BUFFERING)
}
}
false -> {
this.newState(ExoPlayerPlaybackStatus.PAUSED)
}
}
Expand Down

0 comments on commit 9369d3d

Please sign in to comment.