PlaybackState.Builder.SetState Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| SetState(PlaybackStateCode, Int64, Single) |
Set the current state of playback. |
| SetState(PlaybackStateCode, Int64, Single, Int64) |
Set the current state of playback. |
SetState(PlaybackStateCode, Int64, Single)
Set the current state of playback.
[Android.Runtime.Register("setState", "(IJF)Landroid/media/session/PlaybackState$Builder;", "")]
public Android.Media.Session.PlaybackState.Builder SetState(Android.Media.Session.PlaybackStateCode state, long position, float playbackSpeed);
[<Android.Runtime.Register("setState", "(IJF)Landroid/media/session/PlaybackState$Builder;", "")>]
member this.SetState : Android.Media.Session.PlaybackStateCode * int64 * single -> Android.Media.Session.PlaybackState.Builder
Parameters
- state
- PlaybackStateCode
The current state of playback. Value is one of the following: PlaybackState.STATE_NONE; PlaybackState.STATE_STOPPED; PlaybackState.STATE_PAUSED; PlaybackState.STATE_PLAYING; PlaybackState.STATE_FAST_FORWARDING; PlaybackState.STATE_REWINDING; PlaybackState.STATE_BUFFERING; PlaybackState.STATE_ERROR; PlaybackState.STATE_CONNECTING; PlaybackState.STATE_SKIPPING_TO_PREVIOUS; PlaybackState.STATE_SKIPPING_TO_NEXT; PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM
- position
- Int64
The position in the current item in ms.
- playbackSpeed
- Single
The current speed of playback as a multiple of normal playback.
Returns
this
- Attributes
Remarks
Set the current state of playback.
The position must be in ms and indicates the current playback position within the item. If the position is unknown use PlaybackState.PLAYBACK_POSITION_UNKNOWN. The update time will be set to the current SystemClock.elapsedRealtime().
The speed is a multiple of normal playback and should be 0 when paused and negative when rewinding. Normal playback speed is 1.0.
The state must be one of the following: PlaybackState.STATE_NONE; PlaybackState.STATE_STOPPED; PlaybackState.STATE_PLAYING; PlaybackState.STATE_PAUSED; PlaybackState.STATE_FAST_FORWARDING; PlaybackState.STATE_REWINDING; PlaybackState.STATE_BUFFERING; PlaybackState.STATE_ERROR; PlaybackState.STATE_CONNECTING; PlaybackState.STATE_SKIPPING_TO_PREVIOUS; PlaybackState.STATE_SKIPPING_TO_NEXT; PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM
Android reference for android.media.session.PlaybackState.Builder.setState.
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
SetState(PlaybackStateCode, Int64, Single, Int64)
Set the current state of playback.
[Android.Runtime.Register("setState", "(IJFJ)Landroid/media/session/PlaybackState$Builder;", "")]
public Android.Media.Session.PlaybackState.Builder SetState(Android.Media.Session.PlaybackStateCode state, long position, float playbackSpeed, long updateTime);
[<Android.Runtime.Register("setState", "(IJFJ)Landroid/media/session/PlaybackState$Builder;", "")>]
member this.SetState : Android.Media.Session.PlaybackStateCode * int64 * single * int64 -> Android.Media.Session.PlaybackState.Builder
Parameters
- state
- PlaybackStateCode
The current state of playback. Value is one of the following: PlaybackState.STATE_NONE; PlaybackState.STATE_STOPPED; PlaybackState.STATE_PAUSED; PlaybackState.STATE_PLAYING; PlaybackState.STATE_FAST_FORWARDING; PlaybackState.STATE_REWINDING; PlaybackState.STATE_BUFFERING; PlaybackState.STATE_ERROR; PlaybackState.STATE_CONNECTING; PlaybackState.STATE_SKIPPING_TO_PREVIOUS; PlaybackState.STATE_SKIPPING_TO_NEXT; PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM
- position
- Int64
The position in the current item in ms.
- playbackSpeed
- Single
The current speed of playback as a multiple of normal playback.
- updateTime
- Int64
The time in the SystemClock.elapsedRealtime timebase that the position was updated at.
Returns
this
- Attributes
Remarks
Set the current state of playback.
The position must be in ms and indicates the current playback position within the item. If the position is unknown use PlaybackState.PLAYBACK_POSITION_UNKNOWN. When not using an unknown position the time at which the position was updated must be provided. It is okay to use SystemClock.elapsedRealtime() if the current position was just retrieved.
The speed is a multiple of normal playback and should be 0 when paused and negative when rewinding. Normal playback speed is 1.0.
The state must be one of the following: PlaybackState.STATE_NONE; PlaybackState.STATE_STOPPED; PlaybackState.STATE_PLAYING; PlaybackState.STATE_PAUSED; PlaybackState.STATE_FAST_FORWARDING; PlaybackState.STATE_REWINDING; PlaybackState.STATE_BUFFERING; PlaybackState.STATE_ERROR; PlaybackState.STATE_CONNECTING; PlaybackState.STATE_SKIPPING_TO_PREVIOUS; PlaybackState.STATE_SKIPPING_TO_NEXT; PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM
Android reference for android.media.session.PlaybackState.Builder.setState.
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.