fromDeviceState static method

ZegoUIKitDeviceExceptionType? fromDeviceState(
  1. ZegoRemoteDeviceState value
)

Implementation

static ZegoUIKitDeviceExceptionType? fromDeviceState(
  ZegoRemoteDeviceState value,
) {
  switch (value) {
    case ZegoRemoteDeviceState.GenericError:
      return ZegoUIKitDeviceExceptionType.generic;
    case ZegoRemoteDeviceState.InvalidID:
      return ZegoUIKitDeviceExceptionType.invalidId;
    case ZegoRemoteDeviceState.NoAuthorization:
      return ZegoUIKitDeviceExceptionType.permissionNotGranted;
    case ZegoRemoteDeviceState.ZeroFPS:
      return ZegoUIKitDeviceExceptionType.zeroCaptureFps;
    case ZegoRemoteDeviceState.InUseByOther:
      return ZegoUIKitDeviceExceptionType.deviceOccupied;
    case ZegoRemoteDeviceState.Unplugged:
      return ZegoUIKitDeviceExceptionType.deviceUnplugged;
    case ZegoRemoteDeviceState.RebootRequired:
      return ZegoUIKitDeviceExceptionType.rebootRequired;
    case ZegoRemoteDeviceState.SystemMediaServicesLost:
      return ZegoUIKitDeviceExceptionType.mediaServicesWereLost;
    case ZegoRemoteDeviceState.Interruption:
      return ZegoUIKitDeviceExceptionType.interruption;
    case ZegoRemoteDeviceState.InBackground:
      return ZegoUIKitDeviceExceptionType.inBackground;
    case ZegoRemoteDeviceState.MultiForegroundApp:
      return ZegoUIKitDeviceExceptionType.multiForegroundApp;
    case ZegoRemoteDeviceState.BySystemPressure:
      return ZegoUIKitDeviceExceptionType.bySystemPressure;
    case ZegoRemoteDeviceState.NotSupport:
    case ZegoRemoteDeviceState.Open:
    case ZegoRemoteDeviceState.Disable:
    case ZegoRemoteDeviceState.Mute:
      // not error
      return null;
  }
}