0

I am created an Android app thta needs to have a fullscreen seemless video loop playing in the background. By 'in the background' I mean that there will be buttons on top of the video.

I've read these threadw already playback video full screen Integrating video file in android app as app background

but I'm still confused about the following

1 Is the mediaplayer needed for video playback?

2 Will using OnCompletionListener create a 'seamless' loop or will there be a 'hiccup' as the video loops?

Community
  • 1
  • 1
Bachalo
  • 6,965
  • 27
  • 95
  • 189
  • I just tested an app with no MediaPlayer. It works fine. OnCompletionListener will work. Could you use a Timer? – a person Feb 03 '14 at 22:53

1 Answers1

0

Use the setOnPreparedListener to tell the MediaPlayer to loop and start

videoview.setOnPreparedListener(new OnPreparedListener()
        {
            @Override
            public void onPrepared(MediaPlayer mp) {
                mp.setLooping(true);
                mp.start();

            }
        });

This is seemless on some devices, but can cause a frame or two of stutter on others :/

lex
  • 174
  • 1
  • 9