stop mediaPlayer in onDestroy

a voice message now continues to play if app goes to background, but whenever the user returns he can pause or stop the playback (UI is updated).
Also, the playback survives a screen orientation change.

instead stopping the mediaPlayer in onDetach would stop playback when moving app to background but also stop the playback on a screen orientation change.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-06-29 21:45:46 +02:00
parent 6be66fdcff
commit c7bb6402fe
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -1436,8 +1436,6 @@ class ChatController(args: Bundle) :
if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {
mentionAutocomplete?.dismissPopup()
}
currentlyPlayedVoiceMessage?.let { stopMediaPlayer(it) }
}
override val title: String
@ -1459,6 +1457,8 @@ class ChatController(args: Bundle) :
actionBar?.setIcon(null)
}
currentlyPlayedVoiceMessage?.let { stopMediaPlayer(it) }
adapter = null
inConversation = false
}