Skip to content

Commit

Permalink
Check for the correct media id when ensuring the MediaPlayer is ready (
Browse files Browse the repository at this point in the history
…#1783)

Just forgot to add this further condition.
  • Loading branch information
Marco Romano authored Nov 10, 2023
1 parent 14be887 commit 2f51919
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class MediaPlayerImpl @Inject constructor(
)
player.prepare()
// Will throw TimeoutCancellationException if the player is not ready after 1 second.
return state.timeout(1.seconds).first { it.isReady }
return state.timeout(1.seconds).first { it.isReady && it.mediaId == mediaId }
}

override fun play() {
Expand Down

0 comments on commit 2f51919

Please sign in to comment.