toggleCameraMuteState method

Future<HMSException?> toggleCameraMuteState()

To switch local peer's video on/off. This function toggles the current camera state i.e If camera is unmuted it will get muted If camera is muted it will get unmuted Refer toggle camera state guide here.

Implementation

Future<HMSException?> toggleCameraMuteState() async {
  bool result = await PlatformService.invokeMethod(
      PlatformMethod.toggleCameraMuteState);

  if (result) {
    return null;
  } else {
    return HMSException(
        message: "Camera mute/unmute failed",
        description: "Cannot toggle camera status",
        action: "VIDEO",
        params: {},
        isTerminal: false);
  }
}