通知
本站点除 Legacy 产品与方案外,已迁移至 声网新文档中心 ,当前页面不再维护
Documentation
All
Console 官网 Community Technical support

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

Type: Integration issues    Platform: Android / iOS / macOS / Web / Windows / Linux   Last Updated: 2022/09/14 23:45:48

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-C JavaScript
sendMessageToPeer sendMessage:toPeer:sendMessageOptions:completion: sendMessage
onRemoteAudioStateChanged remoteAudioStateChangedOfUid getRemoteAudioStats
onRemoteVideoStateChanged remoteVideoStateChangedOfUid getRemoteVideoStats