MediaPlayer.Duration Property

Definition

Gets the duration of the file.

public virtual int Duration { [Android.Runtime.Register("getDuration", "()I", "GetGetDurationHandler")] get; }
[<get: Android.Runtime.Register("getDuration", "()I", "GetGetDurationHandler")>]
member this.Duration : int

Property Value

the duration in milliseconds, if no duration is available (for example, if streaming live content), -1 is returned.

Attributes

Remarks

Gets the duration of the file.

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

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