views:

522

answers:

4

I am having a VideoView playing video on my Android app. When I try it on the potrait orientation, the video fills the screen. But when I change the orientation to landscape, the video takes up only half the screen space. I am using FILL_PARENT, FILL_PARENT as the layout params.

Is there a way I can have the video fill the screen in both orientations?

Thanks Chris

A: 

Your video might be just too small. You can center it in parent to make it look better. Or try to request bigger video from your provider.

Alex Volovoy
+2  A: 

If it fills the screen perfectly in portrait mode how will it ever fit perfectly in landscape mode without changing the aspect ratio?

The same goes for the reverse - if it fits perfectly in landscape mode, when you change to portrait it won't take up all the vertical space.

Brandon
A: 

I'm facing the same issue as he does. Only difference is that the video has the proper ratio to fit landscape, when in landscape the videoview rescales the video to 1:1. I did put some background color to see how the videoview behaved, and before the videoview reaches OnPrepareListener, the videoview is full screen but changes size when the video comes into play.

Any suggestions?

Hwa Rang
A: 

Hey Chris,

You might consider making two different layouts for portrait and landscape views. Let's assume you have "/res/layout/main.xml" file. In the "/res/" folder make a child folder and name it "layout-land", the R file is going to be automatically generated! Here is a snapshot just to make it easier...

alt text

after you can edit each layout independently... This is the most common way of working with orientation change, when it comes to layouts.

Best regards,

Igor

Igor