stopCloudRecording method

Future<void> stopCloudRecording({
  1. required AgoraConnectionData connectionData,
})

Implementation

Future<void> stopCloudRecording(
    {required AgoraConnectionData connectionData}) async {
  final response = await http.post(
    Uri.parse(
        '${connectionData.cloudRecordingUrl}/stop-recording/${connectionData.channelName}/${value.sid}/${value.resourceId}'),
  );

  if (response.statusCode == HttpStatus.ok) {
    log('Recording Ended', level: Level.warning.value);
    if (connectionData.cloudRecordingCallback != null) {
      connectionData.cloudRecordingCallback!(
          jsonDecode(response.body)['mp4_link'],
          jsonDecode(response.body)['m3u8_link']);
    }
  } else {
    log('Couldn\'t end the recording : ${response.statusCode}',
        level: Level.error.value);
  }
}