Commit 0f64ace5 by olly Committed by Ian Baker

Only set experimentalSetForegroundModeTimeoutMs value when it's > 0

PiperOrigin-RevId: 345489364
parent 29803545
...@@ -239,7 +239,7 @@ public interface ExoPlayer extends Player { ...@@ -239,7 +239,7 @@ public interface ExoPlayer extends Player {
* *
* <p>This method is experimental, and will be renamed or removed in a future release. * <p>This method is experimental, and will be renamed or removed in a future release.
* *
* @param timeoutMs The time limit in milliseconds, or 0 for no limit. * @param timeoutMs The time limit in milliseconds.
*/ */
public Builder experimentalSetForegroundModeTimeoutMs(long timeoutMs) { public Builder experimentalSetForegroundModeTimeoutMs(long timeoutMs) {
setForegroundModeTimeoutMs = timeoutMs; setForegroundModeTimeoutMs = timeoutMs;
...@@ -457,7 +457,9 @@ public interface ExoPlayer extends Player { ...@@ -457,7 +457,9 @@ public interface ExoPlayer extends Player {
looper, looper,
/* wrappingPlayer= */ null); /* wrappingPlayer= */ null);
if (setForegroundModeTimeoutMs > 0) {
player.experimentalSetForegroundModeTimeoutMs(setForegroundModeTimeoutMs); player.experimentalSetForegroundModeTimeoutMs(setForegroundModeTimeoutMs);
}
if (!throwWhenStuckBuffering) { if (!throwWhenStuckBuffering) {
player.experimentalDisableThrowWhenStuckBuffering(); player.experimentalDisableThrowWhenStuckBuffering();
} }
......
...@@ -204,7 +204,7 @@ import java.util.concurrent.TimeoutException; ...@@ -204,7 +204,7 @@ import java.util.concurrent.TimeoutException;
* <p>This method is experimental, and will be renamed or removed in a future release. It should * <p>This method is experimental, and will be renamed or removed in a future release. It should
* only be called before the player is used. * only be called before the player is used.
* *
* @param timeoutMs The time limit in milliseconds, or 0 for no limit. * @param timeoutMs The time limit in milliseconds.
*/ */
public void experimentalSetForegroundModeTimeoutMs(long timeoutMs) { public void experimentalSetForegroundModeTimeoutMs(long timeoutMs) {
internalPlayer.experimentalSetForegroundModeTimeoutMs(timeoutMs); internalPlayer.experimentalSetForegroundModeTimeoutMs(timeoutMs);
......
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