Question

My app plays a video using VideoView. I am using a LinearLayout to add some text, the video and then some buttons.

My question is what kind of layout params can I use for the VideoView to make sure it plays well in all phones? Basically, when in portrait mode, I want the complete width to be used, and video height to be used. When in landscape, I would like it to look more like the full screen mode.

I have noticed that this setting works well on myTouch for both portrait and landscape,

new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT,480);

and, this works on Droid for both portrait and landscape,

new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);

Thanks Chris

Was it helpful?

Solution

My question is what kind of layout params can I use for the VideoView to make sure it plays well in all phones?

Have it fill all available space. VideoView will scale the video to take advantage of whatever room you give it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top