Seamless video Loop with VideoView

前端 未结 8 1997
春和景丽
春和景丽 2021-01-30 12:03

I have the following code to take a video as a raw resource, start the video and loop it but I need the video to loop seamlessly as of now when it comes to an end of the clip an

8条回答
  •  感情败类
    2021-01-30 12:53

    Try this it will work 100%


    VideoView videoView;<---write this in outside of method or else declare it as final variable.

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

提交回复
热议问题