Example usage for android.widget VideoView setMinimumWidth

List of usage examples for android.widget VideoView setMinimumWidth

Introduction

In this page you can find the example usage for android.widget VideoView setMinimumWidth.

Prototype

public void setMinimumWidth(int minWidth) 

Source Link

Document

Sets the minimum width of the view.

Usage

From source file:com.ternup.caddisfly.activity.VideoActivity.java

private void playVideo(File videoFile) {
    DisplayMetrics dm = new DisplayMetrics();
    this.getWindowManager().getDefaultDisplay().getMetrics(dm);
    int height = dm.heightPixels;
    int width = dm.widthPixels;

    final VideoView videoHolder = (VideoView) this.findViewById(R.id.video_player_view);
    videoHolder.setMinimumWidth(width);
    videoHolder.setMinimumHeight(height);

    //getWindow().setFormat(PixelFormat.TRANSLUCENT);
    videoHolder.setMediaController(new MediaController(this));
    videoHolder.setVideoPath(videoFile.getAbsolutePath());
    videoHolder.requestFocus();//from  w  w  w.ja  va 2s  . c o  m
    videoHolder.start();

}