In real-time audio or video communication, you can use the Agora RTM SDK or the Agora RTC SDK to determine whether an incoming or ongoing call is an audio call or a video call.
If you need to determine and send the call type to the receiver before a call, ensure that you have integrated the RTM SDK and the RTC SDK. Refer to the following articles to learn more about integration:
Complete the following steps to determine the call type:
sendMessageToPeer
to send the call type to the callee via peer-to-peer message. The callee gets the call type from the received peer-to-peer message.If you need to determine and send the call type to the receiver during a call, ensure that you have integrated the RTC SDK. Refer to the following article:
During a call, the receiver can determine the call type according to the following guideline:
onRemoteVideoStateChanged
callback, the current call is a video call.onRemoteVideoStateChanged
callback and receives the onRemoteAudioStateChanged
callback, the current call is an audio call.This article references the names of Java methods and callbacks. The following table shows the corresponding methods and callbacks for other languages.
Java/C++ | Objective-C | JavaScript |
---|---|---|
sendMessageToPeer |
sendMessage:toPeer:sendMessageOptions:completion: |
sendMessage |
onRemoteAudioStateChanged |
remoteAudioStateChangedOfUid |
getRemoteAudioStats |
onRemoteVideoStateChanged |
remoteVideoStateChangedOfUid |
getRemoteVideoStats |