Android.Media.MediaRecorder.SetMaxDuration Method
Sets the maximum duration (in ms) of the recording session.

Syntax

[Android.Runtime.Register("setMaxDuration", "(I)V", "GetSetMaxDuration_IHandler")]
public virtual void SetMaxDuration (int max_duration_ms)

Parameters

max_duration_ms
the maximum duration in ms (if zero or negative, disables the duration limit)

Exceptions

TypeReason
Java.Lang.IllegalArgumentException

Remarks

Sets the maximum duration (in ms) of the recording session. Call this after setOutFormat() but before prepare(). After recording reaches the specified duration, a notification will be sent to the NoType:android/media/MediaRecorder$OnInfoListener;Href=../../../reference/android/media/MediaRecorder.OnInfoListener.html with a "what" code of MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED and recording will be stopped. Stopping happens asynchronously, there is no guarantee that the recorder will have stopped by the time the listener is notified.

[Android Documentation]

Requirements

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