Udostępnij za pośrednictwem


MediaController.TransportControls.PrepareFromMediaId(String, Bundle) Method

Definition

Request that the player prepare playback for a specific media id.

[Android.Runtime.Register("prepareFromMediaId", "(Ljava/lang/String;Landroid/os/Bundle;)V", "", ApiSince=24)]
public void PrepareFromMediaId (string? mediaId, Android.OS.Bundle? extras);
[<Android.Runtime.Register("prepareFromMediaId", "(Ljava/lang/String;Landroid/os/Bundle;)V", "", ApiSince=24)>]
member this.PrepareFromMediaId : string * Android.OS.Bundle -> unit

Parameters

mediaId
String

The id of the requested media.

extras
Bundle

Optional extras that can include extra information about the media item to be prepared.

Attributes

Remarks

Request that the player prepare playback for a specific media id. In other words, other sessions can continue to play during the preparation of this session. This method can be used to speed up the start of the playback. Once the preparation is done, the session will change its playback state to PlaybackState#STATE_PAUSED. Afterwards, #play can be called to start playback. If the preparation is not needed, #playFromMediaId can be directly called without this method.

Java documentation for android.media.session.MediaController.TransportControls.prepareFromMediaId(java.lang.String, android.os.Bundle).

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