Fixed ANR when playing call recording sometimes

This commit is contained in:
Sylvain Berfini 2022-11-22 10:45:19 +01:00
parent 774b37c73c
commit 66c2a74c8e

View file

@ -127,8 +127,10 @@ class RecordingData(val path: String, private val recordingListener: RecordingLi
scope.launch {
withContext(Dispatchers.IO) {
for (tick in tickerChannel) {
if (player.state == Player.State.Playing) {
updatePosition()
withContext(Dispatchers.Main) {
if (player.state == Player.State.Playing) {
updatePosition()
}
}
}
}