0

My activity plays four back to back videos and i want it to play in full screen mode.But it covers only3/4th or half screen .How to make it full screen?I have kept videoview and layout "fill _parent" in xml still it doesn't show video in full screen...If i remove frame layout video plays in full screen only but frame layout is required for my project to avoid initial black screen in videoview.i have taken help of this link Android VideoView black screen

xml

    <FrameLayout
        android:id="@+id/frameLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

         >

    <VideoView
    android:id="@+id/intro_video_loop_view"
    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"



    />

        <FrameLayout
            android:id="@+id/placeholder"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:background="@color/white">
        </FrameLayout>
    </FrameLayout>



    <ImageView
        android:id="@+id/signInWithFacebook"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:adjustViewBounds="true"
        android:background="@null"
        android:src="@drawable/fb_login_selector"
        android:visibility="visible"
        android:layout_above="@+id/signInWithGooglePlus"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <ImageView
        android:id="@+id/signInWithGooglePlus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:background="@null"
        android:src="@drawable/gp_login_selector"
        android:layout_above="@+id/muteAudio"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginBottom="5dp" />

    <ImageButton
        android:id="@+id/muteAudio"
        android:layout_width="36dp"
        android:layout_height="36dp"
        android:layout_margin="5dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:background="@null"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        android:src="@drawable/unmute_audio"
        android:visibility="visible"/>

    <ImageView
        android:id="@+id/video_message_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:src="@drawable/guggu_text"
        android:gravity="center_horizontal"

        />

    <ProgressBar
        style="?android:attr/progressBarStyleLargeInverse"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/progressBarGooglePlus"
        android:visibility="invisible"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true" />

</RelativeLayout>

code

   public void playVideo() {
final int a[]={R.raw.intro_video_full,R.raw.two,R.raw.newv,R.raw.four};
        final VideoView lIntroVideo = (VideoView) findViewById(R.id.intro_video_loop_view);


      lIntroVideo.setVideoPath("android.resource://" + getPackageName() + "/" + R.raw.intro_video_full);

        lIntroVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer aMediaPlayer) {
                View placeholder = (View) findViewById(R.id.placeholder);

                placeholder.setVisibility(View.GONE);
                lIntroVideo.start();
                lIntroVideo.requestFocus();

               try {


                    if (isAudioMuted) {
                        aMediaPlayer.setVolume(0f, 0f);
                    } else {
                        aMediaPlayer.setVolume(0f, 0.5f);
                    }


                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });




        lIntroVideo.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
        {
            @Override
            public void onCompletion(MediaPlayer mp)
            {  if(i%4==0)
            {
                lIntroVideo.setVideoPath("android.resource://" + getPackageName() + "/" + a[2]);
                i++;}
                else  if(i%4==1)
            {
                lIntroVideo.setVideoPath("android.resource://" + getPackageName() + "/" + a[3]);
                i++;}
            else  if(i%4==2)
            {
                lIntroVideo.setVideoPath("android.resource://" + getPackageName() + "/" + a[1]);
                i++;}
            else  if(i%4==3)
            {
                lIntroVideo.setVideoPath("android.resource://" + getPackageName() + "/" + a[0]);
                i++;}

                lIntroVideo.start();

            }
        });

    }

manifest

<activity android:name=".IntroVideoActivity_"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:configChanges="orientation|screenSize">
Community
  • 1
  • 1

1 Answers1

0

try this android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen"

Palak
  • 2,165
  • 2
  • 21
  • 31