瀏覽代碼

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>
Marcel Hibbe 3 年之前
父節點
當前提交
c7bb6402fe
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

+ 2 - 2
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -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
     }