Misc tweaks to UI components

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161454491
This commit is contained in:
olly 2017-07-10 16:00:12 -07:00 committed by Oliver Woodman
parent 45f94eab62
commit b31fd5bc7c
2 changed files with 10 additions and 3 deletions

View File

@ -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) {

View File

@ -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);