AgoraRtcChannelDelegate 协议

Conforms to NSObject
Declared in AgoraRtcChannel.h

概览

AgoraRtcChannelDelegate 类

Since v3.0.0.

– rtcChannel:didOccurWarning:

发生警告回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didOccurWarning:(AgoraWarningCode)warningCode

参数

rtcChannel

AgoraRtcChannel

warningCode

AgoraWarningCode

详情

该回调方法表示 SDK 运行时出现了(网络或媒体相关的)警告。通常情况下,SDK 上报的警告信息 App 可以忽略,SDK 会自动恢复。比如和服务器失去连接时,SDK 可能会上报 AgoraWarningCodeOpenChannelTimeout(106) 警告,同时自动尝试重连。

详细的警告代码,见 AgoraWarningCode

Declared In

AgoraRtcChannel.h

– rtcChannel:didOccurError:

发生错误回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didOccurError:(AgoraErrorCode)errorCode

参数

rtcChannel

AgoraRtcChannel

errorCode

AgoraErrorCode

详情

该回调方法表示 SDK 运行时出现了(网络或媒体相关的)错误。通常情况下,SDK 上报的错误意味着 SDK 无法自动恢复,需要 App 干预或提示用户。 比如启动通话失败时,SDK 会上报 AgoraErrorCodeStartCall = 1002 错误。App 可以提示用户启动通话失败,并调用 leaveChannel 退出频道。

详细的错误代码,见 AgoraErrorCode

Declared In

AgoraRtcChannel.h

– rtcChannelDidJoinChannel:withUid:elapsed:

加入频道回调

- (void)rtcChannelDidJoinChannel:(AgoraRtcChannel *_Nonnull)rtcChannel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed

参数

rtcChannel

AgoraRtcChannel 类。

uid

用户ID。 如果在 joinChannelByToken 方法中指定了 uid,它会返回指定的 ID; 如果没有,它将返回由 Agora 服务器自动分配的 ID。

elapsed

从调用 joinChannelByToken 方法开始到发生此事件过去的时间(ms)。

Declared In

AgoraRtcChannel.h

– rtcChannelDidRejoinChannel:withUid:elapsed:

重新加入频道回调

- (void)rtcChannelDidRejoinChannel:(AgoraRtcChannel *_Nonnull)rtcChannel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed

参数

rtcChannel

AgoraRtcChannel 类。

uid

用户ID。 如果在 joinChannelByToken 方法中指定了 uid,它会返回指定的 ID; 如果没有,它将返回由 Agora 服务器自动分配的 ID。

elapsed

从调用 joinChannelByToken 开始到发生此事件过去的时间(ms)。

详情

有时候由于网络原因,客户端可能会和服务器失去连接,SDK 会进行自动重连,自动重连成功后触发此回调方法。

Declared In

AgoraRtcChannel.h

– rtcChannelDidLeaveChannel:withStats:

已离开频道回调

- (void)rtcChannelDidLeaveChannel:(AgoraRtcChannel *_Nonnull)rtcChannel withStats:(AgoraChannelStats *_Nonnull)stats

参数

rtcChannel

AgoraRtcChannel 类。

stats

通话相关的统计信息:AgoraChannelStats

详情

当用户调用 leaveChannel 离开频道后,SDK 会触发该回调。在该回调方法中,App 可以得到此次通话的总通话时长、SDK 收发数据的流量等信息。

Declared In

AgoraRtcChannel.h

– rtcChannel:didClientRoleChanged:newRole:

用户角色已切换回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole

参数

rtcChannel

AgoraRtcChannel

oldRole

切换前的角色

newRole

切换后的角色

详情

直播场景下,当本地用户在加入频道后调用 setClientRole 切换角色时会触发此回调,即主播切换为观众时,或观众切换为主播时。

Declared In

AgoraRtcChannel.h

– rtcChannel:didJoinedOfUid:elapsed:

远端用户/主播加入回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed

参数

rtcChannel

AgoraRtcChannel 类。

uid

新加入频道的远端用户/主播 ID。如果 joinChannelByToken 中指定了 uid,则此处返回该 ID;否则使用 Agora 服务器自动分配的 ID。

elapsed

从本地用户加入频道 joinChannelByToken 开始到发生此事件过去的时间(ms)。

详情

  • 通信场景下,该回调提示有远端用户加入了频道,并返回新加入用户的 ID;如果加入之前,已经有其他用户在频道中了,新加入的用户也会收到这些已有用户加入频道的回调。
  • 直播场景下,该回调提示有主播加入了频道,并返回该主播的 ID。如果在加入之前,已经有主播在频道中了,新加入的用户也会收到已有主播加入频道的回调。Agora 建议连麦主播不超过 17 人。

该回调在如下情况下会被触发:

  • 远端用户/主播调用 joinChannelByToken 方法加入频道
  • 远端用户加入频道后调用 setClientRole 将用户角色改变为主播
  • 远端用户/主播网络中断后重新加入频道
  • 主播通过调用 addInjectStreamUrl 方法成功输入在线媒体流

Note:

直播场景下,

  • 主播间能相互收到新主播加入频道的回调,并能获得该主播的 uid
  • 观众也能收到新主播加入频道的回调,并能获得该主播的 uid
  • 当 Web 端加入直播频道时,只要 Web 端有推流,SDK 会默认该 Web 端为主播,并触发该回调

Declared In

AgoraRtcChannel.h

– rtcChannel:didOfflineOfUid:reason:

远端用户(通信场景)/主播(直播场景)离开当前频道回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason

参数

rtcChannel

AgoraRtcChannel 类。

uid

离线的用户 ID。

reason

离线原因,详见 AgoraUserOfflineReason

详情

提示有远端用户/主播离开了频道(或掉线)。用户离开频道有两个原因,即正常离开和超时掉线:

  • 正常离开的时候,远端用户/主播会发送类似“再见”的消息,接收此消息后,判断用户离开频道。
  • 超时掉线的依据是,在一定时间内(通信场景为 20 秒,直播场景稍有延时),用户没有收到对方的任何数据包,则判定为对方掉线。在网络较差的情况下,有可能会误报。Agora 建议使用 Agora 实时消息 SDK 来做可靠的掉线检测。

Declared In

AgoraRtcChannel.h

– rtcChannel:connectionChangedToState:reason:

网络连接状态已改变回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel connectionChangedToState:(AgoraConnectionStateType)state reason:(AgoraConnectionChangedReason)reason

参数

rtcChannel

AgoraRtcChannel 类。

state

当前的网络连接状态,详见 AgoraConnectionStateType

reason

引起网络连接状态发生改变的原因,详见 AgoraConnectionChangedReason

详情

该回调在网络连接状态发生改变的时候触发,并告知用户当前的网络连接状态,和引起网络状态改变的原因。

Declared In

AgoraRtcChannel.h

– rtcChannelDidLost:

网络连接中断,且 SDK 无法在 10 秒内连接服务器回调

- (void)rtcChannelDidLost:(AgoraRtcChannel *_Nonnull)rtcChannel

参数

rtcChannel

AgoraRtcChannel 类。

详情

SDK 在调用 joinChannelByToken 后无论是否加入成功,只要 10 秒和服务器无法连接就会触发该回调。

如果 SDK 在断开连接后,20 分钟内还是没能重新加入频道,SDK 会停止尝试重连。

Declared In

AgoraRtcChannel.h

– rtcChannel:tokenPrivilegeWillExpire:

Token 服务即将过期回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel tokenPrivilegeWillExpire:(NSString *_Nonnull)token

参数

rtcChannel

AgoraRtcChannel 类。

token

即将服务失效的 Token

详情

在调用 joinChannelByToken 时如果指定了 Token,由于 Token 具有一定的时效,在通话过程中如果 Token 即将失效,SDK 会提前 30 秒触发该回调,提醒应用程序更新 Token。 当收到该回调时,用户需要重新在服务端生成新的 Token,然后调用 renewToken 将新生成的 Token 传给 SDK。

Declared In

AgoraRtcChannel.h

– rtcChannelRequestToken:

Token 过期回调

- (void)rtcChannelRequestToken:(AgoraRtcChannel *_Nonnull)rtcChannel

参数

rtcChannel

AgoraRtcChannel 类。

详情

在调用 joinChannelByToken 时如果指定了 Token,由于 Token 具有一定的时效,在通话过程中 SDK 可能由于网络原因和服务器失去连接,重连时可能需要新的 Token。 该回调通知 app 需要生成新的 Token,并调用 renewToken 更新 Token。

Declared In

AgoraRtcChannel.h

– rtcChannel:activeSpeaker:

监测到远端最活跃用户回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel activeSpeaker:(NSUInteger)speakerUid

参数

rtcChannel

AgoraRtcChannel 类。

speakerUid

远端最活跃用户的 ID。

详情

成功调用 enableAudioVolumeIndication 后,SDK 会持续监测音量 最大的远端用户,并统计该用户被判断为音量最大者的次数。当前时间段内,该次数累积最多的远端用户为最活跃的用户。

当频道内用户数量大于或等于 2 且有活跃用户时,SDK 会触发该回调并报告最活跃用户的 uid

  • 如果最活跃用户一直是同一位用户,则 SDK 不会再次触发 activeSpeaker 回调。
  • 如果最活跃用户有变化,则 SDK 会再次触发该回调并报告新的最活跃用户的 uid

Declared In

AgoraRtcChannel.h

– rtcChannel:videoSizeChangedOfUid:size:rotation:

本地或远端视频大小和旋转信息发生改变回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation

参数

rtcChannel

AgoraRtcChannel 类。

uid

图像尺寸和旋转信息发生变化的用户的用户 ID(本地用户的 uid 为 0)

size

新的视频尺寸

rotation

旋转信息 (0 到 360)

Declared In

AgoraRtcChannel.h

– rtcChannel:remoteVideoStateChangedOfUid:state:reason:elapsed:

远端视频状态发生改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(AgoraVideoRemoteStateReason)reason elapsed:(NSInteger)elapsed

参数

rtcChannel

AgoraRtcChannel 类。

uid

发生视频状态改变的远端用户 ID。

state

远端视频流状态。详见 AgoraVideoRemoteState

reason

远端视频流状态改变的具体原因。详见 AgoraVideoRemoteStateReason

elapsed

从本地用户调用 joinChannelByToken 方法到发生本事件经历的时间,单位为 ms。

Declared In

AgoraRtcChannel.h

– rtcChannel:superResolutionEnabledOfUid:enabled:reason:

报告超分辨率功能是否成功开启。(beta 功能)

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel superResolutionEnabledOfUid:(NSUInteger)uid enabled:(BOOL)enabled reason:(AgoraSuperResolutionStateReason)reason

参数

rtcChannel

AgoraRtcChannel 类。

uid

远端用户 ID。

enabled

是否对远端视频成功开启超分辨率:

  • YES: 成功开启超分辨率。
  • NO: 未成功开启超分辨率。
reason

超分辨率功能未成功开启的原因,详见 AgoraSuperResolutionStateReason

Availability

v3.5.1

调用 enableRemoteSuperResolution 后, SDK 触发该回调报告超分辨率是否成功开启。如果未成功开启,请通过 reason 排查问题。

Declared In

AgoraRtcChannel.h

– rtcChannel:remoteAudioStateChangedOfUid:state:reason:elapsed:

远端音频流状态发生改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel remoteAudioStateChangedOfUid:(NSUInteger)uid state:(AgoraAudioRemoteState)state reason:(AgoraAudioRemoteStateReason)reason elapsed:(NSInteger)elapsed

参数

rtcChannel

AgoraRtcChannel 类。

uid

发生音频状态改变的远端用户 ID。

state

远端音频流状态。详见 AgoraAudioRemoteState

reason

远端音频流状态改变的具体原因。详见 AgoraAudioRemoteStateReason

elapsed

从本地用户调用 joinChannelByToken 方法到发生本事件经历的时间,单位为 ms。

详情

远端用户/主播音频状态发生改变时,SDK 会触发该回调向本地用户报告当前的远端音频流状态。

Declared In

AgoraRtcChannel.h

– rtcChannel:didLocalPublishFallbackToAudioOnly:

本地发布流已回退为音频流

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didLocalPublishFallbackToAudioOnly:(BOOL)isFallbackOrRecover

参数

rtcChannel

AgoraRtcChannel 类。

isFallbackOrRecover
  • YES: 由于网络环境不理想,本地发布的媒体流已回退为音频流
  • NO: 由于网络环境改善,发布的音频流已恢复为音视频流

详情

Note:

如果你调用了设置本地推流回退选项 setLocalPublishFallbackOption 接口并将选项设置为 AgoraStreamFallbackOptionAudioOnly,当上行网络环境不理想、本地发布的媒体流回退为音频流时,或当上行网络改善、媒体流恢复为音视频流时,会触发该回调。

Declared In

AgoraRtcChannel.h

– rtcChannel:didRemoteSubscribeFallbackToAudioOnly:byUid:

远端订阅流已回退为音频流

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didRemoteSubscribeFallbackToAudioOnly:(BOOL)isFallbackOrRecover byUid:(NSUInteger)uid

参数

rtcChannel

AgoraRtcChannel 类。

isFallbackOrRecover

回退为音频流或恢复为音视频流:

  • YES: 由于网络环境不理想,远端订阅流已回退为音频流
  • NO: 由于网络环境改善,订阅的音频流已恢复为音视频流
uid

远端用户ID

详情

如果你调用了 setRemoteSubscribeFallbackOption, 接口并将回退选项设置为 AgoraStreamFallbackOptionAudioOnly,当下行网络环境不理想、仅接收远端音频流时,或当下行网络改善、恢复订阅音视频流时,会触发该回调。

Note:

远端订阅流因弱网环境不能同时满足音视频而回退为小流时,你可以使用 remoteVideoStats 方法来监控远端视频大小流的切换。

Declared In

AgoraRtcChannel.h

– rtcChannel:reportRtcStats:

当前通话统计回调。 该回调在通话或直播中每两秒触发一次。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel reportRtcStats:(AgoraChannelStats *_Nonnull)stats

参数

rtcChannel

AgoraRtcChannel 类。

stats

通话相关的数据统计信息,详见 AgoraChannelStats

Declared In

AgoraRtcChannel.h

– rtcChannel:networkQuality:txQuality:rxQuality:

通话中每个用户的网络上下行 last mile 质量报告回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality

参数

rtcChannel

AgoraRtcChannel 类。

uid

用户 ID。表示该回调报告的是持有该 ID 的用户的网络质量。当 uid 为 0 时,返回的是本地用户的网络质量。

txQuality

该用户的上行网络质量。基于上行视频的发送码率、上行丢包率、平均往返时延和网络抖动计算。该值代表当前的上行网络质量,帮助判断是否可以支持当前设置的视频编码属性。

假设上行码率是 500 Kbps,那么支持 480 x 480 的分辨率、30 fps 的帧率没有问题,但是支持 1280 x 720 的分辨率就会有困难。详见 AgoraNetworkQuality

rxQuality

该用户的下行网络质量。基于下行网络的丢包率、平均往返延时和网络抖动计算。详见 AgoraNetworkQuality

详情

该回调描述每个用户在通话中的 last mile 网络状态,其中 last mile 是指设备到 Agora 边缘服务器的网络状态。

该回调每 2 秒触发一次。如果远端有多个用户,该回调每 2 秒会被触发多次。

Note: 用户不发流时,txQualityUnknown ;用户不收流时,rxQualityUnknown

Declared In

AgoraRtcChannel.h

– rtcChannel:remoteVideoStats:

通话中每个用户的网络上下行 last mile 质量报告回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel remoteVideoStats:(AgoraRtcRemoteVideoStats *_Nonnull)stats

参数

rtcChannel

AgoraRtcChannel 类。

stats

Statistics of the received remote video streams. See AgoraRtcRemoteVideoStats.

详情

该回调描述每个用户在通话中的 last mile 网络状态,其中 last mile 是指设备到 Agora 边缘服务器的网络状态。

该回调每 2 秒触发一次。如果远端有多个用户,该回调每 2 秒会被触发多次。

Declared In

AgoraRtcChannel.h

– rtcChannel:remoteAudioStats:

通话中远端音频流的统计信息回调,用于取代 audioQualityOfUid

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel remoteAudioStats:(AgoraRtcRemoteAudioStats *_Nonnull)stats

参数

rtcChannel

AgoraRtcChannel 类。

stats

远端音频统计数据,详细定义见 AgoraRtcRemoteAudioStats

详情

该回调描述远端用户在通话中端到端的音频流统计信息,针对每个远端用户/主播每 2 秒触发一次。

如果远端同时存在多个用户/主播,该回调每 2 秒会被触发多次。

audioTransportStatsOfUid 回调相比,该回调更贴近用户的主观感受。

比如,当网络发生丢包时,因 FEC(Forward Error Correction,向前纠错码)或重传恢复,最终的音频丢帧率不高,则可以认为整个质量较好。

Declared In

AgoraRtcChannel.h

– rtcChannel:rtmpStreamingChangedToState:state:errorCode:

RTMP/RTMPS 推流状态发生改变回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel rtmpStreamingChangedToState:(NSString *_Nonnull)url state:(AgoraRtmpStreamingState)state errorCode:(AgoraRtmpStreamingErrorCode)errorCode

参数

rtcChannel

AgoraRtcChannel 类。

url

推流状态发生改变的 URL 地址。

state

当前的推流状态,详见 AgoraRtmpStreamingState

errorCode

具体的推流错误信息,详见 AgoraRtmpStreamingErrorCode

详情

该回调返回本地用户调用 addPublishStreamUrlremovePublishStreamUrl 方法的结果。

RTMP/RTMPS 推流状态发生改变时,SDK 会触发该回调,并在回调中明确状态发生改变的 URL 地址及当前推流状态。

该回调方便推流用户了解当前的推流状态;推流出错时,你可以通过返回的错误码了解出错的原因,方便排查问题。

Declared In

AgoraRtcChannel.h

– rtcChannel:rtmpStreamingEventWithUrl:eventCode:

RTMP/RTMPS 推流事件回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel rtmpStreamingEventWithUrl:(NSString *_Nonnull)url eventCode:(AgoraRtmpStreamingEvent)eventCode

参数

rtcChannel

AgoraRtcChannel 类。

url

RTMP/RTMPS 推流 URL。

eventCode

RTMP/RTMPS 推流事件码。详见 AgoraRtmpStreamingEvent

Availability

v3.1.0

Declared In

AgoraRtcChannel.h

– rtcChannelTranscodingUpdated:

旁路推流设置被更新回调

- (void)rtcChannelTranscodingUpdated:(AgoraRtcChannel *_Nonnull)rtcChannel

参数

rtcChannel

AgoraRtcChannel 类。

详情

setLiveTranscoding 方法中的直播参数 LiveTranscoding rtcEngineTranscodingUpdated 回调会被触发并向主播报告更新信息。

Note: 首次调用 setLiveTranscoding 方法设置转码参数 LiveTranscoding 时,不会触发此回调。

Declared In

AgoraRtcChannel.h

– rtcChannel:streamInjectedStatusOfUrl:uid:status:

输入外部视频流状态回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status

参数

rtcChannel

AgoraRtcChannel

url

输入进直播的外部视频源 URL 地址

uid

用户 ID

status

AgoraInjectStreamStatus

详情

Warning: 客户端输入在线媒体流功能即将停服。如果你尚未集成该功能,Agora 建议你不要使用。详见《部分服务下架计划》。

Declared In

AgoraRtcChannel.h

– rtcChannel:receiveStreamMessageFromUid:streamId:data:

接收到对方数据流消息的回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData *_Nonnull)data

参数

rtcChannel

AgoraRtcChannel

uid

用户ID

streamId

数据流 ID

data

接收到的数据

详情

该回调表示本地用户收到了远端用户调用 sendStreamMessage 方法发送的流消息。

Declared In

AgoraRtcChannel.h

– rtcChannel:didOccurStreamMessageErrorFromUid:streamId:error:missed:cached:

接收对方数据流消息错误的回调

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached

参数

rtcChannel

AgoraRtcChannel

uid

用户 ID

streamId

数据流 ID

error

错误代码: AgoraErrorCode

missed

丢失的消息数量

cached

数据流中断时,后面缓存的消息数量

详情

该回调表示本地用户未收到远端用户调用 sendStreamMessage 方法发送的流消息。

Declared In

AgoraRtcChannel.h

– rtcChannel:channelMediaRelayStateDidChange:error:

跨频道媒体流转发状态发生改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel channelMediaRelayStateDidChange:(AgoraChannelMediaRelayState)state error:(AgoraChannelMediaRelayError)error

参数

rtcChannel

AgoraRtcChannel 类。

state

跨频道媒体流转发状态 AgoraChannelMediaRelayState

error

跨频道媒体流转发出错的错误码 AgoraChannelMediaRelayError

详情

当跨频道媒体流转发状态发生改变时,SDK 会触发该回调,并报告当前的转发状态以及相关的错误信息。

Declared In

AgoraRtcChannel.h

– rtcChannel:didReceiveChannelMediaRelayEvent:

跨频道媒体流转发事件回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didReceiveChannelMediaRelayEvent:(AgoraChannelMediaRelayEvent)event

参数

rtcChannel

AgoraRtcChannel 类。

event

跨频道媒体流转发事件码 AgoraChannelMediaRelayEvent

详情

该回调报告跨频道媒体流转发过程中发生的事件。

Declared In

AgoraRtcChannel.h

– rtcChannel:didAudioPublishStateChange:newState:elapseSinceLastState:

音频发布状态改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didAudioPublishStateChange:(AgoraStreamPublishState)oldState newState:(AgoraStreamPublishState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState

参数

rtcChannel

AgoraRtcChannel 类。

oldState

之前的发布状态,详见 AgoraStreamPublishState

newState

当前的发布状态,详见 AgoraStreamPublishState

elapseSinceLastState

两次状态变化时间间隔(毫秒)。

Availability

v3.1.0

Declared In

AgoraRtcChannel.h

– rtcChannel:didVideoPublishStateChange:newState:elapseSinceLastState:

视频发布状态改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didVideoPublishStateChange:(AgoraStreamPublishState)oldState newState:(AgoraStreamPublishState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState

参数

rtcChannel

AgoraRtcChannel 类。

oldState

之前的发布状态,详见 AgoraStreamPublishState

newState

当前的发布状态,详见 AgoraStreamPublishState

elapseSinceLastState

两次状态变化时间间隔(毫秒)。

Availability

v3.1.0

Declared In

AgoraRtcChannel.h

– rtcChannel:didAudioSubscribeStateChange:oldState:newState:elapseSinceLastState:

音频订阅状态发生改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didAudioSubscribeStateChange:(NSUInteger)uid oldState:(AgoraStreamSubscribeState)oldState newState:(AgoraStreamSubscribeState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState

参数

rtcChannel

AgoraRtcChannel 类。

uid

远端用户的 ID。

oldState

之前的订阅状态,详见 AgoraStreamSubscribeState

newState

当前的订阅状态,详见 AgoraStreamSubscribeState

elapseSinceLastState

两次状态变化时间间隔(毫秒)。

Availability

v3.1.0

Declared In

AgoraRtcChannel.h

– rtcChannel:didVideoSubscribeStateChange:oldState:newState:elapseSinceLastState:

视频订阅状态发生改变回调。

- (void)rtcChannel:(AgoraRtcChannel *_Nonnull)rtcChannel didVideoSubscribeStateChange:(NSUInteger)uid oldState:(AgoraStreamSubscribeState)oldState newState:(AgoraStreamSubscribeState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState

参数

rtcChannel

AgoraRtcChannel 类。

uid

远端用户的 ID。

oldState

之前的订阅状态,详见 AgoraStreamSubscribeState

newState

当前的订阅状态,详见 AgoraStreamSubscribeState

elapseSinceLastState

两次状态变化时间间隔(毫秒)。

Availability

v3.1.0

Declared In

AgoraRtcChannel.h