Skip to content

Commit

Permalink
Merge pull request #12 from SimonSchubert/patch-1
Browse files Browse the repository at this point in the history
Fix player release
  • Loading branch information
kkostov authored Dec 24, 2024
2 parents 953150a + de818cc commit 18dcebc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gadulka/src/wasmJsMain/kotlin/GadulkaAudioPlayer.wasmJs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ actual class GadulkaPlayer(val htmlId: String) {
actual fun release() {
val playerEl = getPlayerElement()
playerEl?.pause()
playerEl?.remove()
}

private fun getPlayerElement(): HTMLAudioElement? {
return document.getElementById(htmlId) as? HTMLAudioElement
}

}
}

0 comments on commit 18dcebc

Please sign in to comment.