Brian
Brian

Reputation: 819

Android VideoView Landscape Orientation Problem

I am pretty new to Android and mobile development in general. I am creating an Android application that plays a video using VideoView after a button is selected. The problem is when you rotate the phone the video restarts. I know its because the activity is destroyed and recreated when it is rotated. So I just locked the video player in landscape view. But by default you have to tilt the phone to the left (right side up) to be able to see it correctly. The other way just shows the video upside down.

Is there a way to show the video correctly if the user tilts the phone to the right (left side up)? Thanks for any input.

Upvotes: 1

Views: 3061

Answers (2)

user3306133
user3306133

Reputation: 41

Add android:configChanges="orientation|screenSize" to your activity in the Android Manifest.

Upvotes: 1

Emile
Emile

Reputation: 11721

http://t3ch.com/blog/android_transitions/

shows how to restart video instance from where you left off when rotation occurs.

Upvotes: 0

Related Questions