音视频通话场景下,如何判断是否正在音视频通话中

一、仅使用 RongCallKit 的音视频通话内容,只是判断当前用户是否是在音视频通话中:

RCCallSession *currentCallSession = [RCCall sharedRCCall].currentCallSession;
if (currentCallSession && currentCallSession.mediaType == RCCallMediaAudio) {

//用户正在语音通话

}else if (currentCallSession && currentCallSession.mediaType == RCCallMediaVideo) {

//用户正在视频通话

} else {

//未通话
} 二、针对集成了 RongCallLib 的用户,只是判断当前用户是否是在音视频通话中:

RCCallSession *currentCallSession = [RCCallClient sharedRCCallClient].currentCallSession;
if (currentCallSession && currentCallSession.mediaType == RCCallMediaAudio) {

//用户正在语音通话

}else if (currentCallSession && currentCallSession.mediaType == RCCallMediaVideo) {

//用户正在视频通话

} else {

//未通话
} PS:如果是使用了 RTCLib 的音视频的功能,可以参考以下文档判断通道占用情况:

https://support.rongcloud.cn/ks/MTI5MQ== (https://www.rongcloud.cn/?utm_source=SEO) 详情查看:https://www.rongcloud.cn/?utm_source=SEO&utm_term=helloworld

评论

暂无评论