Skip to main content

How can I determine whether a call is an audio call or a video call?

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.

Before a 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:

  1. When the caller sends a call, use the Call Invitation API of the RTM SDK to send a call invitation to the callee.
  2. Call 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.

After a call

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:

Corresponding methods and callbacks

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-CJavaScript
sendMessageToPeersendMessage:toPeer:sendMessageOptions:completion:sendMessage
onRemoteAudioStateChangedremoteAudioStateChangedOfUidgetRemoteAudioStats
onRemoteVideoStateChangedremoteVideoStateChangedOfUidgetRemoteVideoStats

Page Content