I'm using exoplayer in my project, when switching mediasource i just use
player.stop();
player.prepare(mediaSource);
This causes approx. 0.5 seconds black screen until it switches video.
Is there a way to tell exoplayer to retain last frame from previous video (instead of 0.5 sec black screen) until new video is started?
simpleExoPlayerView.setShutterBackgroundColor(Color.TRANSPARENT);
Exoplayer's developers have provided solution to this issue here.
Simply add this line using your SimplePlayerView instance
playerView.setKeepContentOnPlayerReset(true);
Alternatively, you can also do this via your layout.xml file,
app:keep_content_on_player_reset="true"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With