Closed lakrsv closed 3 years ago
I can't remember having this issue back when I tested a looping video on android. It is probably something device specific. It means that probably the completion callback on the android mediaplayer is arriving too late. I will see if I can reproduce it.
For your information, the pad in question is the Xiaomi Mi Pad 2
Can also reproduce the flicker on NVidia Shield
Here's a workaround: If you disable screen clearing the issue is still there in practice, but not visible anymore. The issue with this is that the moment you'd like to do something like fade the screen in / out and you do it when the video loops, you will still have a flicker.
//Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
if (videoPlayer != null) {
if (!videoPlayer.render()) {
try {
videoPlayer.play(movieFile);
} catch (FileNotFoundException e) {
videoPlayer = null;
Gdx.app.log("EXCEPTION", "Could not loop video", e);
}
}
}
The limitation simply means nothing else can happen on the screen while you're playing the video.
Could you try if the issue persists with the newest snapshot?
I've added a setLooping
method to let the own media player of android loop the video. So the issue shouldn't persist anymore
I have a loopable video that I am looping by doing this in the render loop (Android):
Whenever the video is done playing, it will flicker once to black before it resumes playing. Currently I remove the glClear to make it less visible, but this is not really an approach I'd like to keep in the future.
Anyone have any suggestions or is this a limitation in the android mediaplayer?