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;
...
@@ -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;
...
@@ -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
Simple
ExoPlayer
.
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
);
...
...
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/MainActivity.java
View file @
01613a2e
...
@@ -24,6 +24,7 @@ import android.widget.FrameLayout;
...
@@ -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 {
...
@@ -172,7 +173,7 @@ public final class MainActivity extends Activity {
throw
new
IllegalStateException
();
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
.
setRepeatMode
(
Player
.
REPEAT_MODE_ALL
);
player
.
setMediaSource
(
mediaSource
);
player
.
setMediaSource
(
mediaSource
);
player
.
prepare
();
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;
...
@@ -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
...
@@ -272,7 +273,7 @@ public class PlayerActivity extends AppCompatActivity
trackSelector
.
setParameters
(
trackSelectorParameters
);
trackSelector
.
setParameters
(
trackSelectorParameters
);
lastSeenTrackGroupArray
=
null
;
lastSeenTrackGroupArray
=
null
;
player
=
player
=
new
Simple
ExoPlayer
.
Builder
(
/* context= */
this
,
renderersFactory
)
new
ExoPlayer
.
Builder
(
/* context= */
this
,
renderersFactory
)
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
setTrackSelector
(
trackSelector
)
.
setTrackSelector
(
trackSelector
)
.
build
();
.
build
();
...
...
demos/surface/src/main/java/com/google/android/exoplayer2/surfacedemo/MainActivity.java
View file @
01613a2e
...
@@ -28,6 +28,7 @@ import android.widget.Button;
...
@@ -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 {
...
@@ -216,7 +217,7 @@ public final class MainActivity extends Activity {
}
else
{
}
else
{
throw
new
IllegalStateException
();
throw
new
IllegalStateException
();
}
}
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
Builder
(
getApplicationContext
()).
build
();
SimpleExoPlayer
player
=
new
ExoPlayer
.
Builder
(
getApplicationContext
()).
build
();
player
.
setMediaSource
(
mediaSource
);
player
.
setMediaSource
(
mediaSource
);
player
.
prepare
();
player
.
prepare
();
player
.
play
();
player
.
play
();
...
...
docs/ad-insertion.md
View file @
01613a2e
...
@@ -49,7 +49,7 @@ MediaSourceFactory mediaSourceFactory =
...
@@ -49,7 +49,7 @@ MediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(context)
new DefaultMediaSourceFactory(context)
.setAdsLoaderProvider(adsLoaderProvider)
.setAdsLoaderProvider(adsLoaderProvider)
.setAdViewProvider(playerView);
.setAdViewProvider(playerView);
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory)
.setMediaSourceFactory(mediaSourceFactory)
.build();
.build();
~~~
~~~
...
...
docs/analytics.md
View file @
01613a2e
...
@@ -246,7 +246,7 @@ class ExtendedCollector extends AnalyticsCollector {
...
@@ -246,7 +246,7 @@ class ExtendedCollector extends AnalyticsCollector {
}
}
// Usage - Setup and listener registration.
// Usage - Setup and listener registration.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setAnalyticsCollector(new ExtendedCollector())
.setAnalyticsCollector(new ExtendedCollector())
.build();
.build();
player.addAnalyticsListener(new ExtendedListener() {
player.addAnalyticsListener(new ExtendedListener() {
...
...
docs/customization.md
View file @
01613a2e
...
@@ -60,7 +60,7 @@ DefaultDataSource.Factory dataSourceFactory =
...
@@ -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
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
.build();
~~~
~~~
...
@@ -82,7 +82,7 @@ DataSource.Factory cacheDataSourceFactory =
...
@@ -82,7 +82,7 @@ DataSource.Factory cacheDataSourceFactory =
.setCache(simpleCache)
.setCache(simpleCache)
.setUpstreamDataSourceFactory(httpDataSourceFactory);
.setUpstreamDataSourceFactory(httpDataSourceFactory);
SimpleExoPlayer player = new
Simple
ExoPlayer.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 = () -> {
...
@@ -107,7 +107,7 @@ DataSource.Factory dataSourceFactory = () -> {
return dataSource;
return dataSource;
};
};
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
.build();
~~~
~~~
...
@@ -158,7 +158,7 @@ LoadErrorHandlingPolicy loadErrorHandlingPolicy =
...
@@ -158,7 +158,7 @@ LoadErrorHandlingPolicy loadErrorHandlingPolicy =
};
};
SimpleExoPlayer player =
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(
.setMediaSourceFactory(
new DefaultMediaSourceFactory(context)
new DefaultMediaSourceFactory(context)
.setLoadErrorHandlingPolicy(loadErrorHandlingPolicy))
.setLoadErrorHandlingPolicy(loadErrorHandlingPolicy))
...
@@ -181,7 +181,7 @@ DefaultExtractorsFactory extractorsFactory =
...
@@ -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
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(
.setMediaSourceFactory(
new DefaultMediaSourceFactory(context, extractorsFactory))
new DefaultMediaSourceFactory(context, extractorsFactory))
.build();
.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.
...
@@ -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
Simple
ExoPlayer.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 =
...
@@ -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
Simple
ExoPlayer.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.
...
...
docs/downloading-media.md
View file @
01613a2e
...
@@ -322,7 +322,7 @@ DataSource.Factory cacheDataSourceFactory =
...
@@ -322,7 +322,7 @@ DataSource.Factory cacheDataSourceFactory =
.setUpstreamDataSourceFactory(httpDataSourceFactory)
.setUpstreamDataSourceFactory(httpDataSourceFactory)
.setCacheWriteDataSinkFactory(null); // Disable writing.
.setCacheWriteDataSinkFactory(null); // Disable writing.
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(
.setMediaSourceFactory(
new DefaultMediaSourceFactory(cacheDataSourceFactory))
new DefaultMediaSourceFactory(cacheDataSourceFactory))
.build();
.build();
...
...
docs/hello-world.md
View file @
01613a2e
...
@@ -92,12 +92,12 @@ to prevent build errors.
...
@@ -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
Simple
ExoPlayer.Builder(context).build();
SimpleExoPlayer player = new ExoPlayer.Builder(context).build();
~~~
~~~
{: .language-java}
{: .language-java}
...
...
docs/hls.md
View file @
01613a2e
...
@@ -18,7 +18,7 @@ player.
...
@@ -18,7 +18,7 @@ player.
~~~
~~~
// Create a player instance.
// 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.
// 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 =
...
@@ -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
Simple
ExoPlayer.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.
...
...
docs/live-streaming.md
View file @
01613a2e
...
@@ -97,7 +97,7 @@ values will override parameters defined by the media.
...
@@ -97,7 +97,7 @@ values will override parameters defined by the media.
~~~
~~~
// Global settings.
// Global settings.
SimpleExoPlayer player =
SimpleExoPlayer player =
new
Simple
ExoPlayer.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:
...
@@ -164,7 +164,7 @@ instance can be set when building the player:
~~~
~~~
SimpleExoPlayer player =
SimpleExoPlayer player =
new
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setLivePlaybackSpeedControl(
.setLivePlaybackSpeedControl(
new DefaultLivePlaybackSpeedControl.Builder()
new DefaultLivePlaybackSpeedControl.Builder()
.setFallbackMaxPlaybackSpeed(1.04f)
.setFallbackMaxPlaybackSpeed(1.04f)
...
...
docs/media-sources.md
View file @
01613a2e
...
@@ -37,7 +37,7 @@ MediaSourceFactory mediaSourceFactory =
...
@@ -37,7 +37,7 @@ MediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(cacheDataSourceFactory)
new DefaultMediaSourceFactory(cacheDataSourceFactory)
.setAdsLoaderProvider(adsLoaderProvider)
.setAdsLoaderProvider(adsLoaderProvider)
.setAdViewProvider(playerView);
.setAdViewProvider(playerView);
SimpleExoPlayer player = new
Simple
ExoPlayer.Builder(context)
SimpleExoPlayer player = new ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory)
.setMediaSourceFactory(mediaSourceFactory)
.build();
.build();
~~~
~~~
...
...
docs/network-stacks.md
View file @
01613a2e
...
@@ -50,7 +50,7 @@ DefaultDataSource.Factory dataSourceFactory =
...
@@ -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
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
.build();
~~~
~~~
...
...
docs/progressive.md
View file @
01613a2e
...
@@ -11,7 +11,7 @@ it to the player.
...
@@ -11,7 +11,7 @@ it to the player.
~~~
~~~
// Create a player instance.
// 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.
// 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();
...
@@ -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
Simple
ExoPlayer.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.
...
...
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.
...
@@ -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
Simple
ExoPlayer.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 =
...
@@ -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
Simple
ExoPlayer.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.
...
...
docs/shrinking.md
View file @
01613a2e
...
@@ -59,7 +59,7 @@ RenderersFactory audioOnlyRenderersFactory =
...
@@ -59,7 +59,7 @@ RenderersFactory audioOnlyRenderersFactory =
context, MediaCodecSelector.DEFAULT, handler, audioListener)
context, MediaCodecSelector.DEFAULT, handler, audioListener)
};
};
SimpleExoPlayer player =
SimpleExoPlayer player =
new
Simple
ExoPlayer.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:
...
@@ -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
Simple
ExoPlayer.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
`
Simple
ExoPlayer.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:
...
@@ -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
Simple
ExoPlayer.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
Simple
ExoPlayer.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
Simple
ExoPlayer.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)
...
...
docs/smoothstreaming.md
View file @
01613a2e
...
@@ -19,7 +19,7 @@ to the player.
...
@@ -19,7 +19,7 @@ to the player.
~~~
~~~
// Create a player instance.
// 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.
// 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 =
...
@@ -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
Simple
ExoPlayer.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.
...
...
docs/track-selection.md
View file @
01613a2e
...
@@ -9,7 +9,7 @@ of which can be provided whenever an `ExoPlayer` is built.
...
@@ -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
Simple
ExoPlayer.Builder(context)
new ExoPlayer.Builder(context)
.setTrackSelector(trackSelector)
.setTrackSelector(trackSelector)
.build();
.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
...
@@ -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
Simple
ExoPlayer.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) {
...
@@ -157,7 +157,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void initializePlayer() {
private void initializePlayer() {
// Instantiate the player.
// Instantiate the player.
player = new
Simple
ExoPlayer.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.
...
...
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
...
@@ -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.
...
...
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
...
@@ -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.
...
...
extensions/flac/README.md
View file @
01613a2e
...
@@ -75,13 +75,12 @@ renderer.
...
@@ -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.
...
...
extensions/flac/src/androidTest/java/com/google/android/exoplayer2/ext/flac/FlacPlaybackTest.java
View file @
01613a2e
...
@@ -23,6 +23,7 @@ import android.os.Looper;
...
@@ -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 {
...
@@ -116,7 +117,7 @@ public class FlacPlaybackTest {
new
Renderer
[]
{
new
Renderer
[]
{
new
LibflacAudioRenderer
(
eventHandler
,
audioRendererEventListener
,
audioSink
)
new
LibflacAudioRenderer
(
eventHandler
,
audioRendererEventListener
,
audioSink
)
};
};
player
=
new
Simple
ExoPlayer
.
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
(
...
...
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
...
@@ -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
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
@Nullable
ControlDispatcher
controlDispatcher
)
{
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;
...
@@ -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;
...
@@ -69,7 +70,7 @@ import org.junit.rules.ExternalResource;
DataSource
.
Factory
dataSourceFactory
=
new
InstrumentingDataSourceFactory
(
context
);
DataSource
.
Factory
dataSourceFactory
=
new
InstrumentingDataSourceFactory
(
context
);
exoPlayer
=
exoPlayer
=
new
Simple
ExoPlayer
.
Builder
(
context
)
new
ExoPlayer
.
Builder
(
context
)
.
setLooper
(
Looper
.
myLooper
())
.
setLooper
(
Looper
.
myLooper
())
.
setMediaSourceFactory
(
new
DefaultMediaSourceFactory
(
dataSourceFactory
))
.
setMediaSourceFactory
(
new
DefaultMediaSourceFactory
(
dataSourceFactory
))
.
build
();
.
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;
...
@@ -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 {
...
@@ -169,7 +170,7 @@ public class SessionPlayerConnectorTest {
SimpleExoPlayer
simpleExoPlayer
=
null
;
SimpleExoPlayer
simpleExoPlayer
=
null
;
SessionPlayerConnector
playerConnector
=
null
;
SessionPlayerConnector
playerConnector
=
null
;
try
{
try
{
simpleExoPlayer
=
new
Simple
ExoPlayer
.
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 {
...
@@ -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
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerWrapper.java
View file @
01613a2e
...
@@ -166,7 +166,7 @@ import java.util.List;
...
@@ -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
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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 {
...
@@ -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
*
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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 {
...
@@ -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
*
Simple
ExoPlayer.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 {
...
@@ -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
*
Simple
ExoPlayer.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 {
...
@@ -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
*
Simple
ExoPlayer.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 {
...
@@ -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
*
Simple
ExoPlayer.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 {
...
@@ -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
*
Simple
ExoPlayer.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 {
...
@@ -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
*
Simple
ExoPlayer.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 {
...
@@ -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
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@code ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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
...
@@ -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.
...
...
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
View file @
01613a2e
...
@@ -23,6 +23,7 @@ import android.os.Looper;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
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
(
...
...
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
...
@@ -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.
...
...
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
View file @
01613a2e
...
@@ -24,6 +24,7 @@ import android.os.Looper;
...
@@ -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 {
...
@@ -130,7 +131,7 @@ public class VpxPlaybackTest {
videoRendererEventListener
,
videoRendererEventListener
,
/* maxDroppedFramesToNotify= */
-
1
)
/* maxDroppedFramesToNotify= */
-
1
)
};
};
player
=
new
Simple
ExoPlayer
.
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
(
...
...
library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java
View file @
01613a2e
...
@@ -59,7 +59,7 @@ public final class ClippedPlaybackTest {
...
@@ -59,7 +59,7 @@ public final class ClippedPlaybackTest {
getInstrumentation
()
getInstrumentation
()
.
runOnMainSync
(
.
runOnMainSync
(
()
->
{
()
->
{
player
.
set
(
new
Simple
ExoPlayer
.
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 {
...
@@ -101,7 +101,7 @@ public final class ClippedPlaybackTest {
getInstrumentation
()
getInstrumentation
()
.
runOnMainSync
(
.
runOnMainSync
(
()
->
{
()
->
{
player
.
set
(
new
Simple
ExoPlayer
.
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
();
...
...
library/core/src/test/java/com/google/android/exoplayer2/SimpleExoPlayerTest.java
View file @
01613a2e
...
@@ -52,7 +52,7 @@ public class SimpleExoPlayerTest {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -65,7 +65,7 @@ public class SimpleExoPlayerTest {
@Test
@Test
public
void
onPlaylistMetadataChanged_calledWhenPlaylistMetadataSet
()
{
public
void
onPlaylistMetadataChanged_calledWhenPlaylistMetadataSet
()
{
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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 {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -147,7 +147,7 @@ public class SimpleExoPlayerTest {
@Test
@Test
public
void
releaseAfterVolumeChanges_triggerPendingDeviceVolumeEventsInListener
()
{
public
void
releaseAfterVolumeChanges_triggerPendingDeviceVolumeEventsInListener
()
{
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
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;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
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
=
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/EndToEndGaplessTest.java
View file @
01613a2e
...
@@ -22,6 +22,7 @@ import android.media.AudioFormat;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
())
new
ExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
())
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
setClock
(
new
FakeClock
(
/* isAutoAdvancing= */
true
))
.
build
();
.
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;
...
@@ -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 {
...
@@ -64,7 +65,7 @@ public class FlacPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlvPlaybackTest.java
View file @
01613a2e
...
@@ -19,6 +19,7 @@ import android.content.Context;
...
@@ -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 {
...
@@ -55,7 +56,7 @@ public final class FlvPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
)));
...
...
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;
...
@@ -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 {
...
@@ -57,7 +58,7 @@ public final class MkaPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/MkvPlaybackTest.java
View file @
01613a2e
...
@@ -19,6 +19,7 @@ import android.content.Context;
...
@@ -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 {
...
@@ -61,7 +62,7 @@ public final class MkvPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
)));
...
...
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;
...
@@ -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 {
...
@@ -60,7 +61,7 @@ public final class Mp3PlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Mp4PlaybackTest.java
View file @
01613a2e
...
@@ -19,6 +19,7 @@ import android.content.Context;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
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
)));
...
...
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;
...
@@ -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 {
...
@@ -58,7 +59,7 @@ public final class OggPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
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;
...
@@ -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 {
...
@@ -45,7 +46,7 @@ public final class PlaylistPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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 {
...
@@ -67,7 +68,7 @@ public final class PlaylistPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
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;
...
@@ -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 {
...
@@ -45,7 +46,7 @@ public final class SilencePlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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 {
...
@@ -66,7 +67,7 @@ public final class SilencePlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/TsPlaybackTest.java
View file @
01613a2e
...
@@ -19,6 +19,7 @@ import android.content.Context;
...
@@ -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 {
...
@@ -81,7 +82,7 @@ public class TsPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
)));
...
...
library/core/src/test/java/com/google/android/exoplayer2/e2etest/Vp9PlaybackTest.java
View file @
01613a2e
...
@@ -19,6 +19,7 @@ import android.content.Context;
...
@@ -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 {
...
@@ -59,7 +60,7 @@ public final class Vp9PlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
)));
...
...
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;
...
@@ -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 {
...
@@ -52,7 +53,7 @@ public final class WavPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideInsertedAdMediaSourceTest.java
View file @
01613a2e
...
@@ -35,6 +35,7 @@ import android.graphics.SurfaceTexture;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -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
Simple
ExoPlayer
.
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 {
...
@@ -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
=
...
...
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;
...
@@ -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 {
...
@@ -51,7 +52,7 @@ public final class DashPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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 {
...
@@ -78,7 +79,7 @@ public final class DashPlaybackTest {
CapturingRenderersFactory
capturingRenderersFactory
=
CapturingRenderersFactory
capturingRenderersFactory
=
new
CapturingRenderersFactory
(
applicationContext
);
new
CapturingRenderersFactory
(
applicationContext
);
SimpleExoPlayer
player
=
SimpleExoPlayer
player
=
new
Simple
ExoPlayer
.
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
)));
...
...
library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspPlaybackTest.java
View file @
01613a2e
...
@@ -25,6 +25,7 @@ import androidx.annotation.Nullable;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
new
ExoPlayer
.
Builder
(
applicationContext
,
capturingRenderersFactory
)
.
setClock
(
clock
)
.
setClock
(
clock
)
.
build
();
.
build
();
player
.
setMediaSource
(
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;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer
.
Builder
(
new
ExoPlayer
.
Builder
(
context
,
new
TransformerRenderersFactory
(
muxerWrapper
,
transformation
))
context
,
new
TransformerRenderersFactory
(
muxerWrapper
,
transformation
))
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
setTrackSelector
(
trackSelector
)
.
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;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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;
...
@@ -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 {
...
@@ -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
)
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
01613a2e
...
@@ -47,13 +47,13 @@ import androidx.annotation.RequiresApi;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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;
...
@@ -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 {
...
@@ -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
Simple
ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
* {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
*/
@Deprecated
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
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;
...
@@ -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;
...
@@ -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
Simple
ExoPlayer
.
Builder
(
host
,
new
DebugRenderersFactory
(
host
))
new
ExoPlayer
.
Builder
(
host
,
new
DebugRenderersFactory
(
host
))
.
setTrackSelector
(
trackSelector
)
.
setTrackSelector
(
trackSelector
)
.
build
();
.
build
();
player
.
setVideoSurface
(
surface
);
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 {
...
@@ -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
Simple
ExoPlayer
.
Builder
(
host
,
renderersFactory
).
setTrackSelector
(
trackSelector
).
build
();
new
ExoPlayer
.
Builder
(
host
,
renderersFactory
).
setTrackSelector
(
trackSelector
).
build
();
player
.
setVideoSurface
(
surface
);
player
.
setVideoSurface
(
surface
);
return
player
;
return
player
;
}
}
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestExoPlayerBuilder.java
View file @
01613a2e
...
@@ -22,6 +22,7 @@ import android.os.Looper;
...
@@ -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 {
...
@@ -276,7 +277,7 @@ public class TestExoPlayerBuilder {
};
};
}
}
return
new
Simple
ExoPlayer
.
Builder
(
context
,
playerRenderersFactory
)
return
new
ExoPlayer
.
Builder
(
context
,
playerRenderersFactory
)
.
setTrackSelector
(
trackSelector
)
.
setTrackSelector
(
trackSelector
)
.
setLoadControl
(
loadControl
)
.
setLoadControl
(
loadControl
)
.
setBandwidthMeter
(
bandwidthMeter
)
.
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