Remove usages of deprecated SimpleExoPlayer.Builder

PiperOrigin-RevId: 390130681
This commit is contained in:
kimvde 2021-08-11 15:48:29 +01:00 committed by Oliver Woodman
parent 7dffb2dc4d
commit 01613a2e55
62 changed files with 162 additions and 140 deletions

View File

@ -21,6 +21,7 @@ import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Player.DiscontinuityReason; import com.google.android.exoplayer2.Player.DiscontinuityReason;
@ -94,7 +95,7 @@ import java.util.ArrayList;
currentItemIndex = C.INDEX_UNSET; currentItemIndex = C.INDEX_UNSET;
trackSelector = new DefaultTrackSelector(context); trackSelector = new DefaultTrackSelector(context);
exoPlayer = new SimpleExoPlayer.Builder(context).setTrackSelector(trackSelector).build(); exoPlayer = new ExoPlayer.Builder(context).setTrackSelector(trackSelector).build();
exoPlayer.addListener(this); exoPlayer.addListener(this);
localPlayerView.setPlayer(exoPlayer); localPlayerView.setPlayer(exoPlayer);

View File

@ -24,6 +24,7 @@ import android.widget.FrameLayout;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -172,7 +173,7 @@ public final class MainActivity extends Activity {
throw new IllegalStateException(); throw new IllegalStateException();
} }
SimpleExoPlayer player = new SimpleExoPlayer.Builder(getApplicationContext()).build(); SimpleExoPlayer player = new ExoPlayer.Builder(getApplicationContext()).build();
player.setRepeatMode(Player.REPEAT_MODE_ALL); player.setRepeatMode(Player.REPEAT_MODE_ALL);
player.setMediaSource(mediaSource); player.setMediaSource(mediaSource);
player.prepare(); player.prepare();

View File

@ -32,6 +32,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -272,7 +273,7 @@ public class PlayerActivity extends AppCompatActivity
trackSelector.setParameters(trackSelectorParameters); trackSelector.setParameters(trackSelectorParameters);
lastSeenTrackGroupArray = null; lastSeenTrackGroupArray = null;
player = player =
new SimpleExoPlayer.Builder(/* context= */ this, renderersFactory) new ExoPlayer.Builder(/* context= */ this, renderersFactory)
.setMediaSourceFactory(mediaSourceFactory) .setMediaSourceFactory(mediaSourceFactory)
.setTrackSelector(trackSelector) .setTrackSelector(trackSelector)
.build(); .build();

View File

@ -28,6 +28,7 @@ import android.widget.Button;
import android.widget.GridLayout; import android.widget.GridLayout;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -216,7 +217,7 @@ public final class MainActivity extends Activity {
} else { } else {
throw new IllegalStateException(); throw new IllegalStateException();
} }
SimpleExoPlayer player = new SimpleExoPlayer.Builder(getApplicationContext()).build(); SimpleExoPlayer player = new ExoPlayer.Builder(getApplicationContext()).build();
player.setMediaSource(mediaSource); player.setMediaSource(mediaSource);
player.prepare(); player.prepare();
player.play(); player.play();

View File

@ -49,7 +49,7 @@ MediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(context) new DefaultMediaSourceFactory(context)
.setAdsLoaderProvider(adsLoaderProvider) .setAdsLoaderProvider(adsLoaderProvider)
.setAdViewProvider(playerView); .setAdViewProvider(playerView);
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory) .setMediaSourceFactory(mediaSourceFactory)
.build(); .build();
~~~ ~~~

View File

@ -246,7 +246,7 @@ class ExtendedCollector extends AnalyticsCollector {
} }
// Usage - Setup and listener registration. // Usage - Setup and listener registration.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setAnalyticsCollector(new ExtendedCollector()) .setAnalyticsCollector(new ExtendedCollector())
.build(); .build();
player.addAnalyticsListener(new ExtendedListener() { player.addAnalyticsListener(new ExtendedListener() {

View File

@ -60,7 +60,7 @@ DefaultDataSource.Factory dataSourceFactory =
// Inject the DefaultDataSourceFactory when creating the player. // Inject the DefaultDataSourceFactory when creating the player.
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory)) .setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build(); .build();
~~~ ~~~
@ -82,7 +82,7 @@ DataSource.Factory cacheDataSourceFactory =
.setCache(simpleCache) .setCache(simpleCache)
.setUpstreamDataSourceFactory(httpDataSourceFactory); .setUpstreamDataSourceFactory(httpDataSourceFactory);
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(cacheDataSourceFactory)) new DefaultMediaSourceFactory(cacheDataSourceFactory))
.build(); .build();
@ -107,7 +107,7 @@ DataSource.Factory dataSourceFactory = () -> {
return dataSource; return dataSource;
}; };
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory)) .setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build(); .build();
~~~ ~~~
@ -158,7 +158,7 @@ LoadErrorHandlingPolicy loadErrorHandlingPolicy =
}; };
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(context) new DefaultMediaSourceFactory(context)
.setLoadErrorHandlingPolicy(loadErrorHandlingPolicy)) .setLoadErrorHandlingPolicy(loadErrorHandlingPolicy))
@ -181,7 +181,7 @@ DefaultExtractorsFactory extractorsFactory =
new DefaultExtractorsFactory() new DefaultExtractorsFactory()
.setMp3ExtractorFlags(Mp3Extractor.FLAG_ENABLE_INDEX_SEEKING); .setMp3ExtractorFlags(Mp3Extractor.FLAG_ENABLE_INDEX_SEEKING);
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(context, extractorsFactory)) new DefaultMediaSourceFactory(context, extractorsFactory))
.build(); .build();

View File

@ -17,7 +17,7 @@ You can then create a `MediaItem` for a DASH MPD URI and pass it to the player.
~~~ ~~~
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played. // Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(dashUri)); player.setMediaItem(MediaItem.fromUri(dashUri));
// Prepare the player. // Prepare the player.
@ -45,7 +45,7 @@ MediaSource mediaSource =
new DashMediaSource.Factory(dataSourceFactory) new DashMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(dashUri)); .createMediaSource(MediaItem.fromUri(dashUri));
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played. // Set the media source to be played.
player.setMediaSource(mediaSource); player.setMediaSource(mediaSource);
// Prepare the player. // Prepare the player.

View File

@ -322,7 +322,7 @@ DataSource.Factory cacheDataSourceFactory =
.setUpstreamDataSourceFactory(httpDataSourceFactory) .setUpstreamDataSourceFactory(httpDataSourceFactory)
.setCacheWriteDataSinkFactory(null); // Disable writing. .setCacheWriteDataSinkFactory(null); // Disable writing.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(cacheDataSourceFactory)) new DefaultMediaSourceFactory(cacheDataSourceFactory))
.build(); .build();

View File

@ -92,12 +92,12 @@ to prevent build errors.
## Creating the player ## ## Creating the player ##
You can create an `ExoPlayer` instance using `SimpleExoPlayer.Builder`, which You can create an `ExoPlayer` instance using `ExoPlayer.Builder`, which provides
provides a range of customization options. The code below is the simplest a range of customization options. The code below is the simplest example of
example of creating an instance. creating an instance.
~~~ ~~~
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
~~~ ~~~
{: .language-java} {: .language-java}

View File

@ -18,7 +18,7 @@ player.
~~~ ~~~
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played. // Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(hlsUri)); player.setMediaItem(MediaItem.fromUri(hlsUri));
// Prepare the player. // Prepare the player.
@ -48,7 +48,7 @@ HlsMediaSource hlsMediaSource =
new HlsMediaSource.Factory(dataSourceFactory) new HlsMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(hlsUri)); .createMediaSource(MediaItem.fromUri(hlsUri));
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played. // Set the media source to be played.
player.setMediaSource(hlsMediaSource); player.setMediaSource(hlsMediaSource);
// Prepare the player. // Prepare the player.

View File

@ -97,7 +97,7 @@ values will override parameters defined by the media.
~~~ ~~~
// Global settings. // Global settings.
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(context).setLiveTargetOffsetMs(5000)) new DefaultMediaSourceFactory(context).setLiveTargetOffsetMs(5000))
.build(); .build();
@ -164,7 +164,7 @@ instance can be set when building the player:
~~~ ~~~
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setLivePlaybackSpeedControl( .setLivePlaybackSpeedControl(
new DefaultLivePlaybackSpeedControl.Builder() new DefaultLivePlaybackSpeedControl.Builder()
.setFallbackMaxPlaybackSpeed(1.04f) .setFallbackMaxPlaybackSpeed(1.04f)

View File

@ -37,7 +37,7 @@ MediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(cacheDataSourceFactory) new DefaultMediaSourceFactory(cacheDataSourceFactory)
.setAdsLoaderProvider(adsLoaderProvider) .setAdsLoaderProvider(adsLoaderProvider)
.setAdViewProvider(playerView); .setAdViewProvider(playerView);
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context) SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory) .setMediaSourceFactory(mediaSourceFactory)
.build(); .build();
~~~ ~~~

View File

@ -50,7 +50,7 @@ DefaultDataSource.Factory dataSourceFactory =
// Inject the DefaultDataSourceFactory when creating the player. // Inject the DefaultDataSourceFactory when creating the player.
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory)) .setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build(); .build();
~~~ ~~~

View File

@ -11,7 +11,7 @@ it to the player.
~~~ ~~~
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played. // Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(progressiveUri)); player.setMediaItem(MediaItem.fromUri(progressiveUri));
// Prepare the player. // Prepare the player.
@ -31,7 +31,7 @@ DataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory();
MediaSource mediaSource = new ProgressiveMediaSource.Factory(dataSourceFactory) MediaSource mediaSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(progressiveUri)); .createMediaSource(MediaItem.fromUri(progressiveUri));
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played. // Set the media source to be played.
player.setMediaSource(mediaSource); player.setMediaSource(mediaSource);
// Prepare the player. // Prepare the player.

View File

@ -17,7 +17,7 @@ You can then create a `MediaItem` for an RTSP URI and pass it to the player.
~~~ ~~~
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played. // Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(rtspUri)); player.setMediaItem(MediaItem.fromUri(rtspUri));
// Prepare the player. // Prepare the player.
@ -43,7 +43,7 @@ MediaSource mediaSource =
new RtspMediaSource.Factory() new RtspMediaSource.Factory()
.createMediaSource(MediaItem.fromUri(rtspUri)); .createMediaSource(MediaItem.fromUri(rtspUri));
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played. // Set the media source to be played.
player.setMediaSource(mediaSource); player.setMediaSource(mediaSource);
// Prepare the player. // Prepare the player.

View File

@ -59,7 +59,7 @@ RenderersFactory audioOnlyRenderersFactory =
context, MediaCodecSelector.DEFAULT, handler, audioListener) context, MediaCodecSelector.DEFAULT, handler, audioListener)
}; };
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, audioOnlyRenderersFactory).build(); new ExoPlayer.Builder(context, audioOnlyRenderersFactory).build();
~~~ ~~~
{: .language-java} {: .language-java}
@ -81,14 +81,14 @@ an app that only needs to play mp4 files can provide a factory like:
ExtractorsFactory mp4ExtractorFactory = ExtractorsFactory mp4ExtractorFactory =
() -> new Extractor[] {new Mp4Extractor()}; () -> new Extractor[] {new Mp4Extractor()};
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, mp4ExtractorFactory).build(); new ExoPlayer.Builder(context, mp4ExtractorFactory).build();
~~~ ~~~
{: .language-java} {: .language-java}
This will allow other `Extractor` implementations to be removed by code This will allow other `Extractor` implementations to be removed by code
shrinking, which can result in a significant reduction in size. shrinking, which can result in a significant reduction in size.
You should pass `ExtractorsFactory.EMPTY` to the `SimpleExoPlayer.Builder` You should pass `ExtractorsFactory.EMPTY` to the `ExoPlayer.Builder`
constructor, if your app is doing one of the following: constructor, if your app is doing one of the following:
* Not playing progressive media at all, for example because it only * Not playing progressive media at all, for example because it only
@ -99,18 +99,18 @@ constructor, if your app is doing one of the following:
~~~ ~~~
// Only playing DASH, HLS or SmoothStreaming. // Only playing DASH, HLS or SmoothStreaming.
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build(); new ExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build();
// Providing a customized `DefaultMediaSourceFactory` // Providing a customized `DefaultMediaSourceFactory`
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, ExtractorsFactory.EMPTY) new ExoPlayer.Builder(context, ExtractorsFactory.EMPTY)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(context, customExtractorsFactory)) new DefaultMediaSourceFactory(context, customExtractorsFactory))
.build(); .build();
// Using a MediaSource directly. // Using a MediaSource directly.
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build(); new ExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build();
ProgressiveMediaSource mediaSource = ProgressiveMediaSource mediaSource =
new ProgressiveMediaSource.Factory( new ProgressiveMediaSource.Factory(
dataSourceFactory, customExtractorsFactory) dataSourceFactory, customExtractorsFactory)

View File

@ -19,7 +19,7 @@ to the player.
~~~ ~~~
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played. // Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(ssUri)); player.setMediaItem(MediaItem.fromUri(ssUri));
// Prepare the player. // Prepare the player.
@ -47,7 +47,7 @@ MediaSource mediaSource =
new SsMediaSource.Factory(dataSourceFactory) new SsMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(ssUri)); .createMediaSource(MediaItem.fromUri(ssUri));
// Create a player instance. // Create a player instance.
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build(); SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played. // Set the media source to be played.
player.setMediaSource(mediaSource); player.setMediaSource(mediaSource);
// Prepare the player. // Prepare the player.

View File

@ -9,7 +9,7 @@ of which can be provided whenever an `ExoPlayer` is built.
~~~ ~~~
DefaultTrackSelector trackSelector = new DefaultTrackSelector(context); DefaultTrackSelector trackSelector = new DefaultTrackSelector(context);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setTrackSelector(trackSelector) .setTrackSelector(trackSelector)
.build(); .build();
~~~ ~~~

View File

@ -70,7 +70,7 @@ When a player has been initialized, it can be attached to the view by calling
~~~ ~~~
// Instantiate the player. // Instantiate the player.
player = new SimpleExoPlayer.Builder(context).build(); player = new ExoPlayer.Builder(context).build();
// Attach player to the view. // Attach player to the view.
playerView.setPlayer(player); playerView.setPlayer(player);
// Set the media source to be played. // Set the media source to be played.
@ -157,7 +157,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void initializePlayer() { private void initializePlayer() {
// Instantiate the player. // Instantiate the player.
player = new SimpleExoPlayer.Builder(context).build(); player = new ExoPlayer.Builder(context).build();
// Attach player to the view. // Attach player to the view.
playerControlView.setPlayer(player); playerControlView.setPlayer(player);
// Prepare the player with the dash media source. // Prepare the player with the dash media source.

View File

@ -74,13 +74,13 @@ Once you've followed the instructions above to check out, build and depend on
the extension, the next step is to tell ExoPlayer to use `Libgav1VideoRenderer`. the extension, the next step is to tell ExoPlayer to use `Libgav1VideoRenderer`.
How you do this depends on which player API you're using: How you do this depends on which player API you're using:
* If you're passing a `DefaultRenderersFactory` to `SimpleExoPlayer.Builder`, * If you're passing a `DefaultRenderersFactory` to `ExoPlayer.Builder`, you can
you can enable using the extension by setting the `extensionRendererMode` enable using the extension by setting the `extensionRendererMode` parameter of
parameter of the `DefaultRenderersFactory` constructor to the `DefaultRenderersFactory` constructor to `EXTENSION_RENDERER_MODE_ON`.
`EXTENSION_RENDERER_MODE_ON`. This will use `Libgav1VideoRenderer` for This will use `Libgav1VideoRenderer` for playback if `MediaCodecVideoRenderer`
playback if `MediaCodecVideoRenderer` doesn't support decoding the input AV1 doesn't support decoding the input AV1 stream. Pass
stream. Pass `EXTENSION_RENDERER_MODE_PREFER` to give `Libgav1VideoRenderer` `EXTENSION_RENDERER_MODE_PREFER` to give `Libgav1VideoRenderer` priority over
priority over `MediaCodecVideoRenderer`. `MediaCodecVideoRenderer`.
* If you've subclassed `DefaultRenderersFactory`, add a `Libvgav1VideoRenderer` * If you've subclassed `DefaultRenderersFactory`, add a `Libvgav1VideoRenderer`
to the output list in `buildVideoRenderers`. ExoPlayer will use the first to the output list in `buildVideoRenderers`. ExoPlayer will use the first
`Renderer` in the list that supports the input media format. `Renderer` in the list that supports the input media format.

View File

@ -90,13 +90,12 @@ Once you've followed the instructions above to check out, build and depend on
the extension, the next step is to tell ExoPlayer to use `FfmpegAudioRenderer`. the extension, the next step is to tell ExoPlayer to use `FfmpegAudioRenderer`.
How you do this depends on which player API you're using: How you do this depends on which player API you're using:
* If you're passing a `DefaultRenderersFactory` to `SimpleExoPlayer.Builder`, * If you're passing a `DefaultRenderersFactory` to `ExoPlayer.Builder`, you can
you can enable using the extension by setting the `extensionRendererMode` enable using the extension by setting the `extensionRendererMode` parameter of
parameter of the `DefaultRenderersFactory` constructor to the `DefaultRenderersFactory` constructor to `EXTENSION_RENDERER_MODE_ON`.
`EXTENSION_RENDERER_MODE_ON`. This will use `FfmpegAudioRenderer` for playback This will use `FfmpegAudioRenderer` for playback if `MediaCodecAudioRenderer`
if `MediaCodecAudioRenderer` doesn't support the input format. Pass doesn't support the input format. Pass `EXTENSION_RENDERER_MODE_PREFER` to
`EXTENSION_RENDERER_MODE_PREFER` to give `FfmpegAudioRenderer` priority over give `FfmpegAudioRenderer` priority over `MediaCodecAudioRenderer`.
`MediaCodecAudioRenderer`.
* If you've subclassed `DefaultRenderersFactory`, add an `FfmpegAudioRenderer` * If you've subclassed `DefaultRenderersFactory`, add an `FfmpegAudioRenderer`
to the output list in `buildAudioRenderers`. ExoPlayer will use the first to the output list in `buildAudioRenderers`. ExoPlayer will use the first
`Renderer` in the list that supports the input media format. `Renderer` in the list that supports the input media format.

View File

@ -75,13 +75,12 @@ renderer.
### Using `LibflacAudioRenderer` ### ### Using `LibflacAudioRenderer` ###
* If you're passing a `DefaultRenderersFactory` to `SimpleExoPlayer.Builder`, * If you're passing a `DefaultRenderersFactory` to `ExoPlayer.Builder`, you can
you can enable using the extension by setting the `extensionRendererMode` enable using the extension by setting the `extensionRendererMode` parameter of
parameter of the `DefaultRenderersFactory` constructor to the `DefaultRenderersFactory` constructor to `EXTENSION_RENDERER_MODE_ON`.
`EXTENSION_RENDERER_MODE_ON`. This will use `LibflacAudioRenderer` for This will use `LibflacAudioRenderer` for playback if `MediaCodecAudioRenderer`
playback if `MediaCodecAudioRenderer` doesn't support the input format. Pass doesn't support the input format. Pass `EXTENSION_RENDERER_MODE_PREFER` to
`EXTENSION_RENDERER_MODE_PREFER` to give `LibflacAudioRenderer` priority over give `LibflacAudioRenderer` priority over `MediaCodecAudioRenderer`.
`MediaCodecAudioRenderer`.
* If you've subclassed `DefaultRenderersFactory`, add a `LibflacAudioRenderer` * If you've subclassed `DefaultRenderersFactory`, add a `LibflacAudioRenderer`
to the output list in `buildAudioRenderers`. ExoPlayer will use the first to the output list in `buildAudioRenderers`. ExoPlayer will use the first
`Renderer` in the list that supports the input media format. `Renderer` in the list that supports the input media format.

View File

@ -23,6 +23,7 @@ import android.os.Looper;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -116,7 +117,7 @@ public class FlacPlaybackTest {
new Renderer[] { new Renderer[] {
new LibflacAudioRenderer(eventHandler, audioRendererEventListener, audioSink) new LibflacAudioRenderer(eventHandler, audioRendererEventListener, audioSink)
}; };
player = new SimpleExoPlayer.Builder(context, renderersFactory).build(); player = new ExoPlayer.Builder(context, renderersFactory).build();
player.addListener(this); player.addListener(this);
MediaSource mediaSource = MediaSource mediaSource =
new ProgressiveMediaSource.Factory( new ProgressiveMediaSource.Factory(

View File

@ -79,7 +79,7 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to the constructor instead. You can also * @deprecated Use a {@link ForwardingPlayer} and pass it to the constructor instead. You can also
* customize some operations when configuring the player (for example by using {@code * customize some operations when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(@Nullable ControlDispatcher controlDispatcher) { public void setControlDispatcher(@Nullable ControlDispatcher controlDispatcher) {

View File

@ -21,6 +21,7 @@ import android.os.Looper;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory; import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DataSource;
@ -69,7 +70,7 @@ import org.junit.rules.ExternalResource;
DataSource.Factory dataSourceFactory = new InstrumentingDataSourceFactory(context); DataSource.Factory dataSourceFactory = new InstrumentingDataSourceFactory(context);
exoPlayer = exoPlayer =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setLooper(Looper.myLooper()) .setLooper(Looper.myLooper())
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory)) .setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build(); .build();

View File

@ -44,6 +44,7 @@ import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
import com.google.android.exoplayer2.ControlDispatcher; import com.google.android.exoplayer2.ControlDispatcher;
import com.google.android.exoplayer2.DefaultControlDispatcher; import com.google.android.exoplayer2.DefaultControlDispatcher;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ForwardingPlayer; import com.google.android.exoplayer2.ForwardingPlayer;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -169,7 +170,7 @@ public class SessionPlayerConnectorTest {
SimpleExoPlayer simpleExoPlayer = null; SimpleExoPlayer simpleExoPlayer = null;
SessionPlayerConnector playerConnector = null; SessionPlayerConnector playerConnector = null;
try { try {
simpleExoPlayer = new SimpleExoPlayer.Builder(context).setLooper(Looper.myLooper()).build(); simpleExoPlayer = new ExoPlayer.Builder(context).setLooper(Looper.myLooper()).build();
playerConnector = playerConnector =
new SessionPlayerConnector(simpleExoPlayer, new DefaultMediaItemConverter()); new SessionPlayerConnector(simpleExoPlayer, new DefaultMediaItemConverter());
playerConnector.setControlDispatcher(controlDispatcher); playerConnector.setControlDispatcher(controlDispatcher);
@ -194,8 +195,7 @@ public class SessionPlayerConnectorTest {
Player forwardingPlayer = null; Player forwardingPlayer = null;
SessionPlayerConnector playerConnector = null; SessionPlayerConnector playerConnector = null;
try { try {
Player simpleExoPlayer = Player simpleExoPlayer = new ExoPlayer.Builder(context).setLooper(Looper.myLooper()).build();
new SimpleExoPlayer.Builder(context).setLooper(Looper.myLooper()).build();
forwardingPlayer = forwardingPlayer =
new ForwardingPlayer(simpleExoPlayer) { new ForwardingPlayer(simpleExoPlayer) {
@Override @Override

View File

@ -166,7 +166,7 @@ import java.util.List;
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to the constructor instead. You can also * @deprecated Use a {@link ForwardingPlayer} and pass it to the constructor instead. You can also
* customize some operations when configuring the player (for example by using {@code * customize some operations when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -116,7 +116,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to the constructor instead. You can also * @deprecated Use a {@link ForwardingPlayer} and pass it to the constructor instead. You can also
* customize some operations when configuring the player (for example by using {@code * customize some operations when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -176,7 +176,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations * @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or * can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code * when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* @param command The command name. * @param command The command name.
* @param extras Optional parameters for the command, may be null. * @param extras Optional parameters for the command, may be null.
* @param cb A result receiver to which a result may be sent by the command, may be null. * @param cb A result receiver to which a result may be sent by the command, may be null.
@ -299,7 +299,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations * @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or * can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code * when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
void onSkipToPrevious(Player player, @Deprecated ControlDispatcher controlDispatcher); void onSkipToPrevious(Player player, @Deprecated ControlDispatcher controlDispatcher);
/** /**
@ -309,7 +309,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations * @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or * can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code * when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
void onSkipToQueueItem(Player player, @Deprecated ControlDispatcher controlDispatcher, long id); void onSkipToQueueItem(Player player, @Deprecated ControlDispatcher controlDispatcher, long id);
/** /**
@ -319,7 +319,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations * @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or * can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code * when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
void onSkipToNext(Player player, @Deprecated ControlDispatcher controlDispatcher); void onSkipToNext(Player player, @Deprecated ControlDispatcher controlDispatcher);
} }
@ -377,7 +377,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations * @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or * can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code * when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* @param mediaButtonEvent The {@link Intent}. * @param mediaButtonEvent The {@link Intent}.
* @return True if the event was handled, false otherwise. * @return True if the event was handled, false otherwise.
*/ */
@ -397,7 +397,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations * @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or * can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code * when configuring the player (for example by using {@code
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* @param action The name of the action which was sent by a media controller. * @param action The name of the action which was sent by a media controller.
* @param extras Optional extras sent by a media controller, may be null. * @param extras Optional extras sent by a media controller, may be null.
*/ */
@ -562,7 +562,7 @@ public final class MediaSessionConnector {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead. * @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead.
* You can also customize some operations when configuring the player (for example by using * You can also customize some operations when configuring the player (for example by using
* {@code SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * {@code ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -79,13 +79,12 @@ Once you've followed the instructions above to check out, build and depend on
the extension, the next step is to tell ExoPlayer to use `LibopusAudioRenderer`. the extension, the next step is to tell ExoPlayer to use `LibopusAudioRenderer`.
How you do this depends on which player API you're using: How you do this depends on which player API you're using:
* If you're passing a `DefaultRenderersFactory` to `SimpleExoPlayer.Builder`, * If you're passing a `DefaultRenderersFactory` to `ExoPlayer.Builder`, you can
you can enable using the extension by setting the `extensionRendererMode` enable using the extension by setting the `extensionRendererMode` parameter of
parameter of the `DefaultRenderersFactory` constructor to the `DefaultRenderersFactory` constructor to `EXTENSION_RENDERER_MODE_ON`.
`EXTENSION_RENDERER_MODE_ON`. This will use `LibopusAudioRenderer` for This will use `LibopusAudioRenderer` for playback if `MediaCodecAudioRenderer`
playback if `MediaCodecAudioRenderer` doesn't support the input format. Pass doesn't support the input format. Pass `EXTENSION_RENDERER_MODE_PREFER` to
`EXTENSION_RENDERER_MODE_PREFER` to give `LibopusAudioRenderer` priority over give `LibopusAudioRenderer` priority over `MediaCodecAudioRenderer`.
`MediaCodecAudioRenderer`.
* If you've subclassed `DefaultRenderersFactory`, add a `LibopusAudioRenderer` * If you've subclassed `DefaultRenderersFactory`, add a `LibopusAudioRenderer`
to the output list in `buildAudioRenderers`. ExoPlayer will use the first to the output list in `buildAudioRenderers`. ExoPlayer will use the first
`Renderer` in the list that supports the input media format. `Renderer` in the list that supports the input media format.

View File

@ -23,6 +23,7 @@ import android.os.Looper;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -96,7 +97,7 @@ public class OpusPlaybackTest {
textRendererOutput, textRendererOutput,
metadataRendererOutput) -> metadataRendererOutput) ->
new Renderer[] {new LibopusAudioRenderer(eventHandler, audioRendererEventListener)}; new Renderer[] {new LibopusAudioRenderer(eventHandler, audioRendererEventListener)};
player = new SimpleExoPlayer.Builder(context, renderersFactory).build(); player = new ExoPlayer.Builder(context, renderersFactory).build();
player.addListener(this); player.addListener(this);
MediaSource mediaSource = MediaSource mediaSource =
new ProgressiveMediaSource.Factory( new ProgressiveMediaSource.Factory(

View File

@ -89,13 +89,13 @@ Once you've followed the instructions above to check out, build and depend on
the extension, the next step is to tell ExoPlayer to use `LibvpxVideoRenderer`. the extension, the next step is to tell ExoPlayer to use `LibvpxVideoRenderer`.
How you do this depends on which player API you're using: How you do this depends on which player API you're using:
* If you're passing a `DefaultRenderersFactory` to `SimpleExoPlayer.Builder`, * If you're passing a `DefaultRenderersFactory` to `ExoPlayer.Builder`, you can
you can enable using the extension by setting the `extensionRendererMode` enable using the extension by setting the `extensionRendererMode` parameter of
parameter of the `DefaultRenderersFactory` constructor to the `DefaultRenderersFactory` constructor to `EXTENSION_RENDERER_MODE_ON`.
`EXTENSION_RENDERER_MODE_ON`. This will use `LibvpxVideoRenderer` for playback This will use `LibvpxVideoRenderer` for playback if `MediaCodecVideoRenderer`
if `MediaCodecVideoRenderer` doesn't support decoding the input VP9 stream. doesn't support decoding the input VP9 stream. Pass
Pass `EXTENSION_RENDERER_MODE_PREFER` to give `LibvpxVideoRenderer` priority `EXTENSION_RENDERER_MODE_PREFER` to give `LibvpxVideoRenderer` priority over
over `MediaCodecVideoRenderer`. `MediaCodecVideoRenderer`.
* If you've subclassed `DefaultRenderersFactory`, add a `LibvpxVideoRenderer` * If you've subclassed `DefaultRenderersFactory`, add a `LibvpxVideoRenderer`
to the output list in `buildVideoRenderers`. ExoPlayer will use the first to the output list in `buildVideoRenderers`. ExoPlayer will use the first
`Renderer` in the list that supports the input media format. `Renderer` in the list that supports the input media format.

View File

@ -24,6 +24,7 @@ import android.os.Looper;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -130,7 +131,7 @@ public class VpxPlaybackTest {
videoRendererEventListener, videoRendererEventListener,
/* maxDroppedFramesToNotify= */ -1) /* maxDroppedFramesToNotify= */ -1)
}; };
player = new SimpleExoPlayer.Builder(context, renderersFactory).build(); player = new ExoPlayer.Builder(context, renderersFactory).build();
player.addListener(this); player.addListener(this);
MediaSource mediaSource = MediaSource mediaSource =
new ProgressiveMediaSource.Factory( new ProgressiveMediaSource.Factory(

View File

@ -59,7 +59,7 @@ public final class ClippedPlaybackTest {
getInstrumentation() getInstrumentation()
.runOnMainSync( .runOnMainSync(
() -> { () -> {
player.set(new SimpleExoPlayer.Builder(getInstrumentation().getContext()).build()); player.set(new ExoPlayer.Builder(getInstrumentation().getContext()).build());
player.get().addListener(textCapturer); player.get().addListener(textCapturer);
player.get().setMediaItem(mediaItem); player.get().setMediaItem(mediaItem);
player.get().prepare(); player.get().prepare();
@ -101,7 +101,7 @@ public final class ClippedPlaybackTest {
getInstrumentation() getInstrumentation()
.runOnMainSync( .runOnMainSync(
() -> { () -> {
player.set(new SimpleExoPlayer.Builder(getInstrumentation().getContext()).build()); player.set(new ExoPlayer.Builder(getInstrumentation().getContext()).build());
player.get().addListener(textCapturer); player.get().addListener(textCapturer);
player.get().setMediaItems(mediaItems); player.get().setMediaItems(mediaItems);
player.get().prepare(); player.get().prepare();

View File

@ -52,7 +52,7 @@ public class SimpleExoPlayerTest {
public void builder_inBackgroundThread_doesNotThrow() throws Exception { public void builder_inBackgroundThread_doesNotThrow() throws Exception {
Thread builderThread = Thread builderThread =
new Thread( new Thread(
() -> new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build()); () -> new ExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build());
AtomicReference<Throwable> builderThrow = new AtomicReference<>(); AtomicReference<Throwable> builderThrow = new AtomicReference<>();
builderThread.setUncaughtExceptionHandler((thread, throwable) -> builderThrow.set(throwable)); builderThread.setUncaughtExceptionHandler((thread, throwable) -> builderThrow.set(throwable));
@ -65,7 +65,7 @@ public class SimpleExoPlayerTest {
@Test @Test
public void onPlaylistMetadataChanged_calledWhenPlaylistMetadataSet() { public void onPlaylistMetadataChanged_calledWhenPlaylistMetadataSet() {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build(); new ExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build();
Player.Listener playerListener = mock(Player.Listener.class); Player.Listener playerListener = mock(Player.Listener.class);
player.addListener(playerListener); player.addListener(playerListener);
AnalyticsListener analyticsListener = mock(AnalyticsListener.class); AnalyticsListener analyticsListener = mock(AnalyticsListener.class);
@ -81,7 +81,7 @@ public class SimpleExoPlayerTest {
@Test @Test
public void release_triggersAllPendingEventsInAnalyticsListeners() throws Exception { public void release_triggersAllPendingEventsInAnalyticsListeners() throws Exception {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder( new ExoPlayer.Builder(
ApplicationProvider.getApplicationContext(), ApplicationProvider.getApplicationContext(),
(handler, videoListener, audioListener, textOutput, metadataOutput) -> (handler, videoListener, audioListener, textOutput, metadataOutput) ->
new Renderer[] {new FakeVideoRenderer(handler, videoListener)}) new Renderer[] {new FakeVideoRenderer(handler, videoListener)})
@ -107,7 +107,7 @@ public class SimpleExoPlayerTest {
public void releaseAfterRendererEvents_triggersPendingVideoEventsInListener() throws Exception { public void releaseAfterRendererEvents_triggersPendingVideoEventsInListener() throws Exception {
Surface surface = new Surface(new SurfaceTexture(/* texName= */ 0)); Surface surface = new Surface(new SurfaceTexture(/* texName= */ 0));
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder( new ExoPlayer.Builder(
ApplicationProvider.getApplicationContext(), ApplicationProvider.getApplicationContext(),
(handler, videoListener, audioListener, textOutput, metadataOutput) -> (handler, videoListener, audioListener, textOutput, metadataOutput) ->
new Renderer[] {new FakeVideoRenderer(handler, videoListener)}) new Renderer[] {new FakeVideoRenderer(handler, videoListener)})
@ -133,7 +133,7 @@ public class SimpleExoPlayerTest {
@Test @Test
public void releaseAfterVolumeChanges_triggerPendingVolumeEventInListener() throws Exception { public void releaseAfterVolumeChanges_triggerPendingVolumeEventInListener() throws Exception {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build(); new ExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build();
Player.Listener listener = mock(Player.Listener.class); Player.Listener listener = mock(Player.Listener.class);
player.addListener(listener); player.addListener(listener);
@ -147,7 +147,7 @@ public class SimpleExoPlayerTest {
@Test @Test
public void releaseAfterVolumeChanges_triggerPendingDeviceVolumeEventsInListener() { public void releaseAfterVolumeChanges_triggerPendingDeviceVolumeEventsInListener() {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build(); new ExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build();
Player.Listener listener = mock(Player.Listener.class); Player.Listener listener = mock(Player.Listener.class);
player.addListener(listener); player.addListener(listener);

View File

@ -69,6 +69,7 @@ import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
@ -1944,7 +1945,7 @@ public final class AnalyticsCollectorTest {
public void recursiveListenerInvocation_arrivesInCorrectOrder() { public void recursiveListenerInvocation_arrivesInCorrectOrder() {
AnalyticsCollector analyticsCollector = new AnalyticsCollector(Clock.DEFAULT); AnalyticsCollector analyticsCollector = new AnalyticsCollector(Clock.DEFAULT);
analyticsCollector.setPlayer( analyticsCollector.setPlayer(
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build(), new ExoPlayer.Builder(ApplicationProvider.getApplicationContext()).build(),
Looper.myLooper()); Looper.myLooper());
AnalyticsListener listener1 = mock(AnalyticsListener.class); AnalyticsListener listener1 = mock(AnalyticsListener.class);
AnalyticsListener listener2 = AnalyticsListener listener2 =

View File

@ -22,6 +22,7 @@ import android.media.AudioFormat;
import android.media.MediaFormat; import android.media.MediaFormat;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -87,7 +88,7 @@ public class EndToEndGaplessTest {
@Test @Test
public void testPlayback_twoIdenticalMp3Files() throws Exception { public void testPlayback_twoIdenticalMp3Files() throws Exception {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()) new ExoPlayer.Builder(ApplicationProvider.getApplicationContext())
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -64,7 +65,7 @@ public class FlacPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -55,7 +56,7 @@ public final class FlvPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -57,7 +58,7 @@ public final class MkaPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -61,7 +62,7 @@ public final class MkvPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -60,7 +61,7 @@ public final class Mp3PlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -77,7 +78,7 @@ public class Mp4PlaybackTest {
Context applicationContext = ApplicationProvider.getApplicationContext(); Context applicationContext = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(applicationContext); CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, renderersFactory) new ExoPlayer.Builder(applicationContext, renderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -58,7 +59,7 @@ public final class OggPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -18,6 +18,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -45,7 +46,7 @@ public final class PlaylistPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);
@ -67,7 +68,7 @@ public final class PlaylistPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -18,6 +18,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.robolectric.PlaybackOutput; import com.google.android.exoplayer2.robolectric.PlaybackOutput;
@ -45,7 +46,7 @@ public final class SilencePlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);
@ -66,7 +67,7 @@ public final class SilencePlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -81,7 +82,7 @@ public class TsPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));

View File

@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -59,7 +60,7 @@ public final class Vp9PlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -52,7 +53,7 @@ public final class WavPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);

View File

@ -35,6 +35,7 @@ import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -143,7 +144,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
Context context = ApplicationProvider.getApplicationContext(); Context context = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context); CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, renderersFactory) new ExoPlayer.Builder(context, renderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
@ -202,7 +203,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
Context context = ApplicationProvider.getApplicationContext(); Context context = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context); CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, renderersFactory) new ExoPlayer.Builder(context, renderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
@ -262,7 +263,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
Context context = ApplicationProvider.getApplicationContext(); Context context = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context); CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context, renderersFactory) new ExoPlayer.Builder(context, renderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
@ -319,9 +320,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
public void playbackWithSeek_isHandledCorrectly() throws Exception { public void playbackWithSeek_isHandledCorrectly() throws Exception {
Context context = ApplicationProvider.getApplicationContext(); Context context = ApplicationProvider.getApplicationContext();
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(context) new ExoPlayer.Builder(context).setClock(new FakeClock(/* isAutoAdvancing= */ true)).build();
.setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
ServerSideInsertedAdsMediaSource mediaSource = ServerSideInsertedAdsMediaSource mediaSource =

View File

@ -22,6 +22,7 @@ import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;
@ -51,7 +52,7 @@ public final class DashPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
@ -78,7 +79,7 @@ public final class DashPlaybackTest {
CapturingRenderersFactory capturingRenderersFactory = CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext); new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true)) .setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));

View File

@ -25,6 +25,7 @@ import androidx.annotation.Nullable;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -150,7 +151,7 @@ public final class RtspPlaybackTest {
private SimpleExoPlayer createSimpleExoPlayer( private SimpleExoPlayer createSimpleExoPlayer(
int serverRtspPortNumber, RtpDataChannel.Factory rtpDataChannelFactory) { int serverRtspPortNumber, RtpDataChannel.Factory rtpDataChannelFactory) {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory) new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(clock) .setClock(clock)
.build(); .build();
player.setMediaSource( player.setMediaSource(

View File

@ -37,6 +37,7 @@ import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl; import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
@ -477,7 +478,7 @@ public final class Transformer {
DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS / 10) DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS / 10)
.build(); .build();
player = player =
new SimpleExoPlayer.Builder( new ExoPlayer.Builder(
context, new TransformerRenderersFactory(muxerWrapper, transformation)) context, new TransformerRenderersFactory(muxerWrapper, transformation))
.setMediaSourceFactory(mediaSourceFactory) .setMediaSourceFactory(mediaSourceFactory)
.setTrackSelector(trackSelector) .setTrackSelector(trackSelector)

View File

@ -47,12 +47,12 @@ import android.widget.TextView;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ControlDispatcher; import com.google.android.exoplayer2.ControlDispatcher;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ExoPlayerLibraryInfo; import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
import com.google.android.exoplayer2.ForwardingPlayer; import com.google.android.exoplayer2.ForwardingPlayer;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Player.Events; import com.google.android.exoplayer2.Player.Events;
import com.google.android.exoplayer2.Player.State; import com.google.android.exoplayer2.Player.State;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.RepeatModeUtil; import com.google.android.exoplayer2.util.RepeatModeUtil;
@ -603,7 +603,7 @@ public class PlayerControlView extends FrameLayout {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead. * @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead.
* You can also customize some operations when configuring the player (for example by using * You can also customize some operations when configuring the player (for example by using
* {@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -53,9 +53,9 @@ import androidx.media.app.NotificationCompat.MediaStyle;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ControlDispatcher; import com.google.android.exoplayer2.ControlDispatcher;
import com.google.android.exoplayer2.DefaultControlDispatcher; import com.google.android.exoplayer2.DefaultControlDispatcher;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ForwardingPlayer; import com.google.android.exoplayer2.ForwardingPlayer;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.util.NotificationUtil; import com.google.android.exoplayer2.util.NotificationUtil;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
@ -819,9 +819,9 @@ public class PlayerNotificationManager {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead. * @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead.
* You can also customize some operations when configuring the player (for example by using * You can also customize some operations when configuring the player (for example by using
* {@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}), or configure whether the * {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}), or configure whether the rewind
* rewind and fast forward actions should be used with {{@link #setUseRewindAction(boolean)}} * and fast forward actions should be used with {{@link #setUseRewindAction(boolean)}} and
* and {@link #setUseFastForwardAction(boolean)}. * {@link #setUseFastForwardAction(boolean)}.
*/ */
@Deprecated @Deprecated
public final void setControlDispatcher(ControlDispatcher controlDispatcher) { public final void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -47,13 +47,13 @@ import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ControlDispatcher; import com.google.android.exoplayer2.ControlDispatcher;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ForwardingPlayer; import com.google.android.exoplayer2.ForwardingPlayer;
import com.google.android.exoplayer2.MediaMetadata; import com.google.android.exoplayer2.MediaMetadata;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Player.DiscontinuityReason; import com.google.android.exoplayer2.Player.DiscontinuityReason;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.Timeline.Period; import com.google.android.exoplayer2.Timeline.Period;
import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.source.TrackGroupArray;
@ -931,7 +931,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead. * @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead.
* You can also customize some operations when configuring the player (for example by using * You can also customize some operations when configuring the player (for example by using
* {@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -65,7 +65,6 @@ import com.google.android.exoplayer2.ForwardingPlayer;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Player.Events; import com.google.android.exoplayer2.Player.Events;
import com.google.android.exoplayer2.Player.State; import com.google.android.exoplayer2.Player.State;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.source.TrackGroup; import com.google.android.exoplayer2.source.TrackGroup;
import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.source.TrackGroupArray;
@ -836,7 +835,7 @@ public class StyledPlayerControlView extends FrameLayout {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead. * @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead.
* You can also customize some operations when configuring the player (for example by using * You can also customize some operations when configuring the player (for example by using
* {@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -48,13 +48,13 @@ import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ControlDispatcher; import com.google.android.exoplayer2.ControlDispatcher;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ForwardingPlayer; import com.google.android.exoplayer2.ForwardingPlayer;
import com.google.android.exoplayer2.MediaMetadata; import com.google.android.exoplayer2.MediaMetadata;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Player.DiscontinuityReason; import com.google.android.exoplayer2.Player.DiscontinuityReason;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.Timeline.Period; import com.google.android.exoplayer2.Timeline.Period;
import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.source.TrackGroupArray;
@ -949,7 +949,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
/** /**
* @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead. * @deprecated Use a {@link ForwardingPlayer} and pass it to {@link #setPlayer(Player)} instead.
* You can also customize some operations when configuring the player (for example by using * You can also customize some operations when configuring the player (for example by using
* {@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}). * {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/ */
@Deprecated @Deprecated
public void setControlDispatcher(ControlDispatcher controlDispatcher) { public void setControlDispatcher(ControlDispatcher controlDispatcher) {

View File

@ -25,6 +25,7 @@ import androidx.annotation.RequiresApi;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.RendererCapabilities; import com.google.android.exoplayer2.RendererCapabilities;
@ -314,7 +315,7 @@ import java.util.List;
protected SimpleExoPlayer buildExoPlayer( protected SimpleExoPlayer buildExoPlayer(
HostActivity host, Surface surface, MappingTrackSelector trackSelector) { HostActivity host, Surface surface, MappingTrackSelector trackSelector) {
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(host, new DebugRenderersFactory(host)) new ExoPlayer.Builder(host, new DebugRenderersFactory(host))
.setTrackSelector(trackSelector) .setTrackSelector(trackSelector)
.build(); .build();
player.setVideoSurface(surface); player.setVideoSurface(surface);

View File

@ -248,7 +248,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
renderersFactory.setExtensionRendererMode(DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF); renderersFactory.setExtensionRendererMode(DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF);
renderersFactory.setAllowedVideoJoiningTimeMs(/* allowedVideoJoiningTimeMs= */ 0); renderersFactory.setAllowedVideoJoiningTimeMs(/* allowedVideoJoiningTimeMs= */ 0);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(host, renderersFactory).setTrackSelector(trackSelector).build(); new ExoPlayer.Builder(host, renderersFactory).setTrackSelector(trackSelector).build();
player.setVideoSurface(surface); player.setVideoSurface(surface);
return player; return player;
} }

View File

@ -22,6 +22,7 @@ import android.os.Looper;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl; import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.LoadControl; import com.google.android.exoplayer2.LoadControl;
import com.google.android.exoplayer2.Renderer; import com.google.android.exoplayer2.Renderer;
import com.google.android.exoplayer2.RenderersFactory; import com.google.android.exoplayer2.RenderersFactory;
@ -276,7 +277,7 @@ public class TestExoPlayerBuilder {
}; };
} }
return new SimpleExoPlayer.Builder(context, playerRenderersFactory) return new ExoPlayer.Builder(context, playerRenderersFactory)
.setTrackSelector(trackSelector) .setTrackSelector(trackSelector)
.setLoadControl(loadControl) .setLoadControl(loadControl)
.setBandwidthMeter(bandwidthMeter) .setBandwidthMeter(bandwidthMeter)