I am working on ExoPlayer, I want to customize the ExoPlayer and listen for the Event next, previous, rewind, forward so that when the user clicks the next button next video
My approach
Assumed, we are already create collection of media source, DASH or HLS.
And using player view with SimpleExoPlayerView
component. It will automatically have default control, prev, next, for example.
I handle collection of media source with current window index with this exoPlayer.getCurrentWindowIndex()
to back and forth media source.
And you can check current index via this onTracksChanged
method
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
currentIndex = exoPlayer.getCurrentWindowIndex();
}
You can look this file for implementation these control.
Hope this help.