Skip to content

Commit

Permalink
fix(android): onComplete is not called when audio has completed pla…
Browse files Browse the repository at this point in the history
…ying (#1523)

Closes #1522 

Co-authored-by: Gustl22 <git@reb0.org>
  • Loading branch information
fzyzcjy and Gustl22 committed May 29, 2023
1 parent 1fa46c2 commit 293d6c0
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -56,6 +56,7 @@ class AudioplayersPlugin : FlutterPlugin, IUpdateCallback {

override fun onDetachedFromEngine(binding: FlutterPluginBinding) {
stopUpdates()
handler.removeCallbacksAndMessages(null)
updateRunnable = null
players.values.forEach { it.dispose() }
players.clear()
Expand Down Expand Up @@ -274,7 +275,7 @@ class AudioplayersPlugin : FlutterPlugin, IUpdateCallback {
}

override fun stopUpdates() {
handler.removeCallbacksAndMessages(null)
updateRunnable?.let { handler.removeCallbacks(it) }
}

private class UpdateRunnable(
Expand Down

0 comments on commit 293d6c0

Please sign in to comment.