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

Syntax

[Android.Runtime.Register("create", "(Landroid/content/Context;Landroid/net/Uri;Landroid/view/SurfaceHolder;)Landroid/media/MediaPlayer;", "")]
public static MediaPlayer Create (Android.Content.Context context, Android.Net.Uri uri, Android.Views.ISurfaceHolder holder)

Parameters

context
the Context to use
uri
the Uri from which to get the datasource
holder
the SurfaceHolder to use for displaying the video

Returns

Documentation for this section has not yet been entered.

Remarks

Convenience method to create a MediaPlayer for a given Uri. 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