Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
01613a2e
authored
Aug 11, 2021
by
kimvde
Committed by
Oliver Woodman
Aug 11, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
parent
7dffb2dc
Hide whitespace changes
Inline
Side-by-side
Showing
62 changed files
with
162 additions
and
140 deletions
demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/PlayerManager.java
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/MainActivity.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java
demos/surface/src/main/java/com/google/android/exoplayer2/surfacedemo/MainActivity.java
docs/ad-insertion.md
docs/analytics.md
docs/customization.md
docs/dash.md
docs/downloading-media.md
docs/hello-world.md
docs/hls.md
docs/live-streaming.md
docs/media-sources.md
docs/network-stacks.md
docs/progressive.md
docs/rtsp.md
docs/shrinking.md
docs/smoothstreaming.md
docs/track-selection.md
docs/ui-components.md
extensions/av1/README.md
extensions/ffmpeg/README.md
extensions/flac/README.md
extensions/flac/src/androidTest/java/com/google/android/exoplayer2/ext/flac/FlacPlaybackTest.java
extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/PlayerTestRule.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnectorTest.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerWrapper.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnector.java
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
extensions/opus/README.md
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
extensions/vp9/README.md
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/SimpleExoPlayerTest.java
library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/EndToEndGaplessTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlacPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlvPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/MkaPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/MkvPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Mp3PlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Mp4PlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/OggPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/PlaylistPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/SilencePlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/TsPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Vp9PlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/e2etest/WavPlaybackTest.java
library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideInsertedAdMediaSourceTest.java
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/e2etest/DashPlaybackTest.java
library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspPlaybackTest.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashTestRunner.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestExoPlayerBuilder.java
demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/PlayerManager.java
View file @
01613a2e
...
...
@@ -21,6 +21,7 @@ import android.view.View;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
...
...
@@ -94,7 +95,7 @@ import java.util.ArrayList;
currentItemIndex
=
C
.
INDEX_UNSET
;
trackSelector
=
new
DefaultTrackSelector
(
context
);
exoPlayer
=
new
Simple
ExoPlayer
.
Builder
(
context
).
setTrackSelector
(
trackSelector
).
build
();
exoPlayer
=
new
ExoPlayer
.
Builder
(
context
).
setTrackSelector
(
trackSelector
).
build
();
exoPlayer
.
addListener
(
this
);
localPlayerView
.
setPlayer
(
exoPlayer
);
...
...
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/MainActivity.java
View file @
01613a2e
...
...
@@ -24,6 +24,7 @@ import android.widget.FrameLayout;
import
android.widget.Toast
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -172,7 +173,7 @@ public final class MainActivity extends Activity {
throw
new
IllegalStateException
();
}
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
getApplicationContext
()).
build
();
SimpleExoPlayer
player
=
new
ExoPlayer
.
Builder
(
getApplicationContext
()).
build
();
player
.
setRepeatMode
(
Player
.
REPEAT_MODE_ALL
);
player
.
setMediaSource
(
mediaSource
);
player
.
prepare
();
...
...
demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java
View file @
01613a2e
...
...
@@ -32,6 +32,7 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -272,7 +273,7 @@ public class PlayerActivity extends AppCompatActivity
trackSelector
.
setParameters
(
trackSelectorParameters
);
lastSeenTrackGroupArray
=
null
;
player
=
new
Simple
ExoPlayer
.
Builder
(
/* context= */
this
,
renderersFactory
)
new
ExoPlayer
.
Builder
(
/* context= */
this
,
renderersFactory
)
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
setTrackSelector
(
trackSelector
)
.
build
();
...
...
demos/surface/src/main/java/com/google/android/exoplayer2/surfacedemo/MainActivity.java
View file @
01613a2e
...
...
@@ -28,6 +28,7 @@ import android.widget.Button;
import
android.widget.GridLayout
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -216,7 +217,7 @@ public final class MainActivity extends Activity {
}
else
{
throw
new
IllegalStateException
();
}
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
getApplicationContext
()).
build
();
SimpleExoPlayer
player
=
new
ExoPlayer
.
Builder
(
getApplicationContext
()).
build
();
player
.
setMediaSource
(
mediaSource
);
player
.
prepare
();
player
.
play
();
...
...
docs/ad-insertion.md
View file @
01613a2e
...
...
@@ -49,7 +49,7 @@ MediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(context)
.setAdsLoaderProvider(adsLoaderProvider)
.setAdViewProvider(playerView);
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory)
.build();
~~~
...
...
docs/analytics.md
View file @
01613a2e
...
...
@@ -246,7 +246,7 @@ class ExtendedCollector extends AnalyticsCollector {
}
// Usage - Setup and listener registration.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setAnalyticsCollector(new ExtendedCollector())
.build();
player.addAnalyticsListener(new ExtendedListener() {
...
...
docs/customization.md
View file @
01613a2e
...
...
@@ -60,7 +60,7 @@ DefaultDataSource.Factory dataSourceFactory =
// Inject the DefaultDataSourceFactory when creating the player.
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
~~~
...
...
@@ -82,7 +82,7 @@ DataSource.Factory cacheDataSourceFactory =
.setCache(simpleCache)
.setUpstreamDataSourceFactory(httpDataSourceFactory);
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(cacheDataSourceFactory))
.build();
...
...
@@ -107,7 +107,7 @@ DataSource.Factory dataSourceFactory = () -> {
return dataSource;
};
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
~~~
...
...
@@ -158,7 +158,7 @@ LoadErrorHandlingPolicy loadErrorHandlingPolicy =
};
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(context)
.setLoadErrorHandlingPolicy(loadErrorHandlingPolicy))
...
...
@@ -181,7 +181,7 @@ DefaultExtractorsFactory extractorsFactory =
new DefaultExtractorsFactory()
.setMp3ExtractorFlags(Mp3Extractor.FLAG_ENABLE_INDEX_SEEKING);
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(context, extractorsFactory))
.build();
...
...
docs/dash.md
View file @
01613a2e
...
...
@@ -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.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(dashUri));
// Prepare the player.
...
...
@@ -45,7 +45,7 @@ MediaSource mediaSource =
new DashMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(dashUri));
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(mediaSource);
// Prepare the player.
...
...
docs/downloading-media.md
View file @
01613a2e
...
...
@@ -322,7 +322,7 @@ DataSource.Factory cacheDataSourceFactory =
.setUpstreamDataSourceFactory(httpDataSourceFactory)
.setCacheWriteDataSinkFactory(null); // Disable writing.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(cacheDataSourceFactory))
.build();
...
...
docs/hello-world.md
View file @
01613a2e
...
...
@@ -92,12 +92,12 @@ to prevent build errors.
## Creating the player ##
You can create an
`ExoPlayer`
instance using
`
SimpleExoPlayer.Builder`
, which
provides a range of customization options. The code below is the simplest
example of
creating an instance.
You can create an
`ExoPlayer`
instance using
`
ExoPlayer.Builder`
, which provides
a range of customization options. The code below is the simplest example of
creating an instance.
~~~
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
~~~
{: .language-java}
...
...
docs/hls.md
View file @
01613a2e
...
...
@@ -18,7 +18,7 @@ player.
~~~
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(hlsUri));
// Prepare the player.
...
...
@@ -48,7 +48,7 @@ HlsMediaSource hlsMediaSource =
new HlsMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(hlsUri));
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(hlsMediaSource);
// Prepare the player.
...
...
docs/live-streaming.md
View file @
01613a2e
...
...
@@ -97,7 +97,7 @@ values will override parameters defined by the media.
~~~
// Global settings.
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(context).setLiveTargetOffsetMs(5000))
.build();
...
...
@@ -164,7 +164,7 @@ instance can be set when building the player:
~~~
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setLivePlaybackSpeedControl(
new DefaultLivePlaybackSpeedControl.Builder()
.setFallbackMaxPlaybackSpeed(1.04f)
...
...
docs/media-sources.md
View file @
01613a2e
...
...
@@ -37,7 +37,7 @@ MediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(cacheDataSourceFactory)
.setAdsLoaderProvider(adsLoaderProvider)
.setAdViewProvider(playerView);
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory)
.build();
~~~
...
...
docs/network-stacks.md
View file @
01613a2e
...
...
@@ -50,7 +50,7 @@ DefaultDataSource.Factory dataSourceFactory =
// Inject the DefaultDataSourceFactory when creating the player.
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
~~~
...
...
docs/progressive.md
View file @
01613a2e
...
...
@@ -11,7 +11,7 @@ it to the player.
~~~
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(progressiveUri));
// Prepare the player.
...
...
@@ -31,7 +31,7 @@ DataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory();
MediaSource mediaSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(progressiveUri));
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(mediaSource);
// Prepare the player.
...
...
docs/rtsp.md
View file @
01613a2e
...
...
@@ -17,7 +17,7 @@ You can then create a `MediaItem` for an RTSP URI and pass it to the player.
~~~
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(rtspUri));
// Prepare the player.
...
...
@@ -43,7 +43,7 @@ MediaSource mediaSource =
new RtspMediaSource.Factory()
.createMediaSource(MediaItem.fromUri(rtspUri));
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(mediaSource);
// Prepare the player.
...
...
docs/shrinking.md
View file @
01613a2e
...
...
@@ -59,7 +59,7 @@ RenderersFactory audioOnlyRenderersFactory =
context, MediaCodecSelector.DEFAULT, handler, audioListener)
};
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context, audioOnlyRenderersFactory).build();
new ExoPlayer.Builder(context, audioOnlyRenderersFactory).build();
~~~
{: .language-java}
...
...
@@ -81,14 +81,14 @@ an app that only needs to play mp4 files can provide a factory like:
ExtractorsFactory mp4ExtractorFactory =
() -> new Extractor[] {new Mp4Extractor()};
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context, mp4ExtractorFactory).build();
new ExoPlayer.Builder(context, mp4ExtractorFactory).build();
~~~
{: .language-java}
This will allow other
`Extractor`
implementations to be removed by code
shrinking, which can result in a significant reduction in size.
You should pass
`ExtractorsFactory.EMPTY`
to the
`
Simple
ExoPlayer.Builder`
You should pass
`ExtractorsFactory.EMPTY`
to the
`ExoPlayer.Builder`
constructor, if your app is doing one of the following:
*
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.
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build();
new ExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build();
// Providing a customized `DefaultMediaSourceFactory`
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context, ExtractorsFactory.EMPTY)
new ExoPlayer.Builder(context, ExtractorsFactory.EMPTY)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(context, customExtractorsFactory))
.build();
// Using a MediaSource directly.
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build();
new ExoPlayer.Builder(context, ExtractorsFactory.EMPTY).build();
ProgressiveMediaSource mediaSource =
new ProgressiveMediaSource.Factory(
dataSourceFactory, customExtractorsFactory)
...
...
docs/smoothstreaming.md
View file @
01613a2e
...
...
@@ -19,7 +19,7 @@ to the player.
~~~
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(ssUri));
// Prepare the player.
...
...
@@ -47,7 +47,7 @@ MediaSource mediaSource =
new SsMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(ssUri));
// Create a player instance.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(mediaSource);
// Prepare the player.
...
...
docs/track-selection.md
View file @
01613a2e
...
...
@@ -9,7 +9,7 @@ of which can be provided whenever an `ExoPlayer` is built.
~~~
DefaultTrackSelector trackSelector = new DefaultTrackSelector(context);
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setTrackSelector(trackSelector)
.build();
~~~
...
...
docs/ui-components.md
View file @
01613a2e
...
...
@@ -70,7 +70,7 @@ When a player has been initialized, it can be attached to the view by calling
~~~
// Instantiate the player.
player = new
Simple
ExoPlayer.Builder(context).build();
player = new ExoPlayer.Builder(context).build();
// Attach player to the view.
playerView.setPlayer(player);
// Set the media source to be played.
...
...
@@ -157,7 +157,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void initializePlayer() {
// Instantiate the player.
player = new
Simple
ExoPlayer.Builder(context).build();
player = new ExoPlayer.Builder(context).build();
// Attach player to the view.
playerControlView.setPlayer(player);
// Prepare the player with the dash media source.
...
...
extensions/av1/README.md
View file @
01613a2e
...
...
@@ -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`
.
How you do this depends on which player API you're using:
*
If you're passing a
`DefaultRenderersFactory`
to
`
SimpleExoPlayer.Builder`
,
you can enable using the extension by setting the
`extensionRendererMode`
parameter of the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
. This will use
`Libgav1VideoRenderer`
for
playback if
`MediaCodecVideoRenderer`
doesn't support decoding the input AV1
stream. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`Libgav1VideoRenderer`
priority over
`MediaCodecVideoRenderer`
.
*
If you're passing a
`DefaultRenderersFactory`
to
`
ExoPlayer.Builder`
, you can
enable using the extension by setting the
`extensionRendererMode`
parameter of
the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
.
This will use
`Libgav1VideoRenderer`
for playback if
`MediaCodecVideoRenderer`
doesn't support decoding the input AV1 stream. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`Libgav1VideoRenderer`
priority over
`MediaCodecVideoRenderer`
.
*
If you've subclassed
`DefaultRenderersFactory`
, add a
`Libvgav1VideoRenderer`
to the output list in
`buildVideoRenderers`
. ExoPlayer will use the first
`Renderer`
in the list that supports the input media format.
...
...
extensions/ffmpeg/README.md
View file @
01613a2e
...
...
@@ -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`
.
How you do this depends on which player API you're using:
*
If you're passing a
`DefaultRenderersFactory`
to
`SimpleExoPlayer.Builder`
,
you can enable using the extension by setting the
`extensionRendererMode`
parameter of the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
. This will use
`FfmpegAudioRenderer`
for playback
if
`MediaCodecAudioRenderer`
doesn't support the input format. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`FfmpegAudioRenderer`
priority over
`MediaCodecAudioRenderer`
.
*
If you're passing a
`DefaultRenderersFactory`
to
`ExoPlayer.Builder`
, you can
enable using the extension by setting the
`extensionRendererMode`
parameter of
the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
.
This will use
`FfmpegAudioRenderer`
for playback if
`MediaCodecAudioRenderer`
doesn't support the input format. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to
give
`FfmpegAudioRenderer`
priority over
`MediaCodecAudioRenderer`
.
*
If you've subclassed
`DefaultRenderersFactory`
, add an
`FfmpegAudioRenderer`
to the output list in
`buildAudioRenderers`
. ExoPlayer will use the first
`Renderer`
in the list that supports the input media format.
...
...
extensions/flac/README.md
View file @
01613a2e
...
...
@@ -75,13 +75,12 @@ renderer.
### Using `LibflacAudioRenderer` ###
*
If you're passing a
`DefaultRenderersFactory`
to
`SimpleExoPlayer.Builder`
,
you can enable using the extension by setting the
`extensionRendererMode`
parameter of the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
. This will use
`LibflacAudioRenderer`
for
playback if
`MediaCodecAudioRenderer`
doesn't support the input format. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`LibflacAudioRenderer`
priority over
`MediaCodecAudioRenderer`
.
*
If you're passing a
`DefaultRenderersFactory`
to
`ExoPlayer.Builder`
, you can
enable using the extension by setting the
`extensionRendererMode`
parameter of
the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
.
This will use
`LibflacAudioRenderer`
for playback if
`MediaCodecAudioRenderer`
doesn't support the input format. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to
give
`LibflacAudioRenderer`
priority over
`MediaCodecAudioRenderer`
.
*
If you've subclassed
`DefaultRenderersFactory`
, add a
`LibflacAudioRenderer`
to the output list in
`buildAudioRenderers`
. ExoPlayer will use the first
`Renderer`
in the list that supports the input media format.
...
...
extensions/flac/src/androidTest/java/com/google/android/exoplayer2/ext/flac/FlacPlaybackTest.java
View file @
01613a2e
...
...
@@ -23,6 +23,7 @@ import android.os.Looper;
import
androidx.annotation.Nullable
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -116,7 +117,7 @@ public class FlacPlaybackTest {
new
Renderer
[]
{
new
LibflacAudioRenderer
(
eventHandler
,
audioRendererEventListener
,
audioSink
)
};
player
=
new
Simple
ExoPlayer
.
Builder
(
context
,
renderersFactory
).
build
();
player
=
new
ExoPlayer
.
Builder
(
context
,
renderersFactory
).
build
();
player
.
addListener
(
this
);
MediaSource
mediaSource
=
new
ProgressiveMediaSource
.
Factory
(
...
...
extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java
View file @
01613a2e
...
...
@@ -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
* customize some operations when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
@Nullable
ControlDispatcher
controlDispatcher
)
{
...
...
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/PlayerTestRule.java
View file @
01613a2e
...
...
@@ -21,6 +21,7 @@ import android.os.Looper;
import
androidx.annotation.Nullable
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
import
com.google.android.exoplayer2.source.DefaultMediaSourceFactory
;
import
com.google.android.exoplayer2.upstream.DataSource
;
...
...
@@ -69,7 +70,7 @@ import org.junit.rules.ExternalResource;
DataSource
.
Factory
dataSourceFactory
=
new
InstrumentingDataSourceFactory
(
context
);
exoPlayer
=
new
Simple
ExoPlayer
.
Builder
(
context
)
new
ExoPlayer
.
Builder
(
context
)
.
setLooper
(
Looper
.
myLooper
())
.
setMediaSourceFactory
(
new
DefaultMediaSourceFactory
(
dataSourceFactory
))
.
build
();
...
...
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnectorTest.java
View file @
01613a2e
...
...
@@ -44,6 +44,7 @@ import androidx.test.filters.SmallTest;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.DefaultControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -169,7 +170,7 @@ public class SessionPlayerConnectorTest {
SimpleExoPlayer
simpleExoPlayer
=
null
;
SessionPlayerConnector
playerConnector
=
null
;
try
{
simpleExoPlayer
=
new
Simple
ExoPlayer
.
Builder
(
context
).
setLooper
(
Looper
.
myLooper
()).
build
();
simpleExoPlayer
=
new
ExoPlayer
.
Builder
(
context
).
setLooper
(
Looper
.
myLooper
()).
build
();
playerConnector
=
new
SessionPlayerConnector
(
simpleExoPlayer
,
new
DefaultMediaItemConverter
());
playerConnector
.
setControlDispatcher
(
controlDispatcher
);
...
...
@@ -194,8 +195,7 @@ public class SessionPlayerConnectorTest {
Player
forwardingPlayer
=
null
;
SessionPlayerConnector
playerConnector
=
null
;
try
{
Player
simpleExoPlayer
=
new
SimpleExoPlayer
.
Builder
(
context
).
setLooper
(
Looper
.
myLooper
()).
build
();
Player
simpleExoPlayer
=
new
ExoPlayer
.
Builder
(
context
).
setLooper
(
Looper
.
myLooper
()).
build
();
forwardingPlayer
=
new
ForwardingPlayer
(
simpleExoPlayer
)
{
@Override
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerWrapper.java
View file @
01613a2e
...
...
@@ -166,7 +166,7 @@ import java.util.List;
/**
* @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
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnector.java
View file @
01613a2e
...
...
@@ -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
* customize some operations when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
View file @
01613a2e
...
...
@@ -176,7 +176,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* @param command The command name.
* @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.
...
...
@@ -299,7 +299,7 @@ public final class MediaSessionConnector {
* @param controlDispatcher This parameter is deprecated. Use {@code player} instead. Operations
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
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
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
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
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
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
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* @param mediaButtonEvent The {@link Intent}.
* @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
* can be customized by passing a {@link ForwardingPlayer} to {@link #setPlayer(Player)}, or
* when configuring the player (for example by using {@code
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* @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.
*/
...
...
@@ -562,7 +562,7 @@ public final class MediaSessionConnector {
/**
* @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
* {@code
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@code ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
extensions/opus/README.md
View file @
01613a2e
...
...
@@ -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`
.
How you do this depends on which player API you're using:
*
If you're passing a
`DefaultRenderersFactory`
to
`SimpleExoPlayer.Builder`
,
you can enable using the extension by setting the
`extensionRendererMode`
parameter of the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
. This will use
`LibopusAudioRenderer`
for
playback if
`MediaCodecAudioRenderer`
doesn't support the input format. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`LibopusAudioRenderer`
priority over
`MediaCodecAudioRenderer`
.
*
If you're passing a
`DefaultRenderersFactory`
to
`ExoPlayer.Builder`
, you can
enable using the extension by setting the
`extensionRendererMode`
parameter of
the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
.
This will use
`LibopusAudioRenderer`
for playback if
`MediaCodecAudioRenderer`
doesn't support the input format. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to
give
`LibopusAudioRenderer`
priority over
`MediaCodecAudioRenderer`
.
*
If you've subclassed
`DefaultRenderersFactory`
, add a
`LibopusAudioRenderer`
to the output list in
`buildAudioRenderers`
. ExoPlayer will use the first
`Renderer`
in the list that supports the input media format.
...
...
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
View file @
01613a2e
...
...
@@ -23,6 +23,7 @@ import android.os.Looper;
import
androidx.annotation.Nullable
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -96,7 +97,7 @@ public class OpusPlaybackTest {
textRendererOutput
,
metadataRendererOutput
)
->
new
Renderer
[]
{
new
LibopusAudioRenderer
(
eventHandler
,
audioRendererEventListener
)};
player
=
new
Simple
ExoPlayer
.
Builder
(
context
,
renderersFactory
).
build
();
player
=
new
ExoPlayer
.
Builder
(
context
,
renderersFactory
).
build
();
player
.
addListener
(
this
);
MediaSource
mediaSource
=
new
ProgressiveMediaSource
.
Factory
(
...
...
extensions/vp9/README.md
View file @
01613a2e
...
...
@@ -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`
.
How you do this depends on which player API you're using:
*
If you're passing a
`DefaultRenderersFactory`
to
`
SimpleExoPlayer.Builder`
,
you can enable using the extension by setting the
`extensionRendererMode`
parameter of the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
. This will use
`LibvpxVideoRenderer`
for playback
if
`MediaCodecVideoRenderer`
doesn't support decoding the input VP9 stream.
Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`LibvpxVideoRenderer`
priority
over
`MediaCodecVideoRenderer`
.
*
If you're passing a
`DefaultRenderersFactory`
to
`
ExoPlayer.Builder`
, you can
enable using the extension by setting the
`extensionRendererMode`
parameter of
the
`DefaultRenderersFactory`
constructor to
`EXTENSION_RENDERER_MODE_ON`
.
This will use
`LibvpxVideoRenderer`
for playback if
`MediaCodecVideoRenderer`
doesn't support decoding the input VP9 stream. Pass
`EXTENSION_RENDERER_MODE_PREFER`
to give
`LibvpxVideoRenderer`
priority over
`MediaCodecVideoRenderer`
.
*
If you've subclassed
`DefaultRenderersFactory`
, add a
`LibvpxVideoRenderer`
to the output list in
`buildVideoRenderers`
. ExoPlayer will use the first
`Renderer`
in the list that supports the input media format.
...
...
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
View file @
01613a2e
...
...
@@ -24,6 +24,7 @@ import android.os.Looper;
import
androidx.annotation.Nullable
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -130,7 +131,7 @@ public class VpxPlaybackTest {
videoRendererEventListener
,
/* maxDroppedFramesToNotify= */
-
1
)
};
player
=
new
Simple
ExoPlayer
.
Builder
(
context
,
renderersFactory
).
build
();
player
=
new
ExoPlayer
.
Builder
(
context
,
renderersFactory
).
build
();
player
.
addListener
(
this
);
MediaSource
mediaSource
=
new
ProgressiveMediaSource
.
Factory
(
...
...
library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java
View file @
01613a2e
...
...
@@ -59,7 +59,7 @@ public final class ClippedPlaybackTest {
getInstrumentation
()
.
runOnMainSync
(
()
->
{
player
.
set
(
new
Simple
ExoPlayer
.
Builder
(
getInstrumentation
().
getContext
()).
build
());
player
.
set
(
new
ExoPlayer
.
Builder
(
getInstrumentation
().
getContext
()).
build
());
player
.
get
().
addListener
(
textCapturer
);
player
.
get
().
setMediaItem
(
mediaItem
);
player
.
get
().
prepare
();
...
...
@@ -101,7 +101,7 @@ public final class ClippedPlaybackTest {
getInstrumentation
()
.
runOnMainSync
(
()
->
{
player
.
set
(
new
Simple
ExoPlayer
.
Builder
(
getInstrumentation
().
getContext
()).
build
());
player
.
set
(
new
ExoPlayer
.
Builder
(
getInstrumentation
().
getContext
()).
build
());
player
.
get
().
addListener
(
textCapturer
);
player
.
get
().
setMediaItems
(
mediaItems
);
player
.
get
().
prepare
();
...
...
library/core/src/test/java/com/google/android/exoplayer2/SimpleExoPlayerTest.java
View file @
01613a2e
...
...
@@ -52,7 +52,7 @@ public class SimpleExoPlayerTest {
public
void
builder_inBackgroundThread_doesNotThrow
()
throws
Exception
{
Thread
builderThread
=
new
Thread
(
()
->
new
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
());
()
->
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
());
AtomicReference
<
Throwable
>
builderThrow
=
new
AtomicReference
<>();
builderThread
.
setUncaughtExceptionHandler
((
thread
,
throwable
)
->
builderThrow
.
set
(
throwable
));
...
...
@@ -65,7 +65,7 @@ public class SimpleExoPlayerTest {
@Test
public
void
onPlaylistMetadataChanged_calledWhenPlaylistMetadataSet
()
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
();
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
();
Player
.
Listener
playerListener
=
mock
(
Player
.
Listener
.
class
);
player
.
addListener
(
playerListener
);
AnalyticsListener
analyticsListener
=
mock
(
AnalyticsListener
.
class
);
...
...
@@ -81,7 +81,7 @@ public class SimpleExoPlayerTest {
@Test
public
void
release_triggersAllPendingEventsInAnalyticsListeners
()
throws
Exception
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
(),
(
handler
,
videoListener
,
audioListener
,
textOutput
,
metadataOutput
)
->
new
Renderer
[]
{
new
FakeVideoRenderer
(
handler
,
videoListener
)})
...
...
@@ -107,7 +107,7 @@ public class SimpleExoPlayerTest {
public
void
releaseAfterRendererEvents_triggersPendingVideoEventsInListener
()
throws
Exception
{
Surface
surface
=
new
Surface
(
new
SurfaceTexture
(
/* texName= */
0
));
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
(),
(
handler
,
videoListener
,
audioListener
,
textOutput
,
metadataOutput
)
->
new
Renderer
[]
{
new
FakeVideoRenderer
(
handler
,
videoListener
)})
...
...
@@ -133,7 +133,7 @@ public class SimpleExoPlayerTest {
@Test
public
void
releaseAfterVolumeChanges_triggerPendingVolumeEventInListener
()
throws
Exception
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
();
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
();
Player
.
Listener
listener
=
mock
(
Player
.
Listener
.
class
);
player
.
addListener
(
listener
);
...
...
@@ -147,7 +147,7 @@ public class SimpleExoPlayerTest {
@Test
public
void
releaseAfterVolumeChanges_triggerPendingDeviceVolumeEventsInListener
()
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
();
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
();
Player
.
Listener
listener
=
mock
(
Player
.
Listener
.
class
);
player
.
addListener
(
listener
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java
View file @
01613a2e
...
...
@@ -69,6 +69,7 @@ import androidx.test.core.app.ApplicationProvider;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
...
...
@@ -1944,7 +1945,7 @@ public final class AnalyticsCollectorTest {
public
void
recursiveListenerInvocation_arrivesInCorrectOrder
()
{
AnalyticsCollector
analyticsCollector
=
new
AnalyticsCollector
(
Clock
.
DEFAULT
);
analyticsCollector
.
setPlayer
(
new
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
(),
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
()).
build
(),
Looper
.
myLooper
());
AnalyticsListener
listener1
=
mock
(
AnalyticsListener
.
class
);
AnalyticsListener
listener2
=
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/EndToEndGaplessTest.java
View file @
01613a2e
...
...
@@ -22,6 +22,7 @@ import android.media.AudioFormat;
import
android.media.MediaFormat
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -87,7 +88,7 @@ public class EndToEndGaplessTest {
@Test
public
void
testPlayback_twoIdenticalMp3Files
()
throws
Exception
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
())
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
())
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlacPlaybackTest.java
View file @
01613a2e
...
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -64,7 +65,7 @@ public class FlacPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlvPlaybackTest.java
View file @
01613a2e
...
...
@@ -19,6 +19,7 @@ import android.content.Context;
import
android.graphics.SurfaceTexture
;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -55,7 +56,7 @@ public final class FlvPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/MkaPlaybackTest.java
View file @
01613a2e
...
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -57,7 +58,7 @@ public final class MkaPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/MkvPlaybackTest.java
View file @
01613a2e
...
...
@@ -19,6 +19,7 @@ import android.content.Context;
import
android.graphics.SurfaceTexture
;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -61,7 +62,7 @@ public final class MkvPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Mp3PlaybackTest.java
View file @
01613a2e
...
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -60,7 +61,7 @@ public final class Mp3PlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Mp4PlaybackTest.java
View file @
01613a2e
...
...
@@ -19,6 +19,7 @@ import android.content.Context;
import
android.graphics.SurfaceTexture
;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -77,7 +78,7 @@ public class Mp4PlaybackTest {
Context
applicationContext
=
ApplicationProvider
.
getApplicationContext
();
CapturingRenderersFactory
renderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
renderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
renderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/OggPlaybackTest.java
View file @
01613a2e
...
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -58,7 +59,7 @@ public final class OggPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/PlaylistPlaybackTest.java
View file @
01613a2e
...
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -45,7 +46,7 @@ public final class PlaylistPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
@@ -67,7 +68,7 @@ public final class PlaylistPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/SilencePlaybackTest.java
View file @
01613a2e
...
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
import
com.google.android.exoplayer2.robolectric.PlaybackOutput
;
...
...
@@ -45,7 +46,7 @@ public final class SilencePlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
@@ -66,7 +67,7 @@ public final class SilencePlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/TsPlaybackTest.java
View file @
01613a2e
...
...
@@ -19,6 +19,7 @@ import android.content.Context;
import
android.graphics.SurfaceTexture
;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -81,7 +82,7 @@ public class TsPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Vp9PlaybackTest.java
View file @
01613a2e
...
...
@@ -19,6 +19,7 @@ import android.content.Context;
import
android.graphics.SurfaceTexture
;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -59,7 +60,7 @@ public final class Vp9PlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/WavPlaybackTest.java
View file @
01613a2e
...
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import
android.content.Context
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -52,7 +53,7 @@ public final class WavPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
capturingRenderersFactory
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideInsertedAdMediaSourceTest.java
View file @
01613a2e
...
...
@@ -35,6 +35,7 @@ import android.graphics.SurfaceTexture;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -143,7 +144,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
Context
context
=
ApplicationProvider
.
getApplicationContext
();
CapturingRenderersFactory
renderersFactory
=
new
CapturingRenderersFactory
(
context
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
context
,
renderersFactory
)
new
ExoPlayer
.
Builder
(
context
,
renderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
@@ -202,7 +203,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
Context
context
=
ApplicationProvider
.
getApplicationContext
();
CapturingRenderersFactory
renderersFactory
=
new
CapturingRenderersFactory
(
context
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
context
,
renderersFactory
)
new
ExoPlayer
.
Builder
(
context
,
renderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
@@ -262,7 +263,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
Context
context
=
ApplicationProvider
.
getApplicationContext
();
CapturingRenderersFactory
renderersFactory
=
new
CapturingRenderersFactory
(
context
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
context
,
renderersFactory
)
new
ExoPlayer
.
Builder
(
context
,
renderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
@@ -319,9 +320,7 @@ public final class ServerSideInsertedAdMediaSourceTest {
public
void
playbackWithSeek_isHandledCorrectly
()
throws
Exception
{
Context
context
=
ApplicationProvider
.
getApplicationContext
();
SimpleExoPlayer
player
=
new
SimpleExoPlayer
.
Builder
(
context
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
new
ExoPlayer
.
Builder
(
context
).
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
)).
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
ServerSideInsertedAdsMediaSource
mediaSource
=
...
...
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/e2etest/DashPlaybackTest.java
View file @
01613a2e
...
...
@@ -22,6 +22,7 @@ import android.graphics.SurfaceTexture;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
...
...
@@ -51,7 +52,7 @@ public final class DashPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
@@ -78,7 +79,7 @@ public final class DashPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
...
...
library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspPlaybackTest.java
View file @
01613a2e
...
...
@@ -25,6 +25,7 @@ import androidx.annotation.Nullable;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -150,7 +151,7 @@ public final class RtspPlaybackTest {
private
SimpleExoPlayer
createSimpleExoPlayer
(
int
serverRtspPortNumber
,
RtpDataChannel
.
Factory
rtpDataChannelFactory
)
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
clock
)
.
build
();
player
.
setMediaSource
(
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
View file @
01613a2e
...
...
@@ -37,6 +37,7 @@ import androidx.annotation.RequiresApi;
import
androidx.annotation.VisibleForTesting
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.DefaultLoadControl
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -477,7 +478,7 @@ public final class Transformer {
DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS
/
10
)
.
build
();
player
=
new
Simple
ExoPlayer
.
Builder
(
new
ExoPlayer
.
Builder
(
context
,
new
TransformerRenderersFactory
(
muxerWrapper
,
transformation
))
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
setTrackSelector
(
trackSelector
)
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
01613a2e
...
...
@@ -47,12 +47,12 @@ import android.widget.TextView;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.Events
;
import
com.google.android.exoplayer2.Player.State
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
import
com.google.android.exoplayer2.Timeline
;
import
com.google.android.exoplayer2.util.Assertions
;
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.
* You can also customize some operations when configuring the player (for example by using
* {@link
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
View file @
01613a2e
...
...
@@ -53,9 +53,9 @@ import androidx.media.app.NotificationCompat.MediaStyle;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.DefaultControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
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.Util
;
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.
* You can also customize some operations when configuring the player (for example by using
* {@link
SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}), or configure whether the
*
rewind and fast forward actions should be used with {{@link #setUseRewindAction(boolean)}}
*
and
{@link #setUseFastForwardAction(boolean)}.
* {@link
ExoPlayer.Builder#setSeekBackIncrementMs(long)}), or configure whether the rewind
*
and fast forward actions should be used with {{@link #setUseRewindAction(boolean)}} and
* {@link #setUseFastForwardAction(boolean)}.
*/
@Deprecated
public
final
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
01613a2e
...
...
@@ -47,13 +47,13 @@ import androidx.annotation.RequiresApi;
import
androidx.core.content.ContextCompat
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
import
com.google.android.exoplayer2.MediaMetadata
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
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.Period
;
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.
* You can also customize some operations when configuring the player (for example by using
* {@link
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
01613a2e
...
...
@@ -65,7 +65,6 @@ import com.google.android.exoplayer2.ForwardingPlayer;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.Events
;
import
com.google.android.exoplayer2.Player.State
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
import
com.google.android.exoplayer2.Timeline
;
import
com.google.android.exoplayer2.source.TrackGroup
;
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.
* You can also customize some operations when configuring the player (for example by using
* {@link
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
View file @
01613a2e
...
...
@@ -48,13 +48,13 @@ import androidx.annotation.RequiresApi;
import
androidx.core.content.ContextCompat
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
import
com.google.android.exoplayer2.MediaMetadata
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
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.Period
;
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.
* You can also customize some operations when configuring the player (for example by using
* {@link
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
...
...
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashTestRunner.java
View file @
01613a2e
...
...
@@ -25,6 +25,7 @@ import androidx.annotation.RequiresApi;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.RendererCapabilities
;
...
...
@@ -314,7 +315,7 @@ import java.util.List;
protected
SimpleExoPlayer
buildExoPlayer
(
HostActivity
host
,
Surface
surface
,
MappingTrackSelector
trackSelector
)
{
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
host
,
new
DebugRenderersFactory
(
host
))
new
ExoPlayer
.
Builder
(
host
,
new
DebugRenderersFactory
(
host
))
.
setTrackSelector
(
trackSelector
)
.
build
();
player
.
setVideoSurface
(
surface
);
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java
View file @
01613a2e
...
...
@@ -248,7 +248,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
renderersFactory
.
setExtensionRendererMode
(
DefaultRenderersFactory
.
EXTENSION_RENDERER_MODE_OFF
);
renderersFactory
.
setAllowedVideoJoiningTimeMs
(
/* allowedVideoJoiningTimeMs= */
0
);
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
host
,
renderersFactory
).
setTrackSelector
(
trackSelector
).
build
();
new
ExoPlayer
.
Builder
(
host
,
renderersFactory
).
setTrackSelector
(
trackSelector
).
build
();
player
.
setVideoSurface
(
surface
);
return
player
;
}
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestExoPlayerBuilder.java
View file @
01613a2e
...
...
@@ -22,6 +22,7 @@ import android.os.Looper;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.DefaultLoadControl
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.LoadControl
;
import
com.google.android.exoplayer2.Renderer
;
import
com.google.android.exoplayer2.RenderersFactory
;
...
...
@@ -276,7 +277,7 @@ public class TestExoPlayerBuilder {
};
}
return
new
Simple
ExoPlayer
.
Builder
(
context
,
playerRenderersFactory
)
return
new
ExoPlayer
.
Builder
(
context
,
playerRenderersFactory
)
.
setTrackSelector
(
trackSelector
)
.
setLoadControl
(
loadControl
)
.
setBandwidthMeter
(
bandwidthMeter
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment