toggleVideo method

Future<bool> toggleVideo()

Implementation

Future<bool> toggleVideo() async {
  var local = getLocalAttendee();
  var res = local.isVideoOn
      ? await methodChannelProvider.callMethod(MethodCallOption.localVideoOff)
      : await methodChannelProvider.callMethod(MethodCallOption.localVideoOn);
  if (res == null || !res.result) {
    throw 'Failed to toggle your audio';
  }
  await Future.delayed(const Duration(milliseconds: 1000));
  return getLocalAttendee().isVideoOn;
}