Android.Media.MediaPlayer Members

The members of Android.Media.MediaPlayer are listed below.

See Also: Inherited members from Java.Lang.Object

Public Constructors

Default constructor.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
MediaErrorIoint (-1004). Documentation for this section has not yet been entered.
const
MediaErrorMalformedint (-1007). Documentation for this section has not yet been entered.
const
MediaErrorTimedOutint (-110). Documentation for this section has not yet been entered.
const
MediaErrorUnsupportedint (-1010). Documentation for this section has not yet been entered.
const
MediaMimetypeTextSubripstring. MIME type for SubRip (SRT) container.
const
VideoScalingModeScaleToFitMediaPlayerVideoScalingModeNotInUse (1). Specifies a video scaling mode.
const
VideoScalingModeScaleToFitWithCroppingMediaPlayerVideoScalingModeNotInUse (2). Specifies a video scaling mode.

Public Properties

AudioSessionIdint. Returns the audio session ID.
[read-only]
CurrentPositionint. Gets the current playback position.
[read-only]
Durationint. Gets the duration of the file.
[read-only]
IsPlayingbool. Checks whether the MediaPlayer is playing.
Loopingbool. Checks whether the MediaPlayer is looping or non-looping.
[read-only]
VideoHeightint. Returns the height of the video.
[read-only]
VideoWidthint. Returns the width of the video.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddTimedTextSource(Java.IO.FileDescriptor, string)
Adds an external timed text source file (FileDescriptor).
AddTimedTextSource(string, string)
Adds an external timed text source file.
AddTimedTextSource(Android.Content.Context, Android.Net.Uri, string)
Adds an external timed text source file (Uri).
AddTimedTextSource(Java.IO.FileDescriptor, long, long, string)
Adds an external timed text file (FileDescriptor).
AttachAuxEffect(int)
Attaches an auxiliary effect to the player.
static
Create(Android.Content.Context, Android.Net.Uri) : MediaPlayer
Convenience method to create a MediaPlayer for a given Uri.
static
Create(Android.Content.Context, int) : MediaPlayer
Convenience method to create a MediaPlayer for a given resource id.
static
Create(Android.Content.Context, Android.Net.Uri, Android.Views.ISurfaceHolder) : MediaPlayer
Convenience method to create a MediaPlayer for a given Uri.
static
Create(Android.Content.Context, int, AudioAttributes, int) : MediaPlayer
Same factory method as MediaPlayer.Create(Android.Content.Context, System.Int32) but that lets you specify the audio attributes and session ID to be used by the new MediaPlayer instance.
static
Create(Android.Content.Context, Android.Net.Uri, Android.Views.ISurfaceHolder, AudioAttributes, int) : MediaPlayer
Same factory method as MediaPlayer.Create(Android.Content.Context, Android.Net.Uri, Android.Net.Uri) but that lets you specify the audio attributes and session ID to be used by the new MediaPlayer instance.
DeselectTrack(int)
Deselect a track.
GetSelectedTrack(MediaTrackType) : int
Returns the index of the audio, video, or subtitle track currently selected for playback, The return value is an index into the array returned by MediaPlayer.GetTrackInfo, and can be used in calls to MediaPlayer.SelectTrack(int) or MediaPlayer.DeselectTrack(int).
GetTrackInfo() : MediaPlayer.TrackInfo[]
Returns an array of track information.
Pause()
Pauses playback.
Prepare()
Prepares the player for playback, synchronously.
PrepareAsync()
Prepares the player for playback, asynchronously.
Release()
Releases resources associated with this MediaPlayer object.
Reset()
Resets the MediaPlayer to its uninitialized state.
SeekTo(int)
Seeks to specified time position.
SelectTrack(int)
Selects a track.
SetAudioAttributes(AudioAttributes)
Sets the audio attributes for this MediaPlayer.
SetAudioStreamType(Stream)
Sets the audio stream type for this MediaPlayer.
SetAuxEffectSendLevel(float)
Sets the send level of the player to the attached auxiliary effect .
SetDataSource(Java.IO.FileDescriptor)
Sets the data source (FileDescriptor) to use.
SetDataSource(string)
Sets the data source (file-path or http/rtsp URL) to use.
SetDataSource(Android.Content.Context, Android.Net.Uri)
Sets the data source as a content Uri.
SetDataSource(Android.Content.Context, Android.Net.Uri, IDictionary<string, string>)
Documentation for this section has not yet been entered.
SetDataSource(Java.IO.FileDescriptor, long, long)
Sets the data source (FileDescriptor) to use.
SetDataSourceAsync(Java.IO.FileDescriptor) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SetDataSourceAsync(string) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SetDataSourceAsync(Android.Content.Context, Android.Net.Uri) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SetDataSourceAsync(Android.Content.Context, Android.Net.Uri, IDictionary<string, string>) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SetDataSourceAsync(Java.IO.FileDescriptor, long, long) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SetDisplay(Android.Views.ISurfaceHolder)
Sets the Android.Views.ISurfaceHolder to use for displaying the video portion of the media.
SetNextMediaPlayer(MediaPlayer)
Set the MediaPlayer to start when this MediaPlayer finishes playback (i.e. reaches the end of the stream).
SetOnBufferingUpdateListener(MediaPlayer.IOnBufferingUpdateListener)
Register a callback to be invoked when the status of a network stream's buffer has changed.
SetOnCompletionListener(MediaPlayer.IOnCompletionListener)
Register a callback to be invoked when the end of a media source has been reached during playback.
SetOnErrorListener(MediaPlayer.IOnErrorListener)
Register a callback to be invoked when an error has happened during an asynchronous operation.
SetOnInfoListener(MediaPlayer.IOnInfoListener)
Register a callback to be invoked when an info/warning is available.
SetOnPreparedListener(MediaPlayer.IOnPreparedListener)
Register a callback to be invoked when the media source is ready for playback.
SetOnSeekCompleteListener(MediaPlayer.IOnSeekCompleteListener)
Register a callback to be invoked when a seek operation has been completed.
SetOnTimedTextListener(MediaPlayer.IOnTimedTextListener)
Register a callback to be invoked when a timed text is available for display.
SetOnVideoSizeChangedListener(MediaPlayer.IOnVideoSizeChangedListener)
Register a callback to be invoked when the video size is known or updated.
SetScreenOnWhilePlaying(bool)
Control whether we should use the attached SurfaceHolder to keep the screen on while video playback is occurring.
SetSurface(Android.Views.Surface)
Sets the Android.Views.Surface to be used as the sink for the video portion of the media.
SetVideoScalingMode(VideoScalingMode)
Sets video scaling mode.
SetVolume(float, float)
Sets the volume on this player.
SetWakeMode(Android.Content.Context, Android.OS.WakeLockFlags)
Set the low-level power management behavior for this MediaPlayer.
Start()
Starts or resumes playback.
Stop()
Stops playback after playback has been stopped or paused.

Public Events

BufferingUpdateDocumentation for this section has not yet been entered.
CompletionDocumentation for this section has not yet been entered.
ErrorDocumentation for this section has not yet been entered.
InfoDocumentation for this section has not yet been entered.
PreparedDocumentation for this section has not yet been entered.
SeekCompleteDocumentation for this section has not yet been entered.
TimedTextDocumentation for this section has not yet been entered.
VideoSizeChangedDocumentation for this section has not yet been entered.