How can I remove mini pauses between 2 videos when using Video View?
There is a video, it consists of 3 pieces that are played alternately, but between them there is 1-1.5 seconds of freeze, and it is necessary that the video be played seamlessly without these pauses.
1 answer
You must perform pre-training video files. To do this, you can use the MediaPlayer class and the MediaPlayer # prepareAsync method . Using MediaPlayer.OnPreparedListener you can find out when the file has finished loading and can be used.
Those. Before playing a video, you create 3 objects (one for each video file), install the listener on OnPreparedListener , install another listener on OnCompletionListener (to change the files being played) and start playing the video series.
The last step with OnCompletionListener can be superfluous if you can use API 16 and higher to use the following method . In this case, the system itself will switch between files after they are completed.