MediaSession.Callback.OnSetPlaybackSpeed(Single) Method

Definition

Override to handle the playback speed change.

[Android.Runtime.Register("onSetPlaybackSpeed", "(F)V", "GetOnSetPlaybackSpeed_FHandler", ApiSince=29)]
public virtual void OnSetPlaybackSpeed (float speed);
[<Android.Runtime.Register("onSetPlaybackSpeed", "(F)V", "GetOnSetPlaybackSpeed_FHandler", ApiSince=29)>]
abstract member OnSetPlaybackSpeed : single -> unit
override this.OnSetPlaybackSpeed : single -> unit

Parameters

speed
Single

the playback speed

Attributes

Remarks

Override to handle the playback speed change. To update the new playback speed, create a new PlaybackState by using PlaybackState.Builder#setState(int, long, float), and set it with #setPlaybackState(PlaybackState).

A value of 1.0f is the default playback value, and a negative value indicates reverse playback. The speed will not be equal to zero.

Java documentation for android.media.session.MediaSession.Callback.onSetPlaybackSpeed(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