Does Android support scaling Video?

VideoView (or the SurfaceView for use with MediaPlayer ) will be the size you tell it to be in your layout Within that space the video will play back as large as possible while maintaining the aspect ratio.

By Default the video view resizes itself to fit the encoded resolution of the Video. VideoView (or the SurfaceView for use with MediaPlayer) will be the size you tell it to be in your layout. Within that space, the video will play back as large as possible while maintaining the aspect ratio.

Can I force Android to render a video into a smaller or larger rect? Yes: make your VideoView be the size you want, and Android will scale to fit the size of the VideoView.

– haseman Jan 15 '10 at 0:41 That I don't, sorry. – CommonsWare Jan 15 '10 at 1:24 1 I should add that not all platforms actually do this correctly. For Example, the Droid Eris seems to scale the video up to it's native resolution, expanding the video view as it goes.

Platform fragmentation ahoy! – haseman Jan 21 '10 at 18:57 I've found, further, that I can break the aspect ratio on the video view. I just have to wait for the video to start, once the Video View re-sizes itself I can then go in and muck with the view size using a layout.

At that point, I can give it any size and it will stretch to the desired height/width. – haseman Mar 3 '10 at 21:06 1 @haseman: I found that also the HTC Desire with 2.1 doesn't scale the video (at least with the current code I'm using) which works well though on all other devices like Nexus One, Samsung Galaxy S, etc.- both also running on 2.1. – Mathias Lin Jul 7 '10 at 0:46.

(I know it's very old question, but there is another way to control dimensions, which isn't described here, maybe someone will find it helpful. ) Declare your own MyVideoView class in your layout and write your own onMeasure() method. Here is how to run video stretched to original View's dimensions: public class MyVideoView extends VideoView { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = getDefaultSize(0, widthMeasureSpec); int height = getDefaultSize(0, heightMeasureSpec); setMeasuredDimension(width, height); } }.

I am also trying to achieve that and so far this has worked ok. The idea is to use the setLayoutParams for the video view and specify the size. It is just a simple fragment but it gives the idea.

Check the LayoutParams lines. VideoView mVideoView = new VideoView(this); //intermediate code mVideoView. SetVideoPath("/sdcard/VIDEO0007.3gp"); MediaController mController = new MediaController(this); mVideoView.

SetMediaController(mController); mController. SetOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { int width = mVideoView. GetMeasuredWidth(); int height = mVideoView.

GetMeasuredHeight(); //we add 10 pixels to the current size of the video view every time you touch //the media controller. LayoutParams params = new LinearLayout. LayoutParams(width+10, height+10); mVideoView.

SetLayoutParams(params); return true; } }); mVideoView.requestFocus(); mVideoView.start().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions