mirror of
https://github.com/samsonjs/media.git
synced 2026-04-25 14:47:40 +00:00
Simplify using the Builder in SimpleExoPlayer subclasses.
PiperOrigin-RevId: 297111999
This commit is contained in:
parent
a9eb086678
commit
915f66730c
1 changed files with 15 additions and 10 deletions
|
|
@ -293,16 +293,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||
public SimpleExoPlayer build() {
|
||||
Assertions.checkState(!buildCalled);
|
||||
buildCalled = true;
|
||||
return new SimpleExoPlayer(
|
||||
context,
|
||||
renderersFactory,
|
||||
trackSelector,
|
||||
loadControl,
|
||||
bandwidthMeter,
|
||||
analyticsCollector,
|
||||
useLazyPreparation,
|
||||
clock,
|
||||
looper);
|
||||
return new SimpleExoPlayer(/* builder= */ this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,6 +342,20 @@ public class SimpleExoPlayer extends BasePlayer
|
|||
private boolean isPriorityTaskManagerRegistered;
|
||||
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 renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
|
||||
|
|
|
|||
Loading…
Reference in a new issue