Commit 915f6673 by tonihei Committed by Oliver Woodman

Simplify using the Builder in SimpleExoPlayer subclasses.

PiperOrigin-RevId: 297111999
parent a9eb0866
...@@ -293,16 +293,7 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -293,16 +293,7 @@ public class SimpleExoPlayer extends BasePlayer
public SimpleExoPlayer build() { public SimpleExoPlayer build() {
Assertions.checkState(!buildCalled); Assertions.checkState(!buildCalled);
buildCalled = true; buildCalled = true;
return new SimpleExoPlayer( return new SimpleExoPlayer(/* builder= */ this);
context,
renderersFactory,
trackSelector,
loadControl,
bandwidthMeter,
analyticsCollector,
useLazyPreparation,
clock,
looper);
} }
} }
...@@ -351,6 +342,20 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -351,6 +342,20 @@ public class SimpleExoPlayer extends BasePlayer
private boolean isPriorityTaskManagerRegistered; private boolean isPriorityTaskManagerRegistered;
private boolean playerReleased; private boolean playerReleased;
/** @param builder The {@link Builder} to obtain all construction parameters. */
protected SimpleExoPlayer(Builder builder) {
this(
builder.context,
builder.renderersFactory,
builder.trackSelector,
builder.loadControl,
builder.bandwidthMeter,
builder.analyticsCollector,
builder.useLazyPreparation,
builder.clock,
builder.looper);
}
/** /**
* @param context A {@link Context}. * @param context A {@link Context}.
* @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance. * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
......
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