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
b69c06a5
authored
Jul 22, 2021
by
kimvde
Committed by
kim-vde
Jul 22, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add methods to set/get the seek back/forward increments in test player
PiperOrigin-RevId: 386177945
parent
c080b446
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestExoPlayerBuilder.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestExoPlayerBuilder.java
View file @
b69c06a5
...
...
@@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat;
import
android.content.Context
;
import
android.os.Looper
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.DefaultLoadControl
;
import
com.google.android.exoplayer2.LoadControl
;
import
com.google.android.exoplayer2.Renderer
;
...
...
@@ -45,6 +46,8 @@ public class TestExoPlayerBuilder {
@Nullable
private
RenderersFactory
renderersFactory
;
private
boolean
useLazyPreparation
;
private
@MonotonicNonNull
Looper
looper
;
private
long
seekBackIncrementMs
;
private
long
seekForwardIncrementMs
;
public
TestExoPlayerBuilder
(
Context
context
)
{
this
.
context
=
context
;
...
...
@@ -56,6 +59,8 @@ public class TestExoPlayerBuilder {
if
(
myLooper
!=
null
)
{
looper
=
myLooper
;
}
seekBackIncrementMs
=
C
.
DEFAULT_SEEK_BACK_INCREMENT_MS
;
seekForwardIncrementMs
=
C
.
DEFAULT_SEEK_FORWARD_INCREMENT_MS
;
}
/**
...
...
@@ -214,6 +219,38 @@ public class TestExoPlayerBuilder {
}
/**
* Sets the seek back increment to be used by the player.
*
* @param seekBackIncrementMs The seek back increment to be used by the player.
* @return This builder.
*/
public
TestExoPlayerBuilder
setSeekBackIncrementMs
(
long
seekBackIncrementMs
)
{
this
.
seekBackIncrementMs
=
seekBackIncrementMs
;
return
this
;
}
/** Returns the seek back increment used by the player. */
public
long
getSeekBackIncrementMs
()
{
return
seekBackIncrementMs
;
}
/**
* Sets the seek forward increment to be used by the player.
*
* @param seekForwardIncrementMs The seek forward increment to be used by the player.
* @return This builder.
*/
public
TestExoPlayerBuilder
setSeekForwardIncrementMs
(
long
seekForwardIncrementMs
)
{
this
.
seekForwardIncrementMs
=
seekForwardIncrementMs
;
return
this
;
}
/** Returns the seek forward increment used by the player. */
public
long
getSeekForwardIncrementMs
()
{
return
seekForwardIncrementMs
;
}
/**
* Builds an {@link SimpleExoPlayer} using the provided values or their defaults.
*
* @return The built {@link ExoPlayerTestRunner}.
...
...
@@ -247,6 +284,8 @@ public class TestExoPlayerBuilder {
.
setClock
(
clock
)
.
setUseLazyPreparation
(
useLazyPreparation
)
.
setLooper
(
looper
)
.
setSeekBackIncrementMs
(
seekBackIncrementMs
)
.
setSeekForwardIncrementMs
(
seekForwardIncrementMs
)
.
build
();
}
}
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