Pause playback instead of reset when recording a new voice message

This commit is contained in:
Florian Renaud 2022-11-14 15:34:07 +01:00
parent a73e707f33
commit 7349bc90c0
2 changed files with 2 additions and 10 deletions

View File

@ -66,7 +66,7 @@ class AudioMessageHelper @Inject constructor(
fun startRecording(roomId: String) {
stopPlayback()
playbackTracker.makeAllPlaybacksIdle()
playbackTracker.pauseAllPlaybacks()
amplitudeList.clear()
try {

View File

@ -51,15 +51,7 @@ class AudioMessagePlaybackTracker @Inject constructor() {
}
fun pauseAllPlaybacks() {
listeners.keys.forEach { key ->
pausePlayback(key)
}
}
fun makeAllPlaybacksIdle() {
listeners.keys.forEach { key ->
setState(key, Listener.State.Idle)
}
listeners.keys.forEach(::pausePlayback)
}
/**