Skip to content

Commit

Permalink
Set the appropriate PlayingStatus in onPlayWhenReadyChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
mr3y-the-programmer committed Jul 3, 2024
1 parent 8449589 commit 818eac0
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ class ServiceMediaPlayer(
) {
val playingStatus = when {
playWhenReady -> PlayingStatus.Playing
playbackState == Player.STATE_BUFFERING -> PlayingStatus.Loading
else -> PlayingStatus.Paused
}
currentlyPlayingEpisode.value?.let { (episode, _, _) ->
val isAboutToPlay = playingStatus == PlayingStatus.Loading || playingStatus == PlayingStatus.Playing
val isAboutToPlay = playingStatus == PlayingStatus.Playing
episode.durationInSec?.let {
if (episode.progressInSec == null) return@let

Expand Down

0 comments on commit 818eac0

Please sign in to comment.