switchState method

void switchState({
  1. String? userID,
})

switch userID camera state, if userID is empty, then it refers to local user

Implementation

void switchState({String? userID}) {
  ZegoLoggerService.logInfo(
    "switchState,"
    "userID:$userID, ",
    tag: 'audio room',
    subTag: 'controller.audioVideo.camera',
  );

  final targetUserID = userID ?? ZegoUIKit().getLocalUser().id;
  final currentCameraState =
      ZegoUIKit().getCameraStateNotifier(targetUserID).value;

  turnOn(!currentCameraState, userID: targetUserID);
}