Remove PreloadConfiguration from public API
This feature isn't completed, so we should remove the public facing API to avoid confusion. #minor-release PiperOrigin-RevId: 643318692
This commit is contained in:
parent
93af537af7
commit
cd9b914c42
@ -437,31 +437,6 @@ public interface ExoPlayer extends Player {
|
|||||||
default void onOffloadedPlayback(boolean isOffloadedPlayback) {}
|
default void onOffloadedPlayback(boolean isOffloadedPlayback) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Configuration options for preloading playlist items. */
|
|
||||||
@UnstableApi
|
|
||||||
class PreloadConfiguration {
|
|
||||||
|
|
||||||
/** Default preload configuration that disables playlist preloading. */
|
|
||||||
public static final PreloadConfiguration DEFAULT =
|
|
||||||
new PreloadConfiguration(/* targetPreloadDurationUs= */ C.TIME_UNSET);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The target duration to buffer when preloading, in microseconds or {@link C#TIME_UNSET} to
|
|
||||||
* disable preloading.
|
|
||||||
*/
|
|
||||||
public final long targetPreloadDurationUs;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an instance.
|
|
||||||
*
|
|
||||||
* @param targetPreloadDurationUs The target duration to preload, in microseconds or {@link
|
|
||||||
* C#TIME_UNSET} to disable preloading.
|
|
||||||
*/
|
|
||||||
public PreloadConfiguration(long targetPreloadDurationUs) {
|
|
||||||
this.targetPreloadDurationUs = targetPreloadDurationUs;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A builder for {@link ExoPlayer} instances.
|
* A builder for {@link ExoPlayer} instances.
|
||||||
*
|
*
|
||||||
@ -1581,19 +1556,6 @@ public interface ExoPlayer extends Player {
|
|||||||
@UnstableApi
|
@UnstableApi
|
||||||
void setShuffleOrder(ShuffleOrder shuffleOrder);
|
void setShuffleOrder(ShuffleOrder shuffleOrder);
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the {@linkplain PreloadConfiguration preload configuration} to configure playlist
|
|
||||||
* preloading.
|
|
||||||
*
|
|
||||||
* @param preloadConfiguration The preload configuration.
|
|
||||||
*/
|
|
||||||
@UnstableApi
|
|
||||||
void setPreloadConfiguration(PreloadConfiguration preloadConfiguration);
|
|
||||||
|
|
||||||
/** Returns the {@linkplain PreloadConfiguration preload configuration}. */
|
|
||||||
@UnstableApi
|
|
||||||
PreloadConfiguration getPreloadConfiguration();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
|
@ -141,6 +141,30 @@ import java.util.concurrent.TimeoutException;
|
|||||||
MediaLibraryInfo.registerModule("media3.exoplayer");
|
MediaLibraryInfo.registerModule("media3.exoplayer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Configuration options for preloading playlist items. */
|
||||||
|
public static final class PreloadConfiguration {
|
||||||
|
|
||||||
|
/** Default preload configuration that disables playlist preloading. */
|
||||||
|
public static final PreloadConfiguration DEFAULT =
|
||||||
|
new PreloadConfiguration(/* targetPreloadDurationUs= */ C.TIME_UNSET);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The target duration to buffer when preloading, in microseconds or {@link C#TIME_UNSET} to
|
||||||
|
* disable preloading.
|
||||||
|
*/
|
||||||
|
public final long targetPreloadDurationUs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance.
|
||||||
|
*
|
||||||
|
* @param targetPreloadDurationUs The target duration to preload, in microseconds or {@link
|
||||||
|
* C#TIME_UNSET} to disable preloading.
|
||||||
|
*/
|
||||||
|
public PreloadConfiguration(long targetPreloadDurationUs) {
|
||||||
|
this.targetPreloadDurationUs = targetPreloadDurationUs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static final String TAG = "ExoPlayerImpl";
|
private static final String TAG = "ExoPlayerImpl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -885,7 +909,6 @@ import java.util.concurrent.TimeoutException;
|
|||||||
return shuffleModeEnabled;
|
return shuffleModeEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPreloadConfiguration(PreloadConfiguration preloadConfiguration) {
|
public void setPreloadConfiguration(PreloadConfiguration preloadConfiguration) {
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
if (this.preloadConfiguration.equals(preloadConfiguration)) {
|
if (this.preloadConfiguration.equals(preloadConfiguration)) {
|
||||||
@ -895,7 +918,6 @@ import java.util.concurrent.TimeoutException;
|
|||||||
internalPlayer.setPreloadConfiguration(preloadConfiguration);
|
internalPlayer.setPreloadConfiguration(preloadConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PreloadConfiguration getPreloadConfiguration() {
|
public PreloadConfiguration getPreloadConfiguration() {
|
||||||
return preloadConfiguration;
|
return preloadConfiguration;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ import androidx.media3.common.util.TraceUtil;
|
|||||||
import androidx.media3.common.util.Util;
|
import androidx.media3.common.util.Util;
|
||||||
import androidx.media3.datasource.DataSourceException;
|
import androidx.media3.datasource.DataSourceException;
|
||||||
import androidx.media3.exoplayer.DefaultMediaClock.PlaybackParametersListener;
|
import androidx.media3.exoplayer.DefaultMediaClock.PlaybackParametersListener;
|
||||||
import androidx.media3.exoplayer.ExoPlayer.PreloadConfiguration;
|
|
||||||
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
||||||
import androidx.media3.exoplayer.analytics.PlayerId;
|
import androidx.media3.exoplayer.analytics.PlayerId;
|
||||||
import androidx.media3.exoplayer.drm.DrmSession;
|
import androidx.media3.exoplayer.drm.DrmSession;
|
||||||
@ -242,7 +241,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
@Nullable private ExoPlaybackException pendingRecoverableRendererError;
|
@Nullable private ExoPlaybackException pendingRecoverableRendererError;
|
||||||
private long setForegroundModeTimeoutMs;
|
private long setForegroundModeTimeoutMs;
|
||||||
private long playbackMaybeBecameStuckAtMs;
|
private long playbackMaybeBecameStuckAtMs;
|
||||||
private PreloadConfiguration preloadConfiguration;
|
private ExoPlayerImpl.PreloadConfiguration preloadConfiguration;
|
||||||
private Timeline lastPreloadPoolInvalidationTimeline;
|
private Timeline lastPreloadPoolInvalidationTimeline;
|
||||||
|
|
||||||
public ExoPlayerImplInternal(
|
public ExoPlayerImplInternal(
|
||||||
@ -264,7 +263,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
PlaybackInfoUpdateListener playbackInfoUpdateListener,
|
PlaybackInfoUpdateListener playbackInfoUpdateListener,
|
||||||
PlayerId playerId,
|
PlayerId playerId,
|
||||||
Looper playbackLooper,
|
Looper playbackLooper,
|
||||||
PreloadConfiguration preloadConfiguration) {
|
ExoPlayerImpl.PreloadConfiguration preloadConfiguration) {
|
||||||
this.playbackInfoUpdateListener = playbackInfoUpdateListener;
|
this.playbackInfoUpdateListener = playbackInfoUpdateListener;
|
||||||
this.renderers = renderers;
|
this.renderers = renderers;
|
||||||
this.trackSelector = trackSelector;
|
this.trackSelector = trackSelector;
|
||||||
@ -373,7 +372,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
handler.obtainMessage(MSG_SET_SHUFFLE_ENABLED, shuffleModeEnabled ? 1 : 0, 0).sendToTarget();
|
handler.obtainMessage(MSG_SET_SHUFFLE_ENABLED, shuffleModeEnabled ? 1 : 0, 0).sendToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPreloadConfiguration(PreloadConfiguration preloadConfiguration) {
|
public void setPreloadConfiguration(ExoPlayerImpl.PreloadConfiguration preloadConfiguration) {
|
||||||
handler.obtainMessage(MSG_SET_PRELOAD_CONFIGURATION, preloadConfiguration).sendToTarget();
|
handler.obtainMessage(MSG_SET_PRELOAD_CONFIGURATION, preloadConfiguration).sendToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,7 +561,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
setShuffleModeEnabledInternal(msg.arg1 != 0);
|
setShuffleModeEnabledInternal(msg.arg1 != 0);
|
||||||
break;
|
break;
|
||||||
case MSG_SET_PRELOAD_CONFIGURATION:
|
case MSG_SET_PRELOAD_CONFIGURATION:
|
||||||
setPreloadConfigurationInternal((PreloadConfiguration) msg.obj);
|
setPreloadConfigurationInternal((ExoPlayerImpl.PreloadConfiguration) msg.obj);
|
||||||
break;
|
break;
|
||||||
case MSG_DO_SOME_WORK:
|
case MSG_DO_SOME_WORK:
|
||||||
doSomeWork();
|
doSomeWork();
|
||||||
@ -951,7 +950,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
|
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPreloadConfigurationInternal(PreloadConfiguration preloadConfiguration) {
|
private void setPreloadConfigurationInternal(
|
||||||
|
ExoPlayerImpl.PreloadConfiguration preloadConfiguration) {
|
||||||
this.preloadConfiguration = preloadConfiguration;
|
this.preloadConfiguration = preloadConfiguration;
|
||||||
queue.updatePreloadConfiguration(playbackInfo.timeline, preloadConfiguration);
|
queue.updatePreloadConfiguration(playbackInfo.timeline, preloadConfiguration);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ import androidx.media3.common.Player.RepeatMode;
|
|||||||
import androidx.media3.common.Timeline;
|
import androidx.media3.common.Timeline;
|
||||||
import androidx.media3.common.util.Assertions;
|
import androidx.media3.common.util.Assertions;
|
||||||
import androidx.media3.common.util.HandlerWrapper;
|
import androidx.media3.common.util.HandlerWrapper;
|
||||||
import androidx.media3.exoplayer.ExoPlayer.PreloadConfiguration;
|
|
||||||
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
||||||
import androidx.media3.exoplayer.source.MediaPeriod;
|
import androidx.media3.exoplayer.source.MediaPeriod;
|
||||||
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||||
@ -85,7 +84,7 @@ import java.util.List;
|
|||||||
private int length;
|
private int length;
|
||||||
@Nullable private Object oldFrontPeriodUid;
|
@Nullable private Object oldFrontPeriodUid;
|
||||||
private long oldFrontPeriodWindowSequenceNumber;
|
private long oldFrontPeriodWindowSequenceNumber;
|
||||||
private PreloadConfiguration preloadConfiguration;
|
private ExoPlayerImpl.PreloadConfiguration preloadConfiguration;
|
||||||
private List<MediaPeriodHolder> preloadPriorityList;
|
private List<MediaPeriodHolder> preloadPriorityList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,7 +99,7 @@ import java.util.List;
|
|||||||
AnalyticsCollector analyticsCollector,
|
AnalyticsCollector analyticsCollector,
|
||||||
HandlerWrapper analyticsCollectorHandler,
|
HandlerWrapper analyticsCollectorHandler,
|
||||||
MediaPeriodHolder.Factory mediaPeriodHolderFactory,
|
MediaPeriodHolder.Factory mediaPeriodHolderFactory,
|
||||||
PreloadConfiguration preloadConfiguration) {
|
ExoPlayerImpl.PreloadConfiguration preloadConfiguration) {
|
||||||
this.analyticsCollector = analyticsCollector;
|
this.analyticsCollector = analyticsCollector;
|
||||||
this.analyticsCollectorHandler = analyticsCollectorHandler;
|
this.analyticsCollectorHandler = analyticsCollectorHandler;
|
||||||
this.mediaPeriodHolderFactory = mediaPeriodHolderFactory;
|
this.mediaPeriodHolderFactory = mediaPeriodHolderFactory;
|
||||||
@ -143,7 +142,7 @@ import java.util.List;
|
|||||||
* @param preloadConfiguration The new preload configuration.
|
* @param preloadConfiguration The new preload configuration.
|
||||||
*/
|
*/
|
||||||
public void updatePreloadConfiguration(
|
public void updatePreloadConfiguration(
|
||||||
Timeline timeline, PreloadConfiguration preloadConfiguration) {
|
Timeline timeline, ExoPlayerImpl.PreloadConfiguration preloadConfiguration) {
|
||||||
this.preloadConfiguration = preloadConfiguration;
|
this.preloadConfiguration = preloadConfiguration;
|
||||||
invalidatePreloadPool(timeline);
|
invalidatePreloadPool(timeline);
|
||||||
}
|
}
|
||||||
|
@ -992,18 +992,6 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
player.setRepeatMode(repeatMode);
|
player.setRepeatMode(repeatMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPreloadConfiguration(PreloadConfiguration preloadConfiguration) {
|
|
||||||
blockUntilConstructorFinished();
|
|
||||||
player.setPreloadConfiguration(preloadConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PreloadConfiguration getPreloadConfiguration() {
|
|
||||||
blockUntilConstructorFinished();
|
|
||||||
return player.getPreloadConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
blockUntilConstructorFinished();
|
blockUntilConstructorFinished();
|
||||||
|
@ -274,16 +274,14 @@ public class ExoPlayerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TestExoPlayerBuilder parameterizeTestExoPlayerBuilder(TestExoPlayerBuilder builder) {
|
private TestExoPlayerBuilder parameterizeTestExoPlayerBuilder(TestExoPlayerBuilder builder) {
|
||||||
return builder.setPreloadConfiguration(createPreloadConfiguration());
|
// TODO: set PreloadConfiguration when enabled again after the release.
|
||||||
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ExoPlayerTestRunner.Builder parameterizeExoPlayerTestRunnerBuilder(
|
private ExoPlayerTestRunner.Builder parameterizeExoPlayerTestRunnerBuilder(
|
||||||
ExoPlayerTestRunner.Builder builder) {
|
ExoPlayerTestRunner.Builder builder) {
|
||||||
return builder.setPreloadConfiguration(createPreloadConfiguration());
|
// TODO: set PreloadConfiguration when enabled again after the release.
|
||||||
}
|
return builder;
|
||||||
|
|
||||||
private ExoPlayer.PreloadConfiguration createPreloadConfiguration() {
|
|
||||||
return new ExoPlayer.PreloadConfiguration(getTargetPreloadDurationUs());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -6808,80 +6806,6 @@ public class ExoPlayerTest {
|
|||||||
Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE /* source prepared */);
|
Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE /* source prepared */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void prepare_preloadingEnabled_nextWindowPeriodCreatedForPreloading() throws Exception {
|
|
||||||
FakeMediaSource mediaSource1 =
|
|
||||||
new FakeMediaSource(
|
|
||||||
new FakeTimeline(
|
|
||||||
new TimelineWindowDefinition(
|
|
||||||
/* isSeekable= */ true,
|
|
||||||
/* isDynamic= */ false,
|
|
||||||
/* durationUs= */ DefaultLoadControl.DEFAULT_MAX_BUFFER_MS * 2)));
|
|
||||||
List<MediaPeriodId> createdMediaPeriodIds = new ArrayList<>();
|
|
||||||
FakeMediaSource mediaSource2 =
|
|
||||||
new FakeMediaSource() {
|
|
||||||
@Override
|
|
||||||
public MediaPeriod createPeriod(
|
|
||||||
MediaPeriodId id, Allocator allocator, long startPositionUs) {
|
|
||||||
createdMediaPeriodIds.add(id);
|
|
||||||
return super.createPeriod(id, allocator, startPositionUs);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ExoPlayer player =
|
|
||||||
// Intentionally not using `parameterizeTestExoPlayerBuilder()` for preload specific test.
|
|
||||||
new TestExoPlayerBuilder(context)
|
|
||||||
.setPreloadConfiguration(
|
|
||||||
new ExoPlayer.PreloadConfiguration(/* targetPreloadDurationUs= */ 5_000_000L))
|
|
||||||
.build();
|
|
||||||
player.setMediaSources(ImmutableList.of(mediaSource1, mediaSource2));
|
|
||||||
|
|
||||||
player.prepare();
|
|
||||||
run(player).untilPendingCommandsAreFullyHandled();
|
|
||||||
|
|
||||||
assertThat(createdMediaPeriodIds).hasSize(1);
|
|
||||||
play(player).untilState(Player.STATE_ENDED);
|
|
||||||
assertThat(createdMediaPeriodIds).hasSize(1);
|
|
||||||
player.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void prepare_preloadingEnabledRepeatModeOne_sameWindowPeriodCreatedForPreloading()
|
|
||||||
throws Exception {
|
|
||||||
FakeTimeline timeline =
|
|
||||||
new FakeTimeline(
|
|
||||||
new TimelineWindowDefinition(
|
|
||||||
/* isSeekable= */ true,
|
|
||||||
/* isDynamic= */ false,
|
|
||||||
/* durationUs= */ DefaultLoadControl.DEFAULT_MAX_BUFFER_MS * 2));
|
|
||||||
List<MediaPeriodId> createdMediaPeriodIds = new ArrayList<>();
|
|
||||||
FakeMediaSource mediaSource =
|
|
||||||
new FakeMediaSource(timeline) {
|
|
||||||
@Override
|
|
||||||
public MediaPeriod createPeriod(
|
|
||||||
MediaPeriodId id, Allocator allocator, long startPositionUs) {
|
|
||||||
createdMediaPeriodIds.add(id);
|
|
||||||
return super.createPeriod(id, allocator, startPositionUs);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ExoPlayer player =
|
|
||||||
// Intentionally not using `parameterizeTestExoPlayerBuilder()` for preload specific test.
|
|
||||||
new TestExoPlayerBuilder(context)
|
|
||||||
.setPreloadConfiguration(
|
|
||||||
new ExoPlayer.PreloadConfiguration(/* targetPreloadDurationUs= */ 5_000_000L))
|
|
||||||
.build();
|
|
||||||
player.setRepeatMode(Player.REPEAT_MODE_ONE);
|
|
||||||
player.setMediaSource(mediaSource);
|
|
||||||
|
|
||||||
player.prepare();
|
|
||||||
run(player).untilPendingCommandsAreFullyHandled();
|
|
||||||
|
|
||||||
assertThat(createdMediaPeriodIds).hasSize(2);
|
|
||||||
player.setRepeatMode(Player.REPEAT_MODE_OFF);
|
|
||||||
play(player).untilState(Player.STATE_ENDED);
|
|
||||||
assertThat(createdMediaPeriodIds).hasSize(2);
|
|
||||||
player.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void seekToIndexLargerThanNumberOfPlaylistItems() throws Exception {
|
public void seekToIndexLargerThanNumberOfPlaylistItems() throws Exception {
|
||||||
Timeline fakeTimeline =
|
Timeline fakeTimeline =
|
||||||
@ -14583,7 +14507,6 @@ public class ExoPlayerTest {
|
|||||||
new DefaultRenderersFactory(context).setAllowedVideoJoiningTimeMs(0))
|
new DefaultRenderersFactory(context).setAllowedVideoJoiningTimeMs(0))
|
||||||
.setClock(new FakeClock(/* isAutoAdvancing= */ true))
|
.setClock(new FakeClock(/* isAutoAdvancing= */ true))
|
||||||
.build();
|
.build();
|
||||||
player.setPreloadConfiguration(createPreloadConfiguration());
|
|
||||||
player.setPauseAtEndOfMediaItems(true);
|
player.setPauseAtEndOfMediaItems(true);
|
||||||
Surface surface = new Surface(new SurfaceTexture(/* texName= */ 0));
|
Surface surface = new Surface(new SurfaceTexture(/* texName= */ 0));
|
||||||
player.setVideoSurface(surface);
|
player.setVideoSurface(surface);
|
||||||
|
@ -40,7 +40,7 @@ import androidx.media3.common.Timeline;
|
|||||||
import androidx.media3.common.Tracks;
|
import androidx.media3.common.Tracks;
|
||||||
import androidx.media3.common.util.Clock;
|
import androidx.media3.common.util.Clock;
|
||||||
import androidx.media3.common.util.HandlerWrapper;
|
import androidx.media3.common.util.HandlerWrapper;
|
||||||
import androidx.media3.exoplayer.ExoPlayer.PreloadConfiguration;
|
import androidx.media3.exoplayer.ExoPlayerImpl.PreloadConfiguration;
|
||||||
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
||||||
import androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector;
|
import androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector;
|
||||||
import androidx.media3.exoplayer.analytics.PlayerId;
|
import androidx.media3.exoplayer.analytics.PlayerId;
|
||||||
|
@ -284,16 +284,6 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see ExoPlayer#setPreloadConfiguration(ExoPlayer.PreloadConfiguration)
|
|
||||||
* @return This builder.
|
|
||||||
*/
|
|
||||||
@CanIgnoreReturnValue
|
|
||||||
public Builder setPreloadConfiguration(ExoPlayer.PreloadConfiguration preloadConfiguration) {
|
|
||||||
testPlayerBuilder.setPreloadConfiguration(preloadConfiguration);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets an {@link ActionSchedule} to be run by the test runner. The first action will be
|
* Sets an {@link ActionSchedule} to be run by the test runner. The first action will be
|
||||||
* executed immediately before {@link ExoPlayer#prepare()}.
|
* executed immediately before {@link ExoPlayer#prepare()}.
|
||||||
|
@ -154,16 +154,6 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPreloadConfiguration(PreloadConfiguration preloadConfiguration) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PreloadConfiguration getPreloadConfiguration() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMediaSource(MediaSource mediaSource) {
|
public void setMediaSource(MediaSource mediaSource) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
@ -56,7 +56,6 @@ public class TestExoPlayerBuilder {
|
|||||||
private long seekForwardIncrementMs;
|
private long seekForwardIncrementMs;
|
||||||
private boolean deviceVolumeControlEnabled;
|
private boolean deviceVolumeControlEnabled;
|
||||||
private boolean suppressPlaybackWhenUnsuitableOutput;
|
private boolean suppressPlaybackWhenUnsuitableOutput;
|
||||||
@Nullable private ExoPlayer.PreloadConfiguration preloadConfiguration;
|
|
||||||
private boolean dynamicSchedulingEnabled;
|
private boolean dynamicSchedulingEnabled;
|
||||||
|
|
||||||
public TestExoPlayerBuilder(Context context) {
|
public TestExoPlayerBuilder(Context context) {
|
||||||
@ -162,18 +161,6 @@ public class TestExoPlayerBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the preload configuration.
|
|
||||||
*
|
|
||||||
* @see ExoPlayer#setPreloadConfiguration(ExoPlayer.PreloadConfiguration)
|
|
||||||
*/
|
|
||||||
@CanIgnoreReturnValue
|
|
||||||
public TestExoPlayerBuilder setPreloadConfiguration(
|
|
||||||
ExoPlayer.PreloadConfiguration preloadConfiguration) {
|
|
||||||
this.preloadConfiguration = preloadConfiguration;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link Renderer Renderers} that have been set with {@link #setRenderers} or null if
|
* Returns the {@link Renderer Renderers} that have been set with {@link #setRenderers} or null if
|
||||||
* no {@link Renderer Renderers} have been explicitly set. Note that these renderers may not be
|
* no {@link Renderer Renderers} have been explicitly set. Note that these renderers may not be
|
||||||
@ -386,9 +373,6 @@ public class TestExoPlayerBuilder {
|
|||||||
builder.setMediaSourceFactory(mediaSourceFactory);
|
builder.setMediaSourceFactory(mediaSourceFactory);
|
||||||
}
|
}
|
||||||
ExoPlayer exoPlayer = builder.build();
|
ExoPlayer exoPlayer = builder.build();
|
||||||
if (preloadConfiguration != null) {
|
|
||||||
exoPlayer.setPreloadConfiguration(preloadConfiguration);
|
|
||||||
}
|
|
||||||
return exoPlayer;
|
return exoPlayer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user