Kaynağa Gözat

Fix: remove audio from media player when audio end to stop cycle

Shan-PC\Shan 6 yıl önce
ebeveyn
işleme
6f298dde84

+ 3 - 0
src/main/java/com/bomostory/sceneeditmodule/utils/MusicPlayer.kt

@@ -38,6 +38,9 @@ class MusicPlayer {
                 setOnPreparedListener {
                     it.start()
                 }
+                setOnCompletionListener {
+                    mediaPlayers.remove(it)
+                }
             }
             mediaPlayers.add(mediaPlayer)
         }