Fixed not direct playing

This commit is contained in:
Alex Kim
2024-11-19 13:35:33 +11:00
parent f127ee2976
commit 1aed133a67
3 changed files with 13 additions and 3 deletions

View File

@@ -148,10 +148,17 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
mediaPlayer?.addSlave(IMedia.Slave.Type.Subtitle, Uri.parse(subtitleURL), true)
}
// Kotlin has its own garbage collector.
override fun onDetachedFromWindow() {
println("onDetachedFromWindow")
super.onDetachedFromWindow()
mediaPlayer?.stop()
media?.release()
mediaPlayer?.release()
libVLC?.release()
mediaPlayer = null
media = null
libVLC = null
}
override fun onEvent(event: MediaPlayer.Event) {