Android.Media.MediaPlayer.SetSurface Method
Sets the Android.Views.Surface to be used as the sink for the video portion of the media.

Syntax

[Android.Runtime.Register("setSurface", "(Landroid/view/Surface;)V", "GetSetSurface_Landroid_view_Surface_Handler")]
public virtual void SetSurface (Android.Views.Surface surface)

Parameters

surface
The Android.Views.Surface to be used for the video portion of the media.

Remarks

Sets the Android.Views.Surface to be used as the sink for the video portion of the media. This is similar to MediaPlayer.SetDisplay(Android.Views.ISurfaceHolder), but does not support MediaPlayer.SetScreenOnWhilePlaying(bool). Setting a Surface will un-set any Surface or SurfaceHolder that was previously set. A null surface will result in only the audio track being played. If the Surface sends frames to a Android.Graphics.SurfaceTexture, the timestamps returned from Android.Graphics.SurfaceTexture.Timestamp will have an unspecified zero point. These timestamps cannot be directly compared between different media sources, different instances of the same media source, or multiple runs of the same program. The timestamp is normally monotonically increasing and is unaffected by time-of-day adjustments, but it is reset when the position is set.

[Android Documentation]

Requirements

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