0

I am developing one android application in which I am able to play all the videos and Images in SD card.But I am getting the blank screen for 2 or 3 seconds while displaying video after image. I don't want that blank screen, I need to show the video immediately after image. Can anyone tell how to do that?

Thomas
  • 43,637
  • 12
  • 109
  • 140
joe
  • 221
  • 2
  • 5
  • 13

2 Answers2

0

This seems to happen when you're loading image and video and try to navigate away from image to video before the image.This problem occur when image size and video size is large.so check image and video size.otherwise give permission in android manifest
android:largeHeap="true"

Dharmendra
  • 571
  • 5
  • 12
0

Try playing video inside onPrepared(), first of all just initialize the VideoView with its path or URI of the video and then play it,

    mVideoView.setVideoURI(Uri.parse(path));
    mVideoView.setOnPreparedListener(new OnPreparedListener() {

        @Override
        public void onPrepared(MediaPlayer mp) {
            mVideoView.start();
        }
    });
Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242