package com.jld.vod.view.widget

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import cn.jzvd.JZUtils
import cn.jzvd.JzvdStd
import com.jld.vod.R

/**
 * @author ZhaoFuXin
 * @Email：18276061387@163.com
 * @description:
 * @date :2020/7/13 17:31
 */

class MyJzvdStd(context: Context?, attrs: AttributeSet?) : JzvdStd(context, attrs) {
    var iv_back_page:ImageView?=null
    var iv_home:ImageView?=null
    var iv_brightness:ImageView?=null
    var iv_volume:ImageView?=null
    var iv_power:ImageView?=null
    var fl_bg: FrameLayout?=null
    var iv_fl_power:ImageView?=null

    override fun onCompletion() {
        super.onCompletion()
        //此代码用于解决重播时会强制横屏
        JZUtils.setRequestedOrientation(context, FULLSCREEN_ORIENTATION);
    }

    override fun init(contexts: Context?) {
        super.init(contexts)

        val fullimg = findViewById<ImageView>(R.id.fullscreen)
        val back = findViewById<ImageView>(R.id.back)
        iv_back_page = findViewById<ImageView>(R.id.iv_back_page)
        iv_home = findViewById<ImageView>(R.id.iv_home)
        iv_brightness = findViewById<ImageView>(R.id.iv_brightness)
        iv_volume = findViewById<ImageView>(R.id.iv_volume)
        iv_power = findViewById<ImageView>(R.id.iv_power)
        fl_bg = findViewById<FrameLayout>(R.id.fl_bg)
        iv_fl_power = findViewById<ImageView>(R.id.iv_fl_power)

        fullimg.visibility = View.GONE
        back.left = 100
    }
    override fun getLayoutId(): Int {
        return R.layout.jz_layout_std;
    }

}