typedef NS_ENUM(NSUInteger, ByteRTCUserOfflineReason)
远端用户离开房间的原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCUserOfflineReasonQuit | 0 | 远端用户调用 leaveRoom 方法主动退出房间。 |
| ByteRTCUserOfflineReasonDropped | 1 | 远端用户因网络等原因掉线。 |
| ByteRTCUserOfflineReasonSwitchToInvisible | 2 | 远端用户切换至隐身状态。 |
| ByteRTCUserOfflineReasonKickedByAdmin | 3 | 远端用户被踢出出房间。 因调用踢出用户的 OpenAPI,远端用户被踢出房间。 |
typedef NS_ENUM(NSInteger, ByteRTCConnectionState)
SDK 与信令服务器连接状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCConnectionStateDisconnected | 1 | 连接断开超过 12s,此时 SDK 会尝试自动重连。 |
| ByteRTCConnectionStateConnecting | 2 | 首次请求建立连接,正在连接中。 |
| ByteRTCConnectionStateConnected | 3 | 首次连接成功。 |
| ByteRTCConnectionStateReconnecting | 4 | 涵盖了以下情况: + 首次连接时,10秒连接不成功; + 连接成功后,断连 10 秒。自动重连中。 |
| ByteRTCConnectionStateReconnected | 5 | 连接断开后,重连成功。 |
| ByteRTCConnectionStateLost | 6 | 处于 ByteRTCConnectionStateDisconnected 状态超过 10 秒,且期间重连未成功。SDK 仍将继续尝试重连。 |
| ByteRTCConnectionStateFailed | 7 | 连接失败,服务端状态异常。SDK 不会自动重连,请重新进房,或联系技术支持。 |
typedef NS_ENUM(NSInteger, ByteRTCNetworkType)
SDK 网络连接类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCNetworkTypeUnknown | -1 | 网络连接类型未知。 |
| ByteRTCNetworkTypeDisconnected | 0 | 网络连接已断开。 |
| ByteRTCNetworkTypeLAN | 1 | 网络连接类型为 LAN 。 |
| ByteRTCNetworkTypeWIFI | 2 | 网络连接类型为 Wi-Fi(包含热点)。 |
| ByteRTCNetworkTypeMobile2G | 3 | 网络连接类型为 2G 移动网络。 |
| ByteRTCNetworkTypeMobile3G | 4 | 网络连接类型为 3G 移动网络。 |
| ByteRTCNetworkTypeMobile4G | 5 | 网络连接类型为 4G 移动网络。 |
| ByteRTCNetworkTypeMobile5G | 6 | 网络连接类型为 5G 移动网络。 |
typedef NS_ENUM(NSUInteger, ByteRTCNetworkQuality)
媒体流网络质量。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCNetworkQualityUnknown | 0 | 网络质量未知。 |
| ByteRTCNetworkQualityExcellent | 1 | 网络质量极好。 |
| ByteRTCNetworkQualityGood | 2 | 主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。 |
| ByteRTCNetworkQualityPoor | 3 | 主观感受有瑕疵但不影响沟通。 |
| ByteRTCNetworkQualityBad | 4 | 勉强能沟通但不顺畅。 |
| ByteRTCNetworkQualityVeryBad | 5 | 网络质量非常差,基本不能沟通。 |
| ByteRTCNetworkQualityDown | 6 | 网络连接断开,无法通话。网络可能由于 12s 内无应答、开启飞行模式、拔掉网线等原因断开。 更多网络状态信息参见 连接状态提示。 |
typedef NS_ENUM(NSUInteger, ByteRTCLogLevel)
日志输出等级。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLogLevelTrace | 0 | 打印 trace 级别及以上级别信息。 |
| ByteRTCLogLevelDebug | 1 | 打印 debug 级别及以上级别信息。 |
| ByteRTCLogLevelInfo | 2 | 打印 info 级别及以上级别信息。 |
| ByteRTCLogLevelWarning | 3 | 打印 warning 级别及以上级别信息。 |
| ByteRTCLogLevelError | 4 | 打印 error 级别信息。 |
typedef NS_ENUM(NSInteger, ByteRTCMessageConfig)
发送消息的可靠有序类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMessageConfigReliableOrdered | 0 | 低延时可靠有序消息 |
| ByteRTCMessageConfigUnreliableOrdered | 1 | 超低延时有序消息 |
| ByteRTCMessageConfigUnreliableUnordered | 2 | 超低延时无序消息 |
typedef NS_ENUM(NSInteger, ByteRTCUserOnlineStatus)
用户在线状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCUserOnlineStatusOffline | 0 | 对端用户离线 对端用户已经调用 logout,或者没有调用 login:uid: 进行登录 |
| ByteRTCUserOnlineStatusOnline | 1 | 对端用户在线 对端用户调用 login:uid: 登录,并且连接状态正常 |
| ByteRTCUserOnlineStatusUnreachable | 2 | 无法获取对端用户在线状态 发生级联错误、对端用户在线状态异常时返回 |
typedef NS_ENUM(NSUInteger, ByteRTCLocalLogLevel)
日志输出等级。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalLogLevelInfo | 0 | 输出 INFO、WARNING、ERROR 级别的日志。 |
| ByteRTCLocalLogLevelWarning | 1 | (默认值)仅输出 WARNING、ERROR 级别的日志。 |
| ByteRTCLocalLogLevelError | 2 | 仅输出 ERROR 级别的日志。 |
| ByteRTCLocalLogLevelNone | 3 | 不输出日志。 |
@interface ByteRTCSysStats : NSObject
App 使用的 cpu 和 memory 信息
信息由 SDK 周期性(2s)地通过 reportSysStats 回调事件通知给用户。
| 类型 | 名称 |
|---|---|
| unsigned | cpu_cores |
| double | cpu_app_usage |
| double | memory_usage |
| unsigned | full_memory |
| unsigned | total_memory_usage |
| unsigned | free_memory |
| double | memory_ratio |
| double | total_memory_ratio |
@property(assign, nonatomic) unsigned int cpu_cores;
当前系统 cpu 核数
@property(assign, nonatomic) double cpu_app_usage;
当前应用的 CPU 使用率,取值范围为 [0, 1]。
@property(assign, nonatomic) double memory_usage;
当前App的内存使用(单位 MB)
@property(assign, nonatomic) unsigned long long full_memory;
全量内存(单位MB)
@property(assign, nonatomic) unsigned long long total_memory_usage;
系统已使用内存(单位MB)
@property(assign, nonatomic) unsigned long long free_memory;
空闲可分配内存(单位MB)
@property(assign, nonatomic) double memory_ratio;
当前应用的内存使用率(单位 %)
@property(assign, nonatomic) double total_memory_ratio;
系统内存使用率(单位 %)
@interface ByteRTCLogConfig : NSObject
SDK 日志配置。
| 类型 | 名称 |
|---|---|
| NSString* | logPath |
| ByteRTCLocalLogLevel | logLevel |
| int | logFileSize |
@property(copy, nonatomic) NSString *_Nonnull logPath;
日志存储路径。
@property(assign, nonatomic) ByteRTCLocalLogLevel logLevel;
日志输出等级,参看 ByteRTCLocalLogLevel,默认为警告级别。
@property(assign, nonatomic) int logFileSize;
日志可使用的最大缓存空间,单位为 MB。取值范围为 1~100 MB,默认值为 10 MB。
@interface ByteRTCCloudProxyInfo: NSObject
云代理信息
| 类型 | 名称 |
|---|---|
| NSString* | cloudProxyIp |
| int | cloudProxyPort |
@property(strong, nonatomic) NSString* _Nonnull cloudProxyIp;
云代理服务器 IP
@property(assign, nonatomic) int cloudProxyPort;
云代理服务器端口
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyType)
本地代理的类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalProxyTypeSocks5 | 1 | Socks5 代理。选用此代理服务器,需满足 Socks5 协议标准文档的要求。 |
| ByteRTCLocalProxyTypeHttpTunnel | 2 | Http 隧道代理。 |
@interface ByteRTCLocalProxyInfo : NSObject
本地代理配置详细信息。
| 类型 | 名称 |
|---|---|
| ByteRTCLocalProxyType | localProxyType |
| NSString* | localProxyIp |
| int | localProxyPort |
| NSString* | localProxyUsername |
| NSString* | localProxyPassword |
@property(assign, nonatomic) ByteRTCLocalProxyType localProxyType;
本地代理的类型,参看 ByteRTCLocalProxyType。
@property(copy, nonatomic) NSString * _Nullable localProxyIp;
本地代理服务器 IP。
@property(assign, nonatomic) int localProxyPort;
本地代理服务器端口。
@property(copy, nonatomic) NSString * _Nullable localProxyUsername;
本地代理用户名。
@property(copy, nonatomic) NSString * _Nullable localProxyPassword;
本地代理密码。
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyState)
本地代理连接状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalProxyStateInited | 0 | TCP 代理服务器连接成功。 |
| ByteRTCLocalProxyStateConnected | 1 | 本地代理连接成功。 |
| ByteRTCLocalProxyStateError | 2 | 本地代理连接出现错误。 |
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyError)
本地代理错误。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalProxyErrorOK | 0 | 本地代理服务器无错误。 |
| ByteRTCLocalProxyErrorSocks5VersionError | 1 | 代理服务器回复的版本号不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorSocks5FormatError | 2 | 代理服务器回复的格式错误不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorSocks5InvalidValue | 3 | 代理服务器回复的字段值不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorSocks5UserPassNotGiven | 4 | 未提供代理服务器的用户名及密码,导致 Socks5 代理连接失败。请重新调用 setLocalProxy,在设置本地代理时填入用户名和密码。 |
| ByteRTCLocalProxyErrorSocks5TcpClosed | 5 | TCP 关闭,导致 Socks5 代理连接失败。请检查网络或者代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorHttpTunnelFailed | 6 | Http 隧道代理错误。请检查 Http 隧道代理服务器或者网络是否存在异常。 |
typedef NS_ENUM(NSInteger, ByteRTCReturnStatus)
方法调用结果。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCReturnStatusSuccess | 0 | 成功。 |
| ByteRTCReturnStatusFailure | -1 | 失败。 |
| ByteRTCReturnStatusParameterErr | -2 | 参数错误。确认传入的参数类型,数值不超过边界等。 |
| ByteRTCReturnStatusWrongState | -3 | 接口状态错误。确认当前的调用时机符合接口要求等。 |
| ByteRTCReturnStatusHasInRoom | -4 | 失败,用户已在房间内。 |
| ByteRTCReturnStatusHasInLogin | -5 | 失败,用户已登录。 |
| ByteRTCReturnStatusHasInEchoTest | -6 | 失败,用户已经在进行通话回路测试中。 |
| ByteRTCReturnStatusNeitherVideoNorAudio | -7 | 失败,音视频均未采集。 |
| ByteRTCReturnStatusRoomIdInUse | -8 | 失败,该 roomId 已被使用。 |
| ByteRTCReturnStatusScreenNotSupport | -9 | 失败,屏幕流不支持。 |
| ByteRTCReturnStatusNotSupport | -10 | 失败,不支持该操作。 |
| ByteRTCReturnStatusResourceOverflow | -11 | 失败,资源已占用。 |
| ByteRTCReturnStatusAudioNoFrame | -101 | 失败,没有音频帧。 |
| ByteRTCReturnStatusAudioNotImplemented | -102 | 失败,未实现。 |
| ByteRTCReturnStatusAudioNoPermission | -103 | 失败,采集设备无麦克风权限,尝试初始化设备失败。 |
| ByteRTCReturnStatusAudioDeviceNotExists | -104 | 失败,设备不存在。当前没有设备或设备被移除时返回该值。 |
| ByteRTCReturnStatusAudioDeviceFormatNotSupport | -105 | 失败,设备音频格式不支持。 |
| ByteRTCReturnStatusAudioDeviceNoDevice | -106 | 失败,系统无可用设备。 |
| ByteRTCReturnStatusAudioDeviceCannotUse | -107 | 失败,当前设备不可用,需更换设备。 |
| ByteRTCReturnStatusAudioDeviceInitFailed | -108 | 系统错误,设备初始化失败。 |
| ByteRTCReturnStatusAudioDeviceStartFailed | -109 | 系统错误,设备开启失败。 |
| ByteRTCReturnStatusNativeInValid | -201 | 失败。底层未初始化,engine 无效。 |