package com.orange.widget.ui

import androidx.databinding.ViewDataBinding
import com.orange.origin.origin.BaseAgentActivity
import com.orange.origin.origin.BaseViewModel
import xyz.doikki.videoplayer.player.VideoView

abstract class IVideoActivity<VM: BaseViewModel,DB: ViewDataBinding> : BaseAgentActivity<VM,DB>(){
    abstract var videoView:VideoView

    override fun onStart() {
        super.onStart()

    }

    override fun onResume() {
        super.onResume()
        videoView.resume()
    }

    override fun onPause() {
        super.onPause()
        videoView.pause()
    }

    override fun onDestroy() {
        super.onDestroy()
        videoView.release()
    }

    override fun onBackPressed() {
        if(!videoView.onBackPressed()){
            super.onBackPressed()
        }
    }

}