public final class RepeatModeActionProvider extends java.lang.Object implements MediaSessionConnector.CustomActionProvider
| Constructor and Description |
|---|
RepeatModeActionProvider(android.content.Context context,
com.google.android.exoplayer2.Player player)
Creates a new instance.
|
RepeatModeActionProvider(android.content.Context context,
com.google.android.exoplayer2.Player player,
int repeatToggleModes)
Creates a new instance enabling the given repeat toggle modes.
|
| Modifier and Type | Method and Description |
|---|---|
android.support.v4.media.session.PlaybackStateCompat.CustomAction |
getCustomAction()
Returns a
PlaybackStateCompat.CustomAction which will be published to the media
session by the connector or null if this action should not be published at the given
player state. |
void |
onCustomAction(java.lang.String action,
android.os.Bundle extras)
Called when a custom action provided by this provider is sent to the media session.
|
public RepeatModeActionProvider(android.content.Context context,
com.google.android.exoplayer2.Player player)
Equivalent to RepeatModeActionProvider(context, player,
MediaSessionConnector.DEFAULT_REPEAT_TOGGLE_MODES).
context - The context.player - The player on which to toggle the repeat mode.public RepeatModeActionProvider(android.content.Context context,
com.google.android.exoplayer2.Player player,
@RepeatModeUtil.RepeatToggleModes
int repeatToggleModes)
context - The context.player - The player on which to toggle the repeat mode.repeatToggleModes - The toggle modes to enable.public void onCustomAction(java.lang.String action,
android.os.Bundle extras)
MediaSessionConnector.CustomActionProvideronCustomAction in interface MediaSessionConnector.CustomActionProvideraction - The name of the action which was sent by a media controller.extras - Optional extras sent by a media controller.public android.support.v4.media.session.PlaybackStateCompat.CustomAction getCustomAction()
MediaSessionConnector.CustomActionProviderPlaybackStateCompat.CustomAction which will be published to the media
session by the connector or null if this action should not be published at the given
player state.getCustomAction in interface MediaSessionConnector.CustomActionProvidernull.