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
f83d478c
authored
Jul 14, 2020
by
ibaker
Committed by
Oliver Woodman
Jul 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Migrate uses of prepare(MediaSource) to setMediaSource() & prepare()
PiperOrigin-RevId: 321147910
parent
425d48b6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
5 deletions
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/ConcatenatingMediaSourcePlaybackPreparer.java
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/ConcatenatingMediaSourcePlaybackPreparer.java
View file @
f83d478c
...
@@ -42,6 +42,7 @@ public final class ConcatenatingMediaSourcePlaybackPreparer implements PlaybackP
...
@@ -42,6 +42,7 @@ public final class ConcatenatingMediaSourcePlaybackPreparer implements PlaybackP
@Override
@Override
public
void
preparePlayback
()
{
public
void
preparePlayback
()
{
exoPlayer
.
prepare
(
concatenatingMediaSource
);
exoPlayer
.
setMediaSource
(
concatenatingMediaSource
);
exoPlayer
.
prepare
();
}
}
}
}
extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java
View file @
f83d478c
...
@@ -95,7 +95,8 @@ public class OpusPlaybackTest {
...
@@ -95,7 +95,8 @@ public class OpusPlaybackTest {
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtOpusTest"
),
new
DefaultDataSourceFactory
(
context
,
"ExoPlayerExtOpusTest"
),
MatroskaExtractor
.
FACTORY
)
MatroskaExtractor
.
FACTORY
)
.
createMediaSource
(
MediaItem
.
fromUri
(
uri
));
.
createMediaSource
(
MediaItem
.
fromUri
(
uri
));
player
.
prepare
(
mediaSource
);
player
.
setMediaSource
(
mediaSource
);
player
.
prepare
();
player
.
play
();
player
.
play
();
Looper
.
loop
();
Looper
.
loop
();
}
}
...
...
extensions/vp9/src/androidTest/java/com/google/android/exoplayer2/ext/vp9/VpxPlaybackTest.java
View file @
f83d478c
...
@@ -128,7 +128,8 @@ public class VpxPlaybackTest {
...
@@ -128,7 +128,8 @@ public class VpxPlaybackTest {
.
setType
(
C
.
MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER
)
.
setType
(
C
.
MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER
)
.
setPayload
(
new
VideoDecoderGLSurfaceView
(
context
).
getVideoDecoderOutputBufferRenderer
())
.
setPayload
(
new
VideoDecoderGLSurfaceView
(
context
).
getVideoDecoderOutputBufferRenderer
())
.
send
();
.
send
();
player
.
prepare
(
mediaSource
);
player
.
setMediaSource
(
mediaSource
);
player
.
prepare
();
player
.
play
();
player
.
play
();
Looper
.
loop
();
Looper
.
loop
();
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java
View file @
f83d478c
...
@@ -61,7 +61,7 @@ import java.util.List;
...
@@ -61,7 +61,7 @@ import java.util.List;
* <ul>
* <ul>
* <li>A <b>{@link MediaSource}</b> that defines the media to be played, loads the media, and from
* <li>A <b>{@link MediaSource}</b> that defines the media to be played, loads the media, and from
* which the loaded media can be read. A MediaSource is injected via {@link
* which the loaded media can be read. A MediaSource is injected via {@link
* #
prepar
e(MediaSource)} at the start of playback. The library modules provide default
* #
setMediaSourc
e(MediaSource)} at the start of playback. The library modules provide default
* implementations for progressive media files ({@link ProgressiveMediaSource}), DASH
* implementations for progressive media files ({@link ProgressiveMediaSource}), DASH
* (DashMediaSource), SmoothStreaming (SsMediaSource) and HLS (HlsMediaSource), an
* (DashMediaSource), SmoothStreaming (SsMediaSource) and HLS (HlsMediaSource), an
* implementation for loading single media samples ({@link SingleSampleMediaSource}) that's
* implementation for loading single media samples ({@link SingleSampleMediaSource}) that's
...
...
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
View file @
f83d478c
...
@@ -3526,6 +3526,7 @@ public final class ExoPlayerTest {
...
@@ -3526,6 +3526,7 @@ public final class ExoPlayerTest {
assertArrayEquals
(
new
long
[]
{
5_000
},
currentPlaybackPositions
);
assertArrayEquals
(
new
long
[]
{
5_000
},
currentPlaybackPositions
);
}
}
@SuppressWarnings
(
"deprecation"
)
@Test
@Test
public
void
seekTo_windowIndexIsReset_deprecated
()
throws
Exception
{
public
void
seekTo_windowIndexIsReset_deprecated
()
throws
Exception
{
FakeTimeline
fakeTimeline
=
new
FakeTimeline
(
/* windowCount= */
1
);
FakeTimeline
fakeTimeline
=
new
FakeTimeline
(
/* windowCount= */
1
);
...
@@ -3542,7 +3543,6 @@ public final class ExoPlayerTest {
...
@@ -3542,7 +3543,6 @@ public final class ExoPlayerTest {
new
PlayerRunnable
()
{
new
PlayerRunnable
()
{
@Override
@Override
public
void
run
(
SimpleExoPlayer
player
)
{
public
void
run
(
SimpleExoPlayer
player
)
{
//noinspection deprecation
player
.
prepare
(
mediaSource
);
player
.
prepare
(
mediaSource
);
player
.
seekTo
(
/* positionMs= */
5000
);
player
.
seekTo
(
/* positionMs= */
5000
);
}
}
...
...
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