pauseVideoStreamPlay method

Future<void> pauseVideoStreamPlay()

Pause video stream play. Only supports ios

Implementation

Future<void> pauseVideoStreamPlay() async {
  if (!value.isInitialized! || _isDisposed) {
    throw CameraException(
      'Uninitialized CameraController',
      'pauseVideoStream was called on uninitialized CameraController',
    );
  }
  if (!value.isStreamingVideoRtmp!) {
    throw CameraException(
      'No video is Streaming',
      'pauseVideoStream was called when no video is Streaming.',
    );
  }
  if (value.isStreamingPaused) {
    throw CameraException(
      'No video is Paused',
      'pauseVideoStream was called when no video is Streaming.',
    );
  }
  if (!Platform.isIOS) {
    throw CameraException(
      'Unsupported platforms.',
      'pauseVideoStream Only supports Ios.',
    );
  }
  try {
    value = value.copyWith(isStreamingPaused: true);
    await _channel.invokeMethod<void>(
      'pauseStream',
      <String, dynamic>{},
    );
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message);
  }
}