Change return type of getMaxSeekToPreviousPosition() to long

This matches the type of all position related APIs.

PiperOrigin-RevId: 390558523
This commit is contained in:
jaewan 2021-08-13 09:08:33 +01:00 committed by Oliver Woodman
parent 24b0cf8c30
commit 149958fb07
9 changed files with 13 additions and 13 deletions

View file

@ -459,7 +459,7 @@ public final class CastPlayer extends BasePlayer {
} }
@Override @Override
public int getMaxSeekToPreviousPosition() { public long getMaxSeekToPreviousPosition() {
return C.DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS; return C.DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS;
} }

View file

@ -665,7 +665,7 @@ public final class C {
public static final int DEFAULT_BUFFER_SEGMENT_SIZE = 64 * 1024; public static final int DEFAULT_BUFFER_SEGMENT_SIZE = 64 * 1024;
/** A default seek back increment, in milliseconds. */ /** A default seek back increment, in milliseconds. */
public static final long DEFAULT_SEEK_BACK_INCREMENT_MS = 5000; public static final long DEFAULT_SEEK_BACK_INCREMENT_MS = 5_000;
/** A default seek forward increment, in milliseconds. */ /** A default seek forward increment, in milliseconds. */
public static final long DEFAULT_SEEK_FORWARD_INCREMENT_MS = 15_000; public static final long DEFAULT_SEEK_FORWARD_INCREMENT_MS = 15_000;
@ -673,7 +673,7 @@ public final class C {
* A default maximum position for which a seek to previous will seek to the previous window, in * A default maximum position for which a seek to previous will seek to the previous window, in
* milliseconds. * milliseconds.
*/ */
public static final int DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS = 3000; public static final long DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS = 3_000;
/** "cenc" scheme type name as defined in ISO/IEC 23001-7:2016. */ /** "cenc" scheme type name as defined in ISO/IEC 23001-7:2016. */
@SuppressWarnings("ConstantField") @SuppressWarnings("ConstantField")

View file

@ -299,7 +299,7 @@ public class ForwardingPlayer implements Player {
} }
@Override @Override
public int getMaxSeekToPreviousPosition() { public long getMaxSeekToPreviousPosition() {
return player.getMaxSeekToPreviousPosition(); return player.getMaxSeekToPreviousPosition();
} }
@ -752,7 +752,7 @@ public class ForwardingPlayer implements Player {
} }
@Override @Override
public void onMaxSeekToPreviousPositionChanged(int maxSeekToPreviousPositionMs) { public void onMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) {
eventListener.onMaxSeekToPreviousPositionChanged(maxSeekToPreviousPositionMs); eventListener.onMaxSeekToPreviousPositionChanged(maxSeekToPreviousPositionMs);
} }

View file

@ -338,7 +338,7 @@ public interface Player {
* @param maxSeekToPreviousPositionMs The maximum position for which {@link #seekToPrevious()} * @param maxSeekToPreviousPositionMs The maximum position for which {@link #seekToPrevious()}
* seeks to the previous position, in milliseconds. * seeks to the previous position, in milliseconds.
*/ */
default void onMaxSeekToPreviousPositionChanged(int maxSeekToPreviousPositionMs) {} default void onMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) {}
/** /**
* @deprecated Seeks are processed without delay. Listen to {@link * @deprecated Seeks are processed without delay. Listen to {@link
@ -1785,9 +1785,9 @@ public interface Player {
* in milliseconds. * in milliseconds.
* *
* @return The maximum seek to previous position, in milliseconds. * @return The maximum seek to previous position, in milliseconds.
* @see Listener#onMaxSeekToPreviousPositionChanged(int) * @see Listener#onMaxSeekToPreviousPositionChanged(long)
*/ */
int getMaxSeekToPreviousPosition(); long getMaxSeekToPreviousPosition();
/** /**
* Seeks to an earlier position in the current or previous window (if available). More precisely: * Seeks to an earlier position in the current or previous window (if available). More precisely:

View file

@ -724,7 +724,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
} }
@Override @Override
public int getMaxSeekToPreviousPosition() { public long getMaxSeekToPreviousPosition() {
return C.DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS; return C.DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS;
} }

View file

@ -1380,7 +1380,7 @@ public class SimpleExoPlayer extends BasePlayer
} }
@Override @Override
public int getMaxSeekToPreviousPosition() { public long getMaxSeekToPreviousPosition() {
verifyApplicationThread(); verifyApplicationThread();
return player.getMaxSeekToPreviousPosition(); return player.getMaxSeekToPreviousPosition();
} }

View file

@ -769,7 +769,7 @@ public class AnalyticsCollector
} }
@Override @Override
public void onMaxSeekToPreviousPositionChanged(int maxSeekToPreviousPositionMs) { public void onMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) {
EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime(); EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent( sendEvent(
eventTime, eventTime,

View file

@ -623,7 +623,7 @@ public interface AnalyticsListener {
* @param maxSeekToPreviousPositionMs The maximum seek to previous position, in milliseconds. * @param maxSeekToPreviousPositionMs The maximum seek to previous position, in milliseconds.
*/ */
default void onMaxSeekToPreviousPositionChanged( default void onMaxSeekToPreviousPositionChanged(
EventTime eventTime, int maxSeekToPreviousPositionMs) {} EventTime eventTime, long maxSeekToPreviousPositionMs) {}
/** /**
* Called when the repeat mode changed. * Called when the repeat mode changed.

View file

@ -305,7 +305,7 @@ public class StubExoPlayer extends BasePlayer implements ExoPlayer {
} }
@Override @Override
public int getMaxSeekToPreviousPosition() { public long getMaxSeekToPreviousPosition() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }