Partager via


MediaSession.Callback.OnPrepareFromUri(Uri, Bundle) Method

Definition

Override to handle requests to prepare a specific media item represented by a URI.

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

Parameters

uri
Uri
extras
Bundle
Attributes

Remarks

Override to handle requests to prepare a specific media item represented by a URI. During the preparation, a session should not hold audio focus in order to allow other sessions play seamlessly. The state of playback should be updated to PlaybackState#STATE_PAUSED after the preparation is done. The playback of the prepared content should start in the implementation of #onPlay. Override #onPlayFromUri to handle requests for starting playback without preparation.

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