ExoPlayer, Loop Ended / Started LoopingMediaSource listener
I am using ExoPlayer to play a video in a loop, but before the original video is triggered in each loop, I need to reset some states of my layout. I know that ExoPlayer calls onPlayerStateChanged with ExoPlayer.STATE_ENDED when video ends for normal MediaSources, but it is not called for LoopingMediaSource.
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
if (playbackState == ExoPlayer.STATE_ENDED) {
showControls();
resetLayoutStates(); //I need it here, even in LoopingMediaSource
}
updateButtonVisibilities();
}
Does Exoplayer have a callback when the source is reloaded or terminated in a loop? Or does he have some workaround for my situation?
+3
source to share