Skip to content

Commit 2f51919

Browse files
author
Marco Romano
authored
Check for the correct media id when ensuring the MediaPlayer is ready (#1783)
Just forgot to add this further condition.
1 parent 14be887 commit 2f51919

File tree

1 file changed

+1
-1
lines changed
  • libraries/mediaplayer/impl/src/main/kotlin/io/element/android/libraries/mediaplayer/impl

1 file changed

+1
-1
lines changed

libraries/mediaplayer/impl/src/main/kotlin/io/element/android/libraries/mediaplayer/impl/MediaPlayerImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class MediaPlayerImpl @Inject constructor(
116116
)
117117
player.prepare()
118118
// Will throw TimeoutCancellationException if the player is not ready after 1 second.
119-
return state.timeout(1.seconds).first { it.isReady }
119+
return state.timeout(1.seconds).first { it.isReady && it.mediaId == mediaId }
120120
}
121121

122122
override fun play() {

0 commit comments

Comments
 (0)