setMaxFileSize method

Future<void> setMaxFileSize(
  1. int maxFilesizeBytes
)

Sets the maximum filesize (in bytes) of the recording session.

Call this after setOutputFormat but before prepare. After recording reaches the specified filesize, a notification will be sent to the OnInfoListener with a "what" code of infoMaxFilesizeReached 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.

When using MPEG-4 container (setOutputFormat with OutputFormat.mpeg4), it is recommended to set maximum filesize that fits the use case. Setting a larger than required filesize may result in a larger than needed output file because of space reserved for MOOV box expecting large movie data in this recording session. Unused space of MOOV box is turned into FREE box in the output file.

Implementation

Future<void> setMaxFileSize(int maxFilesizeBytes) {
  return _channel.$setMaxFileSize(this, maxFilesizeBytes);
}