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
c0051c50
authored
Jul 07, 2021
by
bachinger
Committed by
kim-vde
Jul 09, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove temporary workaround for missing ACTION_SET_PLAYBACK_SPEED
PiperOrigin-RevId: 383390096
parent
1608f6f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
View file @
c0051c50
...
@@ -103,10 +103,6 @@ public final class MediaSessionConnector {
...
@@ -103,10 +103,6 @@ public final class MediaSessionConnector {
ExoPlayerLibraryInfo
.
registerModule
(
"goog.exo.mediasession"
);
ExoPlayerLibraryInfo
.
registerModule
(
"goog.exo.mediasession"
);
}
}
/** Indicates this session supports the set playback speed command. */
// TODO(b/174297519) Replace with PlaybackStateCompat.ACTION_SET_PLAYBACK_SPEED when released.
public
static
final
long
ACTION_SET_PLAYBACK_SPEED
=
1
<<
22
;
/** Playback actions supported by the connector. */
/** Playback actions supported by the connector. */
@LongDef
(
@LongDef
(
flag
=
true
,
flag
=
true
,
...
@@ -120,7 +116,7 @@ public final class MediaSessionConnector {
...
@@ -120,7 +116,7 @@ public final class MediaSessionConnector {
PlaybackStateCompat
.
ACTION_STOP
,
PlaybackStateCompat
.
ACTION_STOP
,
PlaybackStateCompat
.
ACTION_SET_REPEAT_MODE
,
PlaybackStateCompat
.
ACTION_SET_REPEAT_MODE
,
PlaybackStateCompat
.
ACTION_SET_SHUFFLE_MODE
,
PlaybackStateCompat
.
ACTION_SET_SHUFFLE_MODE
,
ACTION_SET_PLAYBACK_SPEED
PlaybackStateCompat
.
ACTION_SET_PLAYBACK_SPEED
})
})
@Retention
(
RetentionPolicy
.
SOURCE
)
@Retention
(
RetentionPolicy
.
SOURCE
)
public
@interface
PlaybackActions
{}
public
@interface
PlaybackActions
{}
...
@@ -136,12 +132,12 @@ public final class MediaSessionConnector {
...
@@ -136,12 +132,12 @@ public final class MediaSessionConnector {
|
PlaybackStateCompat
.
ACTION_STOP
|
PlaybackStateCompat
.
ACTION_STOP
|
PlaybackStateCompat
.
ACTION_SET_REPEAT_MODE
|
PlaybackStateCompat
.
ACTION_SET_REPEAT_MODE
|
PlaybackStateCompat
.
ACTION_SET_SHUFFLE_MODE
|
PlaybackStateCompat
.
ACTION_SET_SHUFFLE_MODE
|
ACTION_SET_PLAYBACK_SPEED
;
|
PlaybackStateCompat
.
ACTION_SET_PLAYBACK_SPEED
;
/** The default playback actions. */
/** The default playback actions. */
@PlaybackActions
@PlaybackActions
public
static
final
long
DEFAULT_PLAYBACK_ACTIONS
=
public
static
final
long
DEFAULT_PLAYBACK_ACTIONS
=
ALL_PLAYBACK_ACTIONS
-
ACTION_SET_PLAYBACK_SPEED
;
ALL_PLAYBACK_ACTIONS
-
PlaybackStateCompat
.
ACTION_SET_PLAYBACK_SPEED
;
/**
/**
* The name of the {@link PlaybackStateCompat} float extra with the value of {@code
* The name of the {@link PlaybackStateCompat} float extra with the value of {@code
...
@@ -156,7 +152,7 @@ public final class MediaSessionConnector {
...
@@ -156,7 +152,7 @@ public final class MediaSessionConnector {
|
PlaybackStateCompat
.
ACTION_STOP
|
PlaybackStateCompat
.
ACTION_STOP
|
PlaybackStateCompat
.
ACTION_SET_SHUFFLE_MODE
|
PlaybackStateCompat
.
ACTION_SET_SHUFFLE_MODE
|
PlaybackStateCompat
.
ACTION_SET_REPEAT_MODE
|
PlaybackStateCompat
.
ACTION_SET_REPEAT_MODE
|
ACTION_SET_PLAYBACK_SPEED
;
|
PlaybackStateCompat
.
ACTION_SET_PLAYBACK_SPEED
;
private
static
final
int
BASE_MEDIA_SESSION_FLAGS
=
private
static
final
int
BASE_MEDIA_SESSION_FLAGS
=
MediaSessionCompat
.
FLAG_HANDLES_MEDIA_BUTTONS
MediaSessionCompat
.
FLAG_HANDLES_MEDIA_BUTTONS
|
MediaSessionCompat
.
FLAG_HANDLES_TRANSPORT_CONTROLS
;
|
MediaSessionCompat
.
FLAG_HANDLES_TRANSPORT_CONTROLS
;
...
@@ -1293,7 +1289,7 @@ public final class MediaSessionConnector {
...
@@ -1293,7 +1289,7 @@ public final class MediaSessionConnector {
@Override
@Override
public
void
onSetPlaybackSpeed
(
float
speed
)
{
public
void
onSetPlaybackSpeed
(
float
speed
)
{
if
(
canDispatchPlaybackAction
(
ACTION_SET_PLAYBACK_SPEED
)
&&
speed
>
0
)
{
if
(
canDispatchPlaybackAction
(
PlaybackStateCompat
.
ACTION_SET_PLAYBACK_SPEED
)
&&
speed
>
0
)
{
controlDispatcher
.
dispatchSetPlaybackParameters
(
controlDispatcher
.
dispatchSetPlaybackParameters
(
player
,
player
.
getPlaybackParameters
().
withSpeed
(
speed
));
player
,
player
.
getPlaybackParameters
().
withSpeed
(
speed
));
}
}
...
...
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