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
30e65acf
authored
Jul 19, 2021
by
kimvde
Committed by
Ian Baker
Jul 20, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Deprecate ControlDispatcher in Leanback library
PiperOrigin-RevId: 385503851
parent
fdc2cbd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
RELEASENOTES.md
extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java
RELEASENOTES.md
View file @
30e65acf
...
...
@@ -102,10 +102,7 @@
`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.
`PlayerNotificationManager`
.
*
Video:
*
Fix
`IncorrectContextUseViolation`
strict mode warning on Android 11
(
[
#8246
](
https://github.com/google/ExoPlayer/pull/8246
)
).
...
...
@@ -171,6 +168,8 @@
*
Cronet extension:
*
Add
`CronetDataSource.Factory.setRequestPriority`
to allow setting the
priority of requests made by
`CronetDataSource`
instances.
*
Leanback:
*
Deprecate
`setControlDispatcher`
in
`LeanbackPlayerAdapter`
.
### 2.14.1 (2021-06-11)
...
...
extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java
View file @
30e65acf
...
...
@@ -29,6 +29,7 @@ import com.google.android.exoplayer2.C;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.DefaultControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.ForwardingPlayer
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
...
...
@@ -76,11 +77,11 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
}
/**
* Sets the {@link ControlDispatcher}.
*
* @param controlDispatcher The {@link ControlDispatcher}, or null to use {@link
* DefaultControlDispatcher}.
* @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
* SimpleExoPlayer.Builder#setSeekBackIncrementMs(long)}).
*/
@Deprecated
public
void
setControlDispatcher
(
@Nullable
ControlDispatcher
controlDispatcher
)
{
this
.
controlDispatcher
=
controlDispatcher
==
null
?
new
DefaultControlDispatcher
()
:
controlDispatcher
;
...
...
@@ -158,14 +159,16 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
}
else
if
(
player
.
getPlaybackState
()
==
Player
.
STATE_ENDED
)
{
controlDispatcher
.
dispatchSeekTo
(
player
,
player
.
getCurrentWindowIndex
(),
C
.
TIME_UNSET
);
}
if
(
controlDispatcher
.
dispatchSetPlayWhenReady
(
player
,
true
))
{
if
(
player
.
isCommandAvailable
(
Player
.
COMMAND_PLAY_PAUSE
)
&&
controlDispatcher
.
dispatchSetPlayWhenReady
(
player
,
true
))
{
getCallback
().
onPlayStateChanged
(
this
);
}
}
@Override
public
void
pause
()
{
if
(
controlDispatcher
.
dispatchSetPlayWhenReady
(
player
,
false
))
{
if
(
player
.
isCommandAvailable
(
Player
.
COMMAND_PLAY_PAUSE
)
&&
controlDispatcher
.
dispatchSetPlayWhenReady
(
player
,
false
))
{
getCallback
().
onPlayStateChanged
(
this
);
}
}
...
...
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