mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07: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() {
|
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
|
||||||
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.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue