共用方式為


MediaPlayer.Prepare Method

Definition

Prepares the player for playback, synchronously.

[Android.Runtime.Register("prepare", "()V", "GetPrepareHandler")]
public virtual void Prepare ();
[<Android.Runtime.Register("prepare", "()V", "GetPrepareHandler")>]
abstract member Prepare : unit -> unit
override this.Prepare : unit -> unit
Attributes

Exceptions

if it is called in an invalid state

Remarks

Prepares the player for playback, synchronously.

After setting the datasource and the display surface, you need to either call prepare() or prepareAsync(). For files, it is OK to call prepare(), which blocks until MediaPlayer is ready for playback.

Java documentation for android.media.MediaPlayer.prepare().

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