Android.Media.MediaPlayer.Create Method
Convenience method to create a MediaPlayer for a given resource id.

Syntax

[Android.Runtime.Register("create", "(Landroid/content/Context;I)Landroid/media/MediaPlayer;", "")]
public static MediaPlayer Create (Android.Content.Context context, int resid)

Parameters

context
the Context to use
resid
the raw resource id (R.raw.<something>) for the resource to use as the datasource

Returns

Documentation for this section has not yet been entered.

Remarks

Convenience method to create a MediaPlayer for a given resource id. On success, MediaPlayer.Prepare will already have been called and must not be called again.

When done with the MediaPlayer, you should call MediaPlayer.Release, to free the resources. If not released, too many MediaPlayer instances will result in an exception.

Note that since MediaPlayer.Prepare is called automatically in this method, you cannot change the audio stream type (see MediaPlayer.SetAudioStreamType(Stream)), audio session ID (see MediaPlayer.AudioSessionId) or audio attributes (see MediaPlayer.SetAudioAttributes(AudioAttributes) of the new MediaPlayer.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1