Skip to content

Instantly share code, notes, and snippets.

@raultm
Created September 16, 2012 17:03
Show Gist options
  • Select an option

  • Save raultm/3733246 to your computer and use it in GitHub Desktop.

Select an option

Save raultm/3733246 to your computer and use it in GitHub Desktop.
Android : How to stretch video to use whole area of VideoView (sode snippets)
package mobi.kinetica.vegenat.catalogo.utils;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;
public class StretchVideoView extends VideoView {
public StretchVideoView(Context context) {
super(context);
}
public StretchVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public StretchVideoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(widthMeasureSpec, heightMeasureSpec);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment