Clarify that ExoPlayer.Builder constructor overloads only exist for R8
Also add a setRenderersFactory() method, so that all constructor-provided components can also be passed via setters. This comment already appears on the constructor that takes all components, but it applies to these ones as well. PiperOrigin-RevId: 405917343
This commit is contained in:
parent
e6242690ff
commit
b60acca872
@ -374,10 +374,10 @@ public interface ExoPlayer extends Player {
|
||||
final class Builder {
|
||||
|
||||
/* package */ final Context context;
|
||||
/* package */ final RenderersFactory renderersFactory;
|
||||
|
||||
/* package */ Clock clock;
|
||||
/* package */ long foregroundModeTimeoutMs;
|
||||
/* package */ RenderersFactory renderersFactory;
|
||||
/* package */ MediaSourceFactory mediaSourceFactory;
|
||||
/* package */ TrackSelector trackSelector;
|
||||
/* package */ LoadControl loadControl;
|
||||
@ -457,6 +457,9 @@ public interface ExoPlayer extends Player {
|
||||
*
|
||||
* <p>See {@link #Builder(Context)} for a list of default values.
|
||||
*
|
||||
* <p>Note that this constructor is only useful to try and ensure that ExoPlayer's {@link
|
||||
* DefaultRenderersFactory} can be removed by ProGuard or R8.
|
||||
*
|
||||
* @param context A {@link Context}.
|
||||
* @param renderersFactory A factory for creating {@link Renderer Renderers} to be used by the
|
||||
* player.
|
||||
@ -474,6 +477,10 @@ public interface ExoPlayer extends Player {
|
||||
*
|
||||
* <p>See {@link #Builder(Context)} for a list of default values.
|
||||
*
|
||||
* <p>Note that this constructor is only useful to try and ensure that ExoPlayer's {@link
|
||||
* DefaultMediaSourceFactory} (and therefore {@link DefaultExtractorsFactory}) can be removed by
|
||||
* ProGuard or R8.
|
||||
*
|
||||
* @param context A {@link Context}.
|
||||
* @param mediaSourceFactory A factory for creating a {@link MediaSource} from a {@link
|
||||
* MediaItem}.
|
||||
@ -488,6 +495,10 @@ public interface ExoPlayer extends Player {
|
||||
*
|
||||
* <p>See {@link #Builder(Context)} for a list of default values.
|
||||
*
|
||||
* <p>Note that this constructor is only useful to try and ensure that ExoPlayer's {@link
|
||||
* DefaultRenderersFactory}, {@link DefaultMediaSourceFactory} (and therefore {@link
|
||||
* DefaultExtractorsFactory}) can be removed by ProGuard or R8.
|
||||
*
|
||||
* @param context A {@link Context}.
|
||||
* @param renderersFactory A factory for creating {@link Renderer Renderers} to be used by the
|
||||
* player.
|
||||
@ -569,6 +580,20 @@ public interface ExoPlayer extends Player {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link RenderersFactory} that will be used by the player.
|
||||
*
|
||||
* @param renderersFactory A {@link RenderersFactory}.
|
||||
* @return This builder.
|
||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||
*/
|
||||
@UnstableApi
|
||||
public Builder setRenderersFactory(RenderersFactory renderersFactory) {
|
||||
checkState(!buildCalled);
|
||||
this.renderersFactory = renderersFactory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link MediaSourceFactory} that will be used by the player.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user