I want to play videos using VideoView in Android fullscreen mode.
When I am playing in portrait mode, the video is occupying only 1/4 of the screen. When I am playing the video in landscape mode , the video is occupying about 3/4th of the screen.
My question is how can I disable the automatic scaling of the video when using the VideoView.
Also, I created a class extending VideoView & then overridden the onMeasure() .
But how can I use the class in another class which开发者_运维知识库 extends Activity.
I have searched a lot on Internet & unable to get a proper code.
Apply the following layout format over the xml containing the videoview it will for sure will play the video in full screen mode. as it is running mine :) Hope it helps
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<VideoView android:id="@+id/myvideoview"
android:layout_width="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_height="fill_parent">
</VideoView>
</RelativeLayout>
My application force closes when I added the following lines:
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
It was already showing warning with each of the above lines
精彩评论