RemoteControlClient.SetPlaybackState Method

Definition

Overloads

SetPlaybackState(RemoteControlPlayState)
Obsolete.

Sets the current playback state.

SetPlaybackState(RemoteControlPlayState, Int64, Single)
Obsolete.

Sets the current playback state and the matching media position for the current playback speed.

SetPlaybackState(RemoteControlPlayState)

Caution

deprecated

Sets the current playback state.

[Android.Runtime.Register("setPlaybackState", "(I)V", "GetSetPlaybackState_IHandler")]
[System.Obsolete("deprecated")]
public virtual void SetPlaybackState (Android.Media.RemoteControlPlayState state);
[<Android.Runtime.Register("setPlaybackState", "(I)V", "GetSetPlaybackState_IHandler")>]
[<System.Obsolete("deprecated")>]
abstract member SetPlaybackState : Android.Media.RemoteControlPlayState -> unit
override this.SetPlaybackState : Android.Media.RemoteControlPlayState -> unit

Parameters

state
RemoteControlPlayState

The current playback state, one of the following values: #PLAYSTATE_STOPPED, #PLAYSTATE_PAUSED, #PLAYSTATE_PLAYING, #PLAYSTATE_FAST_FORWARDING, #PLAYSTATE_REWINDING, #PLAYSTATE_SKIPPING_FORWARDS, #PLAYSTATE_SKIPPING_BACKWARDS, #PLAYSTATE_BUFFERING, #PLAYSTATE_ERROR.

Attributes

Remarks

Sets the current playback state.

Java documentation for android.media.RemoteControlClient.setPlaybackState(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetPlaybackState(RemoteControlPlayState, Int64, Single)

Caution

deprecated

Sets the current playback state and the matching media position for the current playback speed.

[Android.Runtime.Register("setPlaybackState", "(IJF)V", "GetSetPlaybackState_IJFHandler")]
[System.Obsolete("deprecated")]
public virtual void SetPlaybackState (Android.Media.RemoteControlPlayState state, long timeInMs, float playbackSpeed);
[<Android.Runtime.Register("setPlaybackState", "(IJF)V", "GetSetPlaybackState_IJFHandler")>]
[<System.Obsolete("deprecated")>]
abstract member SetPlaybackState : Android.Media.RemoteControlPlayState * int64 * single -> unit
override this.SetPlaybackState : Android.Media.RemoteControlPlayState * int64 * single -> unit

Parameters

state
RemoteControlPlayState

The current playback state, one of the following values: #PLAYSTATE_STOPPED, #PLAYSTATE_PAUSED, #PLAYSTATE_PLAYING, #PLAYSTATE_FAST_FORWARDING, #PLAYSTATE_REWINDING, #PLAYSTATE_SKIPPING_FORWARDS, #PLAYSTATE_SKIPPING_BACKWARDS, #PLAYSTATE_BUFFERING, #PLAYSTATE_ERROR.

timeInMs
Int64

a 0 or positive value for the current media position expressed in ms (same unit as for when sending the media duration, if applicable, with android.media.MediaMetadataRetriever#METADATA_KEY_DURATION in the RemoteControlClient.MetadataEditor). Negative values imply that position is not known (e.g. listening to a live stream of a radio) or not applicable (e.g. when state is #PLAYSTATE_BUFFERING and nothing had played yet).

playbackSpeed
Single

a value expressed as a ratio of 1x playback: 1.0f is normal playback, 2.0f is 2x, 0.5f is half-speed, -2.0f is rewind at 2x speed. 0.0f means nothing is playing (e.g. when state is #PLAYSTATE_ERROR).

Attributes

Remarks

Sets the current playback state and the matching media position for the current playback speed.

Java documentation for android.media.RemoteControlClient.setPlaybackState(int, long, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to