parseUsernameFragment method

String? parseUsernameFragment(
  1. RTCIceCandidate candidate
)

Implementation

String? parseUsernameFragment(RTCIceCandidate candidate) {
  if (candidate.candidate == null || candidate.candidate!.isEmpty) {
    return null;
  }
  final regex = RegExp(r'ufrag\s+(\w+)');
  final match = regex.firstMatch(candidate.candidate!);
  return match?.group(1);
}