Back to Exoplayer

RepeatModeActionProvider (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ext/mediasession/RepeatModeActionProvider.html

latest5.9 KB
Original Source

Package com.google.android.exoplayer2.ext.mediasession

Class RepeatModeActionProvider

  • java.lang.Object

    • com.google.android.exoplayer2.ext.mediasession.RepeatModeActionProvider
  • All Implemented Interfaces:MediaSessionConnector.CustomActionProvider


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classRepeatModeActionProviderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[MediaSessionConnector.CustomActionProvider](MediaSessionConnector.CustomActionProvider.html "interface in com.google.android.exoplayer2.ext.mediasession")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Provides a custom action for toggling repeat modes.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static @com.google.android.exoplayer2.util.RepeatModeUtil.RepeatToggleModes int | DEFAULT_REPEAT_TOGGLE_MODES | Deprecated.

The default repeat toggle modes. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | RepeatModeActionProvider​(Context context) | Deprecated.

Creates a new instance. | | RepeatModeActionProvider​(Context context, @com.google.android.exoplayer2.util.RepeatModeUtil.RepeatToggleModes int repeatToggleModes) | Deprecated.

Creates a new instance enabling the given repeat toggle modes. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | android.support.v4.media.session.PlaybackStateCompat.CustomAction | getCustomAction​(Player player) | Deprecated.

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​(Player player, String action, Bundle extras) | Deprecated.

Called when a custom action provided by this provider is sent to the media session. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

DEFAULT_REPEAT_TOGGLE_MODES

[@RepeatToggleModes](../../util/RepeatModeUtil.RepeatToggleModes.html "annotation in com.google.android.exoplayer2.util")public static final @com.google.android.exoplayer2.util.RepeatModeUtil.RepeatToggleModes int DEFAULT_REPEAT_TOGGLE_MODES

Deprecated.

The default repeat toggle modes. See Also:Constant Field Values

Constructor Detail

- 

RepeatModeActionProvider

public RepeatModeActionProvider​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)

Deprecated.

Creates a new instance.

Equivalent to RepeatModeActionProvider(context, DEFAULT_REPEAT_TOGGLE_MODES).

Parameters:context - The context.

- 

RepeatModeActionProvider

public RepeatModeActionProvider​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[@RepeatToggleModes](../../util/RepeatModeUtil.RepeatToggleModes.html "annotation in com.google.android.exoplayer2.util")@com.google.android.exoplayer2.util.RepeatModeUtil.RepeatToggleModes int repeatToggleModes)

Deprecated.

Creates a new instance enabling the given repeat toggle modes. Parameters:context - The context.repeatToggleModes - The toggle modes to enable.

Method Detail

- 

onCustomAction

public void onCustomAction​([Player](../../Player.html "interface in com.google.android.exoplayer2")player,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")action,
                           @Nullable[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")extras)

Deprecated.

Description copied from interface: MediaSessionConnector.CustomActionProvider

Called when a custom action provided by this provider is sent to the media session. Specified by:onCustomAction in interface MediaSessionConnector.CustomActionProviderParameters:player - The player connected to the media session.action - The name of the action which was sent by a media controller.extras - Optional extras sent by a media controller, may be null.

- 

getCustomAction

public android.support.v4.media.session.PlaybackStateCompat.CustomAction getCustomAction​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

Deprecated.

Description copied from interface: MediaSessionConnector.CustomActionProvider

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. Specified by:getCustomAction in interface MediaSessionConnector.CustomActionProviderParameters:player - The player connected to the media session.Returns:The custom action to be included in the session playback state or null.