You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using exoplayer 2.12 and when i reach the last video in the timeline and player.repeatMode = Player.REPEAT_MODE_ONE then Next button is not clickable . What i want is to make some action at that point of time to make next button clickable.
The text was updated successfully, but these errors were encountered:
It's working as intended that the next button is not clickable when using REPEAT_MODE_ONE and positioned on the last video in the timeline. You will likely need to implement your own UI components instead if you want different behavior (you're obviously able to fork the ones provided by the ExoPlayer UI module as a starting point).
Actually, if you were to use ExoPlayer 2.16 or newer, you'd be able to achieve this using ForwardingPlayer:
// Wrap your player in a ForwardingPlayer
Player customPlayer = new ForwardingPlayer(player) {
// Overrides to always enable COMMAND_SEEK_TO_NEXT
@Override
public Commands getAvailableCommands() {
return getWrappedPlayer()
.getAvailableCommands()
.buildUpon()
.add(COMMAND_SEEK_TO_NEXT)
.build();
}
@Override
public boolean isCommandAvailable(@Command int command) {
return player.isCommandAvailable(command) || command == COMMAND_SEEK_TO_NEXT;
}
// Override to implement your custom action when seeking.
@Override
public void seekToNext() {
if (getWrappedPlayer().hasNextMediaItem()) {
// Dispatch to the wrapped player if not at the final media item
getWrappedPlayer().seekToNextMediaItem();
} else {
// TODO: Implement your custom action here.
}
}
};
// Provide the ForwardingPlayer to the UI components
playerView.setPlayer(customPlayer);
I am using exoplayer 2.12 and when i reach the last video in the timeline and player.repeatMode = Player.REPEAT_MODE_ONE then Next button is not clickable . What i want is to make some action at that point of time to make next button clickable.
The text was updated successfully, but these errors were encountered: