Open mahesha2 opened 5 years ago
@mahesha2 If your Video is from the Internet, it requires some time to load and prepare. How long does the black screen appear?
4 to 5 seconds and how to play video more fast.
I have the same problem. I am covering it up with a thumbnail thought but still the black screen is quite noticeable. Happens right before video starts playing. I am caching videos beforehand so the black screen is not displayed for 3 - 4 seconds but for a shorter duration
Hey hey hey!
I just fixed the issue. But still I wonder why the library's play method caused this issue for me in the first place.
@mahesha2 .. You can try to solve this problem just the way I did, see the code snippet. @eneim .. you can dig into this whenever you have some time :)
amazing library by the way, saved me a lot of time. Would really like to contribute too.
In PlayerView You can do something like this, though there will be a shutter.
app:shutter_background_color="@android:color/transparent"
private final Playable.EventListener listener = new Playable.DefaultEventListener() { @Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { super.onPlayerStateChanged(playWhenReady, playbackState); Log.d("faisal",format(Locale.getDefault(), "STATE: %d・PWR: %s", playbackState, playWhenReady)); if (playbackState==3) { readyToPlay(playWhenReady); } //state.setText(format(Locale.getDefault(), "STATE: %d・PWR: %s", playbackState, playWhenReady)); } }; private void readyToPlay(boolean isReady){ Log.d("faisal","video is play"); videoCover.setVisibility(isReady?View.GONE:View.VISIBLE); progressBar.setVisibility(isReady?View.GONE:View.VISIBLE); }
Any budy fixed black screen issue before playing video?? please help