We have 2 different roles of users in our app which is trainers and students. We want to create a group chat session where 1 trainer and multiple students join
We have a session screen where trainers see himself as well as active speaker. We identify active speaker as meeting participant who is talking whereas this participant is not the trainer it self.
Please see following screenshot where top view is showing the trainer and down view is showing the active student.
Our Problem is catching the active speaker.
We noticed that this function is not triggering when someone speaks during the session: onActiveSpeakerVideoUserChanged
So we implemented following function which causes flickering on student view.
We seek assistance either how to use onActiveSpeakerVideoUserChanged or fixing the below functionality or any other suggestions.
mHandler.postDelayed({
if(mInMeetingService!= null && mInMeetingService!!.inMeetingVideoController!= null && mInMeetingService!!.inMeetingVideoController.activeVideoUserID() != null)
{
Log.d("HandlerActiveUser " , mInMeetingService!!.inMeetingVideoController.activeVideoUserID().toString())
val renderInfo = MobileRTCVideoUnitRenderInfo(0, 0, 100, 100)
renderInfo.aspect_mode = MobileRTCVideoUnitAspectMode.VIDEO_ASPECT_PAN_AND_SCAN
if(mInMeetingService!!.getUserInfoById(mInMeetingService!!.inMeetingVideoController.activeVideoUserID())!= null) {
val activeUser =
mInMeetingService!!.getUserInfoById(mInMeetingService!!.inMeetingVideoController.activeVideoUserID())
zoomClientVideoView.videoViewManager.removeAllAttendeeVideoUnit()
zoomClientVideoView.videoViewManager.addAttendeeVideoUnit(
mInMeetingService!!.inMeetingVideoController.activeVideoUserID(),
renderInfo
)
UpdateAttendeeInfo(activeUser)
}
}
checkActiveUser()
}, 1000)
}