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
31c9875e
authored
Jul 16, 2021
by
kimvde
Committed by
Ian Baker
Jul 20, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Deprecate ControlDispatcher in the UI
PiperOrigin-RevId: 385129211
parent
38308488
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
15 deletions
RELEASENOTES.md
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
RELEASENOTES.md
View file @
31c9875e
...
@@ -100,6 +100,12 @@
...
@@ -100,6 +100,12 @@
available commands.
available commands.
*
Update
`DefaultControlDispatcher`
`getRewindIncrementMs`
and
*
Update
`DefaultControlDispatcher`
`getRewindIncrementMs`
and
`getFastForwardIncrementMs`
to take the player as parameter.
`getFastForwardIncrementMs`
to take the player as parameter.
*
Deprecate
`setControlDispatcher`
in
`PlayerView`
,
`StyledPlayerView`
,
`PlayerControlView`
,
`StyledPlayerControlView`
and
`PlayerNotificationManager`
. Instead, you can use a
`ForwardingPlayer`
,
configure the player as needed (whenever possible) or, for
`PlayerNotificationManager`
, use
`setUseRewindAction`
and
`setUseFastForwardAction`
to configure whether to use these actions.
*
Video:
*
Video:
*
Fix
`IncorrectContextUseViolation`
strict mode warning on Android 11
*
Fix
`IncorrectContextUseViolation`
strict mode warning on Android 11
(
[
#8246
](
https://github.com/google/ExoPlayer/pull/8246
)
).
(
[
#8246
](
https://github.com/google/ExoPlayer/pull/8246
)
).
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
31c9875e
...
@@ -48,9 +48,11 @@ import androidx.annotation.Nullable;
...
@@ -48,9 +48,11 @@ 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.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
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
;
...
@@ -599,10 +601,11 @@ public class PlayerControlView extends FrameLayout {
...
@@ -599,10 +601,11 @@ public class PlayerControlView extends FrameLayout {
}
}
/**
/**
*
Sets the {@link com.google.android.exoplayer2.ControlDispatcher}
.
*
@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
*
@param controlDispatcher The {@link com.google.android.exoplayer2.ControlDispatcher}
.
*
{@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)})
.
*/
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
if
(
this
.
controlDispatcher
!=
controlDispatcher
)
{
if
(
this
.
controlDispatcher
!=
controlDispatcher
)
{
this
.
controlDispatcher
=
controlDispatcher
;
this
.
controlDispatcher
=
controlDispatcher
;
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
View file @
31c9875e
...
@@ -53,7 +53,9 @@ import androidx.media.app.NotificationCompat.MediaStyle;
...
@@ -53,7 +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.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
;
...
@@ -815,10 +817,13 @@ public class PlayerNotificationManager {
...
@@ -815,10 +817,13 @@ public class PlayerNotificationManager {
}
}
/**
/**
* Sets the {@link ControlDispatcher}.
* @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
* @param controlDispatcher The {@link ControlDispatcher}.
* {@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}), or configure whether the
* rewind and fast forward actions should be used with {{@link #setUseRewindAction(boolean)}}
* and {@link #setUseFastForwardAction(boolean)}.
*/
*/
@Deprecated
public
final
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
public
final
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
if
(
this
.
controlDispatcher
!=
controlDispatcher
)
{
if
(
this
.
controlDispatcher
!=
controlDispatcher
)
{
this
.
controlDispatcher
=
controlDispatcher
;
this
.
controlDispatcher
=
controlDispatcher
;
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
31c9875e
...
@@ -48,9 +48,11 @@ import androidx.core.content.ContextCompat;
...
@@ -48,9 +48,11 @@ 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.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
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.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.Metadata
;
...
@@ -929,10 +931,11 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
...
@@ -929,10 +931,11 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
}
}
/**
/**
*
Sets the {@link ControlDispatcher}
.
*
@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
*
@param controlDispatcher The {@link ControlDispatcher}
.
*
{@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)})
.
*/
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
Assertions
.
checkStateNotNull
(
controller
);
Assertions
.
checkStateNotNull
(
controller
);
controller
.
setControlDispatcher
(
controlDispatcher
);
controller
.
setControlDispatcher
(
controlDispatcher
);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
31c9875e
...
@@ -61,9 +61,11 @@ import com.google.android.exoplayer2.DefaultControlDispatcher;
...
@@ -61,9 +61,11 @@ import com.google.android.exoplayer2.DefaultControlDispatcher;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
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
;
...
@@ -832,10 +834,11 @@ public class StyledPlayerControlView extends FrameLayout {
...
@@ -832,10 +834,11 @@ public class StyledPlayerControlView extends FrameLayout {
}
}
/**
/**
*
Sets the {@link ControlDispatcher}
.
*
@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
*
@param controlDispatcher The {@link ControlDispatcher}
.
*
{@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)})
.
*/
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
if
(
this
.
controlDispatcher
!=
controlDispatcher
)
{
if
(
this
.
controlDispatcher
!=
controlDispatcher
)
{
this
.
controlDispatcher
=
controlDispatcher
;
this
.
controlDispatcher
=
controlDispatcher
;
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
View file @
31c9875e
...
@@ -49,9 +49,11 @@ import androidx.core.content.ContextCompat;
...
@@ -49,9 +49,11 @@ 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.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
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.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.Metadata
;
...
@@ -947,10 +949,11 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
...
@@ -947,10 +949,11 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
}
}
/**
/**
*
Sets the {@link ControlDispatcher}
.
*
@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
*
@param controlDispatcher The {@link ControlDispatcher}
.
*
{@link SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)})
.
*/
*/
@Deprecated
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
public
void
setControlDispatcher
(
ControlDispatcher
controlDispatcher
)
{
Assertions
.
checkStateNotNull
(
controller
);
Assertions
.
checkStateNotNull
(
controller
);
controller
.
setControlDispatcher
(
controlDispatcher
);
controller
.
setControlDispatcher
(
controlDispatcher
);
...
...
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