Commit b31fd5bc by olly Committed by Oliver Woodman

Misc tweaks to UI components

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161454491
parent 45f94eab
......@@ -888,7 +888,12 @@ public class PlaybackControlView extends FrameLayout {
if (fastForwardMs <= 0) {
return;
}
seekTo(Math.min(player.getCurrentPosition() + fastForwardMs, player.getDuration()));
long durationMs = player.getDuration();
long seekPositionMs = player.getCurrentPosition() + fastForwardMs;
if (durationMs != C.TIME_UNSET) {
seekPositionMs = Math.min(seekPositionMs, durationMs);
}
seekTo(seekPositionMs);
}
private void seekTo(long positionMs) {
......
......@@ -615,7 +615,8 @@ public final class SimpleExoPlayerView extends FrameLayout {
/**
* Sets the rewind increment in milliseconds.
*
* @param rewindMs The rewind increment in milliseconds.
* @param rewindMs The rewind increment in milliseconds. A non-positive value will cause the
* rewind button to be disabled.
*/
public void setRewindIncrementMs(int rewindMs) {
Assertions.checkState(controller != null);
......@@ -625,7 +626,8 @@ public final class SimpleExoPlayerView extends FrameLayout {
/**
* Sets the fast forward increment in milliseconds.
*
* @param fastForwardMs The fast forward increment in milliseconds.
* @param fastForwardMs The fast forward increment in milliseconds. A non-positive value will
* cause the fast forward button to be disabled.
*/
public void setFastForwardIncrementMs(int fastForwardMs) {
Assertions.checkState(controller != null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment