Skip to content

Commit

Permalink
Adding back/forward controls for videos
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Nov 26, 2018
1 parent 7570adc commit 3bb3f6b
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ public void onClick(View view) {
}
}), buttons);

addButton(createButton(
context,
mControlView,
R.drawable.exo_controls_rewind,
new OnClickListener() {
@Override
public void onClick(View view) {
mVideoPlayer.seekTo(mVideoPlayer.getCurrentPosition() - 3000);
updateProgress();
}
}), buttons);

final AtomicReference<ImageButton> playButton = new AtomicReference<>();

playButton.set(createButton(
Expand All @@ -157,6 +169,18 @@ public void onClick(View view) {

addButton(playButton.get(), buttons);

addButton(createButton(
context,
mControlView,
R.drawable.exo_controls_fastforward,
new OnClickListener() {
@Override
public void onClick(View view) {
mVideoPlayer.seekTo(mVideoPlayer.getCurrentPosition() + 3000);
updateProgress();
}
}), buttons);

mTimeBarView = new DefaultTimeBar(context, null);
controlBar.addView(mTimeBarView);

Expand Down

0 comments on commit 3bb3f6b

Please sign in to comment.