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
07bfab8e
authored
Nov 18, 2019
by
bachinger
Committed by
Oliver Woodman
Nov 19, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
document media button handling prior to API level 21
ISSUE: #6545 PiperOrigin-RevId: 281032120
parent
21957bf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 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 @
07bfab8e
...
...
@@ -30,6 +30,7 @@ import android.support.v4.media.session.MediaControllerCompat;
import
android.support.v4.media.session.MediaSessionCompat
;
import
android.support.v4.media.session.PlaybackStateCompat
;
import
android.util.Pair
;
import
android.view.KeyEvent
;
import
androidx.annotation.LongDef
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
...
...
@@ -500,6 +501,17 @@ public final class MediaSessionConnector {
* Sets the {@link MediaButtonEventHandler}. Pass {@code null} if the media button event should be
* handled by {@link MediaSessionCompat.Callback#onMediaButtonEvent(Intent)}.
*
* <p>Please note that prior to API 21 MediaButton events are not delivered to the {@link
* MediaSessionCompat}. Instead they are delivered as key events (see <a
* href="https://developer.android.com/guide/topics/media-apps/mediabuttons">'Responding to media
* buttons'</a>). In an {@link android.app.Activity Activity}, media button events arrive at the
* {@link android.app.Activity#dispatchKeyEvent(KeyEvent)} method.
*
* <p>If you are running the player in a foreground service (prior to API 21), you can create an
* intent filter and handle the {@code android.intent.action.MEDIA_BUTTON} action yourself. See <a
* href="https://developer.android.com/reference/androidx/media/session/MediaButtonReceiver#service-handling-action_media_button">
* Service handling ACTION_MEDIA_BUTTON</a> for more information.
*
* @param mediaButtonEventHandler The {@link MediaButtonEventHandler}, or null to let the event be
* handled by {@link MediaSessionCompat.Callback#onMediaButtonEvent(Intent)}.
*/
...
...
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