Fixed deadlock (ANR) while playing voice recording

This commit is contained in:
Sylvain Berfini 2022-09-08 11:13:53 +02:00
parent b47ae48529
commit 138635230a

View file

@ -384,7 +384,9 @@ class ChatMessageContentData(
voiceRecordingPlayer.start() voiceRecordingPlayer.start()
isVoiceRecordPlaying.value = true isVoiceRecordPlaying.value = true
tickerFlow().onEach { tickerFlow().onEach {
voiceRecordPlayingPosition.postValue(voiceRecordingPlayer.currentPosition) withContext(Dispatchers.Main) {
voiceRecordPlayingPosition.value = voiceRecordingPlayer.currentPosition
}
}.launchIn(scope) }.launchIn(scope)
} }