package com.develop.food.base.widgets

import android.content.Context
import android.media.MediaPlayer
import android.util.AttributeSet
import android.view.View.getDefaultSize

import android.widget.VideoView


class FullScreenVideoView : VideoView {
    constructor(context: Context?) : super(context) {}
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {}
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ) {
    }

    // 实现全屏,重新计算高度和宽度
    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val width = getDefaultSize(0, widthMeasureSpec)
        val height = getDefaultSize(0, heightMeasureSpec)
        setMeasuredDimension(width, height)

    }
}
