我正在将AGORA开放式视频通话与我的一个移动应用程序集成在一起。我们想显示视频通话中每个与会者的姓名和音频状态(静音/取消静音)。我该如何实现?
我正在使用的代码参考/示例:https://github.com/AgoraIO/Basic-Video-Call/tree/master/Group-Video/OpenVideoCall-Android
Agora SDK:io.agora.rtc:full-sdk:2.4.1
非常感谢
答案 0 :(得分:1)
在Agora的Android SDK中,onUserMuteAudio
中有一个IRtcEngineEventHandler
回调。每当频道中的用户静音或取消静音音频时,都会触发此回调。
您的实现应如下所示:
// Handle Stream Events
private final IRtcEngineEventHandler mRtcEventHandler = new IRtcEngineEventHandler() {
// remote user has toggled their video
@Override
public void onUserMuteAudio(final int uid, final boolean toggle) { // Tutorial Step 10
runOnUiThread(new Runnable() {
@Override
public void run() {
if(toggle) {
Log.i(LOG_TAG, "MUTE: remote user with uid:" + uid + " muted their microphone");
} else {
Log.i(LOG_TAG, "UNMUTE: remote user with uid:" + uid + " unmuted their microphone");
}
}
});
}
};