androidMain.tech.skot.libraries.video.SKVideoView.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of viewlegacy Show documentation
Show all versions of viewlegacy Show documentation
viewlegacy module for SK-Video skot library
package tech.skot.libraries.video
import androidx.fragment.app.Fragment
import androidx.lifecycle.*
import com.google.android.exoplayer2.ExoPlayer
import com.google.android.exoplayer2.ui.PlayerView
import tech.skot.core.components.SKActivity
import tech.skot.core.components.SKComponentView
class SKVideoView(
override val proxy:SKVideoViewProxy,
activity: SKActivity,
fragment: Fragment?,
binding: PlayerView,
player: ExoPlayer
) : SKComponentView(proxy, activity, fragment, binding) {
init {
binding.player = player
lifecycleOwner.lifecycle.addObserver(object:DefaultLifecycleObserver {
override fun onDestroy(owner: LifecycleOwner) {
super.onDestroy(owner)
proxy.player?.release()
proxy.player = null
binding.player = null
}
})
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy