I have an activity that show half of the screen facing user and the other half facing another guy in opposite direction. The portion facing another guy has a video view. Like this:
In my activity layout, I have:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollViewTop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1"
android:scrollbars="none"
android:rotation="180.0" >
......
<VideoView
android:id="@+id/videoView1"
android:layout_width="75dp"
android:layout_height="75dp" />
......
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
I use following code to set the video view: (videofile.mp4)
videoView1 = (VideoView) findViewById(R.id.videoView1);
Uri video = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.videofile);
videoView1.setVideoURI(video);
videoView1.start();
It show a black screen without the video playing. Other content is showing correctly in 180 degree rotation except the video playback.
However, if I remove the line android:rotation="180.0" the video is playing correctly.
Is there a way to play the video while the screen is rotated?