startRecording method
Starts the recording.
Initiates the recording process and transitions the recorder status to RecorderStatus.starting first. If the start is successful, the status will change to RecorderStatus.recording. A notification is issued upon successful start.
Returns
- GemError.success Successfully transitioned to the RecorderStatus.recording state.
- GemError.busy The recorder could not transition to RecorderStatus.starting because it is busy with another operation.
- GemError.invalidInput The recorder configuration is invalid.
- GemError.noDiskSpace Insufficient disk space available to start the recording.
- GemError.overheated The device temperature is too high to start the recording.
- GemError.general A general error occurred while attempting to stop the recording.
Throws
- An exception if it fails.
Implementation
Future<GemError> startRecording() async {
final String? resultString = await GemKitPlatform.instance
.getChannel(mapId: -1)
.invokeMethod<String>(
'callObjectMethod',
jsonEncode(<String, Object>{
'id': _pointerId,
'class': 'Recorder',
'method': 'startRecording',
'args': <dynamic, dynamic>{},
}),
);
return GemErrorExtension.fromCode(jsonDecode(resultString!)['result']);
}