'ExoPlayer seekbar on arrow keys
How to handle arrow keys with ExoPlayer for forward\rewind ?
I want to handle arrow keys on seekbar
I know how handle controls buttons, but I dont understand how to handle seekbar Help me please ExoPlayerExample
public class VideoPlayerGlue extends PlaybackTransportControlGlue<PlayerAdapter> {
private static final long TEN_SECONDS = TimeUnit.SECONDS.toMillis(10);
public VideoPlayerGlue(
Context context,
PlayerAdapter playerAdapter,
OnActionClickedListener actionListener) {
super(context, playerAdapter);
mActionListener = actionListener;
mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(context);
mSkipNextAction = new PlaybackControlsRow.SkipNextAction(context);
mFastForwardAction = new PlaybackControlsRow.FastForwardAction(context);
mRewindAction = new PlaybackControlsRow.RewindAction(context);
}
@Override
public void onActionClicked(Action action) {
if (shouldDispatchAction(action)) {
if(action == mFastForwardAction) {
getPlayerAdapter().seekTo(getPlayerAdapter().getCurrentPosition() + 60000);
}
if(action == mRewindAction) {
getPlayerAdapter().seekTo(getPlayerAdapter().getCurrentPosition() - 60000);
}
return;
}
super.onActionClicked(action);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
