Update ExoPlayer.Builder javadoc to mention buildExoPlayer()

PiperOrigin-RevId: 399651641
This commit is contained in:
ibaker 2021-09-29 12:12:17 +01:00 committed by Christos Tsilopoulos
parent ee14d51d90
commit 71f07e7a2b

View File

@ -501,7 +501,8 @@ public interface ExoPlayer extends Player {
* *
* @param trackSelector A {@link TrackSelector}. * @param trackSelector A {@link TrackSelector}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setTrackSelector(TrackSelector trackSelector) { public Builder setTrackSelector(TrackSelector trackSelector) {
wrappedBuilder.setTrackSelector(trackSelector); wrappedBuilder.setTrackSelector(trackSelector);
@ -513,7 +514,8 @@ public interface ExoPlayer extends Player {
* *
* @param mediaSourceFactory A {@link MediaSourceFactory}. * @param mediaSourceFactory A {@link MediaSourceFactory}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setMediaSourceFactory(MediaSourceFactory mediaSourceFactory) { public Builder setMediaSourceFactory(MediaSourceFactory mediaSourceFactory) {
wrappedBuilder.setMediaSourceFactory(mediaSourceFactory); wrappedBuilder.setMediaSourceFactory(mediaSourceFactory);
@ -525,7 +527,8 @@ public interface ExoPlayer extends Player {
* *
* @param loadControl A {@link LoadControl}. * @param loadControl A {@link LoadControl}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setLoadControl(LoadControl loadControl) { public Builder setLoadControl(LoadControl loadControl) {
wrappedBuilder.setLoadControl(loadControl); wrappedBuilder.setLoadControl(loadControl);
@ -537,7 +540,8 @@ public interface ExoPlayer extends Player {
* *
* @param bandwidthMeter A {@link BandwidthMeter}. * @param bandwidthMeter A {@link BandwidthMeter}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) { public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
wrappedBuilder.setBandwidthMeter(bandwidthMeter); wrappedBuilder.setBandwidthMeter(bandwidthMeter);
@ -550,7 +554,8 @@ public interface ExoPlayer extends Player {
* *
* @param looper A {@link Looper}. * @param looper A {@link Looper}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setLooper(Looper looper) { public Builder setLooper(Looper looper) {
wrappedBuilder.setLooper(looper); wrappedBuilder.setLooper(looper);
@ -562,7 +567,8 @@ public interface ExoPlayer extends Player {
* *
* @param analyticsCollector An {@link AnalyticsCollector}. * @param analyticsCollector An {@link AnalyticsCollector}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setAnalyticsCollector(AnalyticsCollector analyticsCollector) { public Builder setAnalyticsCollector(AnalyticsCollector analyticsCollector) {
wrappedBuilder.setAnalyticsCollector(analyticsCollector); wrappedBuilder.setAnalyticsCollector(analyticsCollector);
@ -576,7 +582,8 @@ public interface ExoPlayer extends Player {
* *
* @param priorityTaskManager A {@link PriorityTaskManager}, or null to not use one. * @param priorityTaskManager A {@link PriorityTaskManager}, or null to not use one.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) { public Builder setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
wrappedBuilder.setPriorityTaskManager(priorityTaskManager); wrappedBuilder.setPriorityTaskManager(priorityTaskManager);
@ -594,7 +601,8 @@ public interface ExoPlayer extends Player {
* @param audioAttributes {@link AudioAttributes}. * @param audioAttributes {@link AudioAttributes}.
* @param handleAudioFocus Whether the player should handle audio focus. * @param handleAudioFocus Whether the player should handle audio focus.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) { public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
wrappedBuilder.setAudioAttributes(audioAttributes, handleAudioFocus); wrappedBuilder.setAudioAttributes(audioAttributes, handleAudioFocus);
@ -616,7 +624,8 @@ public interface ExoPlayer extends Player {
* *
* @param wakeMode A {@link C.WakeMode}. * @param wakeMode A {@link C.WakeMode}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setWakeMode(@C.WakeMode int wakeMode) { public Builder setWakeMode(@C.WakeMode int wakeMode) {
wrappedBuilder.setWakeMode(wakeMode); wrappedBuilder.setWakeMode(wakeMode);
@ -632,7 +641,8 @@ public interface ExoPlayer extends Player {
* @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is * @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is
* rerouted from a headset to device speakers. * rerouted from a headset to device speakers.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) { public Builder setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
wrappedBuilder.setHandleAudioBecomingNoisy(handleAudioBecomingNoisy); wrappedBuilder.setHandleAudioBecomingNoisy(handleAudioBecomingNoisy);
@ -644,7 +654,8 @@ public interface ExoPlayer extends Player {
* *
* @param skipSilenceEnabled Whether skipping silences is enabled. * @param skipSilenceEnabled Whether skipping silences is enabled.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setSkipSilenceEnabled(boolean skipSilenceEnabled) { public Builder setSkipSilenceEnabled(boolean skipSilenceEnabled) {
wrappedBuilder.setSkipSilenceEnabled(skipSilenceEnabled); wrappedBuilder.setSkipSilenceEnabled(skipSilenceEnabled);
@ -659,7 +670,8 @@ public interface ExoPlayer extends Player {
* *
* @param videoScalingMode A {@link C.VideoScalingMode}. * @param videoScalingMode A {@link C.VideoScalingMode}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setVideoScalingMode(@C.VideoScalingMode int videoScalingMode) { public Builder setVideoScalingMode(@C.VideoScalingMode int videoScalingMode) {
wrappedBuilder.setVideoScalingMode(videoScalingMode); wrappedBuilder.setVideoScalingMode(videoScalingMode);
@ -678,7 +690,8 @@ public interface ExoPlayer extends Player {
* *
* @param videoChangeFrameRateStrategy A {@link C.VideoChangeFrameRateStrategy}. * @param videoChangeFrameRateStrategy A {@link C.VideoChangeFrameRateStrategy}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setVideoChangeFrameRateStrategy( public Builder setVideoChangeFrameRateStrategy(
@C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) { @C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) {
@ -695,7 +708,8 @@ public interface ExoPlayer extends Player {
* *
* @param useLazyPreparation Whether to use lazy preparation. * @param useLazyPreparation Whether to use lazy preparation.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setUseLazyPreparation(boolean useLazyPreparation) { public Builder setUseLazyPreparation(boolean useLazyPreparation) {
wrappedBuilder.setUseLazyPreparation(useLazyPreparation); wrappedBuilder.setUseLazyPreparation(useLazyPreparation);
@ -707,7 +721,8 @@ public interface ExoPlayer extends Player {
* *
* @param seekParameters The {@link SeekParameters}. * @param seekParameters The {@link SeekParameters}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setSeekParameters(SeekParameters seekParameters) { public Builder setSeekParameters(SeekParameters seekParameters) {
wrappedBuilder.setSeekParameters(seekParameters); wrappedBuilder.setSeekParameters(seekParameters);
@ -720,7 +735,8 @@ public interface ExoPlayer extends Player {
* @param seekBackIncrementMs The seek back increment, in milliseconds. * @param seekBackIncrementMs The seek back increment, in milliseconds.
* @return This builder. * @return This builder.
* @throws IllegalArgumentException If {@code seekBackIncrementMs} is non-positive. * @throws IllegalArgumentException If {@code seekBackIncrementMs} is non-positive.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs) { public Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs) {
wrappedBuilder.setSeekBackIncrementMs(seekBackIncrementMs); wrappedBuilder.setSeekBackIncrementMs(seekBackIncrementMs);
@ -733,7 +749,8 @@ public interface ExoPlayer extends Player {
* @param seekForwardIncrementMs The seek forward increment, in milliseconds. * @param seekForwardIncrementMs The seek forward increment, in milliseconds.
* @return This builder. * @return This builder.
* @throws IllegalArgumentException If {@code seekForwardIncrementMs} is non-positive. * @throws IllegalArgumentException If {@code seekForwardIncrementMs} is non-positive.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs) { public Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs) {
wrappedBuilder.setSeekForwardIncrementMs(seekForwardIncrementMs); wrappedBuilder.setSeekForwardIncrementMs(seekForwardIncrementMs);
@ -749,7 +766,8 @@ public interface ExoPlayer extends Player {
* *
* @param releaseTimeoutMs The release timeout, in milliseconds. * @param releaseTimeoutMs The release timeout, in milliseconds.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setReleaseTimeoutMs(long releaseTimeoutMs) { public Builder setReleaseTimeoutMs(long releaseTimeoutMs) {
wrappedBuilder.setReleaseTimeoutMs(releaseTimeoutMs); wrappedBuilder.setReleaseTimeoutMs(releaseTimeoutMs);
@ -765,7 +783,8 @@ public interface ExoPlayer extends Player {
* *
* @param detachSurfaceTimeoutMs The timeout for detaching a surface, in milliseconds. * @param detachSurfaceTimeoutMs The timeout for detaching a surface, in milliseconds.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setDetachSurfaceTimeoutMs(long detachSurfaceTimeoutMs) { public Builder setDetachSurfaceTimeoutMs(long detachSurfaceTimeoutMs) {
wrappedBuilder.setDetachSurfaceTimeoutMs(detachSurfaceTimeoutMs); wrappedBuilder.setDetachSurfaceTimeoutMs(detachSurfaceTimeoutMs);
@ -782,7 +801,8 @@ public interface ExoPlayer extends Player {
* *
* @param pauseAtEndOfMediaItems Whether to pause playback at the end of each media item. * @param pauseAtEndOfMediaItems Whether to pause playback at the end of each media item.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) { public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
wrappedBuilder.setPauseAtEndOfMediaItems(pauseAtEndOfMediaItems); wrappedBuilder.setPauseAtEndOfMediaItems(pauseAtEndOfMediaItems);
@ -795,7 +815,8 @@ public interface ExoPlayer extends Player {
* *
* @param livePlaybackSpeedControl The {@link LivePlaybackSpeedControl}. * @param livePlaybackSpeedControl The {@link LivePlaybackSpeedControl}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
public Builder setLivePlaybackSpeedControl(LivePlaybackSpeedControl livePlaybackSpeedControl) { public Builder setLivePlaybackSpeedControl(LivePlaybackSpeedControl livePlaybackSpeedControl) {
wrappedBuilder.setLivePlaybackSpeedControl(livePlaybackSpeedControl); wrappedBuilder.setLivePlaybackSpeedControl(livePlaybackSpeedControl);
@ -808,7 +829,8 @@ public interface ExoPlayer extends Player {
* *
* @param clock A {@link Clock}. * @param clock A {@link Clock}.
* @return This builder. * @return This builder.
* @throws IllegalStateException If {@link #build()} has already been called. * @throws IllegalStateException If {@link #build()} or {@link #buildExoPlayer()} has already
* been called.
*/ */
@VisibleForTesting @VisibleForTesting
public Builder setClock(Clock clock) { public Builder setClock(Clock clock) {
@ -819,7 +841,8 @@ public interface ExoPlayer extends Player {
/** /**
* Builds a {@link SimpleExoPlayer} instance. * Builds a {@link SimpleExoPlayer} instance.
* *
* @throws IllegalStateException If this method has already been called. * @throws IllegalStateException If this method or {@link #buildExoPlayer()} has already been
* called.
*/ */
@InlineMe(replacement = "this.buildExoPlayer()") @InlineMe(replacement = "this.buildExoPlayer()")
public SimpleExoPlayer build() { public SimpleExoPlayer build() {
@ -829,7 +852,7 @@ public interface ExoPlayer extends Player {
/** /**
* Builds a {@link SimpleExoPlayer} instance. * Builds a {@link SimpleExoPlayer} instance.
* *
* @throws IllegalStateException If this method has already been called. * @throws IllegalStateException If this method or {@link #build()} has already been called.
*/ */
public SimpleExoPlayer buildExoPlayer() { public SimpleExoPlayer buildExoPlayer() {
return wrappedBuilder.build(); return wrappedBuilder.build();