tags:

views:

926

answers:

3

Using a VideoView is it possible to set a scale factor for Android? By Default the video view resizes itself to fit the encoded resolution of the Video. Can I force Android to render a video into a smaller or larger rect?

A: 

As far as I know, and for now, only Windows Mobile with : TCPMP

But since is open-source you can always recode it for Android.

gafda
A: 

For mode information on TCPMP the link to the TCPMP is:

http://picard.exceed.hu/tcpmp/test/

gafda
+3  A: 

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.

CommonsWare
Brilliant, do you know of a way to break the aspect ratio?
haseman
That I don't, sorry.
CommonsWare
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
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
@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