Thank you @jovy ! Are you seeing any errors? What is happening when the second participant is pinned? Have you stepped through the function and verified the expected values are being used? Also, is this only happening when there are two participants, have you tested with more than two participants?
There is no error msg. It only able to one time.
I have 3 people in the call. First, I pinned A, then change to pin B. I pinned A again, then it is not switching. It still pinning B without any error msg
Have you verified that the userID for A is being used as expected? Sounds like once you pin B, the userID for A is not being used. Can you doubt-check by printing the userID values to confirm?
Hi @donte.zoom
I have checked logs for the user id, I can see it’s correct also I’m printing the username from the pin user id.
I printed logs when I switch between pin users,
for the first time it work, but the second onwards shows an error.
Please refer below logs
E/MyMeetingActivity: PIN userName > Jovy
E/MyMeetingActivity: PIN userId > 16780288
E/MyMeetingActivity: PIN status > SDKERR_WRONG_USEAGE
W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
in the last line after SDKERR_WRONG_USEAGE, I’m getting Attempted to finish an input event but the input event receiver has already been disposed. is it related to the pin user?
Please check and let me know if you can find something for this issue. Also please note that we got this issue only after updating zoom SDK to 5.11.3.7251 , before this function was working fine.
Also, the video of all users which I tried to pin is ON.
Thank you for following up on this topic. I reached out internally to get some additional feedback on the behavior you’ve reported and it looks like you’re calling pinVideo twice with the same userId value within that method, that could be one issue.
To verify the pinned user is being removed, can you add a log call inside of the if statement? This will help determine whether the pin was successful and also ensure the expected behavior of the pinning feature is working as expected:
tif (pinId > 0) {
// Add a log of the pinID here
mGalleryVideoViewMgr?.removeAttendeeVideoUnit(pinId)
videoController.pinVideo(false, pinId )
}
try {
var user = zoomSdk.inMeetingService.getUserInfoById(userId).userName
if (userId == getMyId()) {
// Add another log for the userId here
user = "$user (Me)"
}
I’m not calling pinUser id 2 times, actually, here videoController.pinVideo(false, pinId) I’m trying to unpin existing pined user first, but from line val pinId = videoController.pinnedUser I’m trying to get pinned user, but it always returns id = 0
Please check below logs for reference
E/ParticipantsFragment: select Jovy / 16779264
E/MyMeetingActivity: Current Pinned user: 0 //log of the pinID
E/MyMeetingActivity: New Pin id PIN > 16779264 // log for the userId
E/MyMeetingActivity: Pin status SDKERR_WRONG_USEAGE
W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
E/MyMeetingActivity: onUserVideoStatusChanged: 16779264 | Video_ON
For the above logs, it worked for the first time when I switch between users. after execution, I notice onUserVideoStatusChanged gets executed, but when I try to change pinned user for the second time onwards, it’s not working.
below are the logs when the pin user did not work
E/ParticipantsFragment: select Jovy Chiu / 16780288
E/MyMeetingActivity: Current Pinned user: 0 //log of the pinID
E/MyMeetingActivity: New Pin id PIN > 16780288 // log for the userId
E/MyMeetingActivity: Pin status SDKERR_WRONG_USEAGE
I made it work after removing all attendee videos and then adding videos for the selected user id.
private fun pinUser(userId: Long) {
val videoController = zoomSdk.inMeetingService.inMeetingVideoController
mGalleryVideoViewMgr?.removeAllVideoUnits()
try {
var user = zoomSdk.inMeetingService.getUserInfoById(userId).userName
if (userId == getMyId()) {
user = "$user (Me)"
}
binding.activeUser.text = user
}catch (e: Exception) {
e.printStackTrace()
}
val status = videoController.pinVideo(true, userId)
mGalleryVideoViewMgr?.addAttendeeVideoUnit(userId, renderInfo)
Log.e(TAG,"New Pin id PIN > $userId")
Log.e(TAG,"Pin status ${status.name}")
}```
Glad you hear you were able to resolve the behavior you were seeing and thank you for posting the solution as it will be of great benefit to other community members.