package com.yidianling.home.widget

import android.content.Context
import android.util.AttributeSet
import android.widget.VideoView

class AdaptiveVideoView:VideoView {

    constructor(context: Context):this(context,null)

    constructor(context: Context,attributeSet: AttributeSet?):this(context,attributeSet,0)

    constructor(context: Context,attributeSet: AttributeSet?,defStyle:Int):super(context,attributeSet,defStyle){

    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val width = getDefaultSize(0,widthMeasureSpec)
        val height = getDefaultSize(0,heightMeasureSpec)
        setMeasuredDimension(width,height)
    }

}