Open AndroidDeveloperLB opened 5 years ago
Using a TextureView
was definitely an improvement from the SurfaceView
, the black blink was shorter. But I ended up doing just like you, adding a 100 ms delayed Handler to hide the placeholder.
It was acceptable for our use case, but yeah the issue still exists.
Do you have perhaps a POC that reproduces the issue, even after all the recommendation of them? I want to raise it again, and tell them to fix it... I've failed to reproduce it for some reason, but maybe it's because the POC isn't similar enough to what we do on the real app... I hate to see a workaround of a handler, let alone with a time in it...
Just tried this repo, and yeah it seems like having 2 different Activities makes it work.
It happens on our production app when we're adding/replacing Fragments though(which seems to be your case too). The first time the ExoPlayer is shown it will not blink, but any other time it will. I can't update this repo with our production code easily though. I'll update this issue when I'll get some time.
Wow thank you.
In our case, the app has BottomNavigationView, that when you switch between the pages there, in one of them there is a ViewPager with one of its inner fragments with the player. I just wrote "I am switching between fragments" because I didn't want to confuse you and give too much useless information... I'm sure it doesn't have to be this complex for a POC to reproduce it, but the basic thing I tried on POC wasn't enough.
I've read this: https://github.com/google/ExoPlayer/issues/3870
I'm having a similar issue for some reason, which I couldn't reproduce on POC.
I am switching between fragments, and one of them has the PlayerView which should play right away, but it has a point that it shows a black content. I tried to use what's written on this post, along with having an ImageView that shows the first frame (image and video files are built into the app) which gets hidden when the
onPlayerStateChanged
is called withSTATE_READY
.Still, when switching from/to the fragment that has the PlayerView, it has black/white glitches...
The only workaround I got is to use a Handler, as such:
Together with this in the layout file (the ImageView is on top of the PlayerView, entirely) :
I was wondering: Did you solve this issue somehow?