SDKERR_WRONG_USEAGE on Pin video

Hi There,

I’m trying tthe o pin meeting participants video, but its working for first time, and when I try to change pinned video, its not working.

I tested this with 2 participants in meeting; both videos are ON. but its not working when trying to switch pinned video.

below is my code for reference.

    private fun pinUser(userId: Long) {
        val videoController = zoomSdk.inMeetingService.inMeetingVideoController

        val pinId = videoController.pinnedUser
        Log.e(TAG,"Pin > $pinId | ${videoController.isUserPinned(pinId)}")
        if (pinId > 0) {
            mGalleryVideoViewMgr?.removeAttendeeVideoUnit(pinId)
            videoController.pinVideo(false, pinId )
        }

        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,"PIN > ${status.name}")
    }

Hi, @jovy,

Can you share what version of the SDK you are using in your testing?

Hi @donte.zoom

Zoom SDK version is 5.11.3.7251

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?

Hi Donte,

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

Thanks

@jovy ,

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.

Hi

I would like to follow up this topic

thanks

@jovy,

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)"
            }

Hi @donte.zoom

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

@jovy ,

What value is returned for the pinned User if you call the getPinnedUser method?

val pinId = videoController.getPinnedUser()

getPinnedUser

https://marketplacefront.zoom.us/sdk/meeting/android/us/zoom/sdk/InMeetingVideoController.html#getPinnedUser()

Hi @donte.zoom

videoController.getPinnedUser() and videoController.pinnedUser is same function,
we write getPinnedUser() in java and pinnedUser in kotlin.

It returns value 0

Thanks for the clarification @jovy. I" ve reached out to internally resources and will follow up with what I learn.

Hi Donte

good day
May I follow up this

thanks

Hi Donte,

Would like to check if you have any news

Thanks

@jovy,

Thanks for following up, there is no update. More to follow as information becomes available.

Hi @donte.zoom

I finally fixed this error after many attempts.

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}")
    }```
1 Like

@jovy ,

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.

Happy Coding !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.