共用方式為


MediaController.TransportControls.PrepareFromUri(Uri, Bundle) Method

Definition

Request that the player prepare playback for a specific Uri.

[Android.Runtime.Register("prepareFromUri", "(Landroid/net/Uri;Landroid/os/Bundle;)V", "", ApiSince=24)]
public void PrepareFromUri (Android.Net.Uri? uri, Android.OS.Bundle? extras);
[<Android.Runtime.Register("prepareFromUri", "(Landroid/net/Uri;Landroid/os/Bundle;)V", "", ApiSince=24)>]
member this.PrepareFromUri : Android.Net.Uri * Android.OS.Bundle -> unit

Parameters

uri
Uri

The URI 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 Uri. 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, #playFromUri can be directly called without this method.

Java documentation for android.media.session.MediaController.TransportControls.prepareFromUri(android.net.Uri, 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