pauseVideoStreaming method

Future<void> pauseVideoStreaming()

Pause video recording.

This feature is only available on iOS and Android sdk 24+.

Implementation

Future<void> pauseVideoStreaming() async {
  if (!value.isInitialized! || _isDisposed) {
    throw CameraException(
      'Uninitialized CameraController',
      'pauseVideoStreaming was called on uninitialized CameraController',
    );
  }
  if (!value.isStreamingVideoRtmp!) {
    throw CameraException(
      'No video is recording',
      'pauseVideoStreaming was called when no video is streaming.',
    );
  }
  try {
    value = value.copyWith(isStreamingPaused: true);
    await _channel.invokeMethod<void>(
      'pauseVideoStreaming',
      <String, dynamic>{'textureId': _textureId},
    );
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message);
  }
}