Android Open Source - AdvancedPlayer Full Screen Video View






From Project

Back to project page AdvancedPlayer.

License

The source code is released under:

Apache License

If you think the Android project AdvancedPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.huilan.library_videoplay.view;
//from www. java2s. c  o m
import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;

/**
 * ????VideoView
 *
 * @author liujigang
 */
public class FullScreenVideoView extends VideoView {
    private int mVideoWidth;
    private int mVideoHeight;

    public FullScreenVideoView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public FullScreenVideoView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public FullScreenVideoView(Context context) {
        super(context);
    }

    public int getmVideoWidth() {
        return getWidth();
    }

    public void setmVideoWidth(int mVideoWidth) {
        this.mVideoWidth = mVideoWidth;
    }

    public int getmVideoHeight() {
        return getHeight();
    }

    public void setmVideoHeight(int mVideoHeight) {
        this.mVideoHeight = mVideoHeight;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int width = getDefaultSize(mVideoWidth, widthMeasureSpec);
        int height = getDefaultSize(mVideoHeight, heightMeasureSpec);
        if (mVideoHeight * mVideoWidth > 0) {
            int i = mVideoWidth * height;
            int j = width * mVideoHeight;
            if (i < j) {
                width = i / mVideoHeight;
            } else if (i > j) {
                height = j / mVideoWidth;
            }
        }
        setMeasuredDimension(width, height);
    }

}




Java Source Code List

com.huilan.library_videoplay.AdvancedPlayerSimple.java
com.huilan.library_videoplay.AdvancedPlayer.java
com.huilan.library_videoplay.VideoViewPlay.java
com.huilan.library_videoplay.sample.LightnessController.java
com.huilan.library_videoplay.sample.MainActivity.java
com.huilan.library_videoplay.sample.TextActivity.java
com.huilan.library_videoplay.util.LightnessController.java
com.huilan.library_videoplay.util.ParseHtmlToUrl.java
com.huilan.library_videoplay.util.ViewController.java
com.huilan.library_videoplay.view.FullScreenVideoView.java
com.huilan.library_videoplay.view.SuperVideoView.java