disable method

Future<bool> disable()

Disable virtual background processing.

The video track will return to showing the original camera feed.

Implementation

Future<bool> disable() async {
  if (!isSupported) {
    return true;
  }

  if (!_isEnabled) {
    return true;
  }

  try {
    final result = await _channel.invokeMethod<Map>('disable');

    final success = result?['success'] as bool? ?? false;
    if (success) {
      _isEnabled = false;
    }
    return success;
  } catch (e) {
    return false;
  }
}