Error in videoSDK at participant side

Description
can’t load host video at participant side

Browser Console Error
Detected unrecognised user ignoring ID {userID}

Which Web Video SDK version?
1.3.0

Hey @vamshidudducts ,

Please fill out the post template so we have enough info to help. :slight_smile:


Description
A clear and concise description of what the question is.

Browser Console Error
The full error message or issue you are running into.

Which Web Video SDK version?
Knowing the version can help us to identify your issue faster. [e.g. 1.0]

Video SDK Code Snippets
The code snippets that are causing the error / issue so we can reproduce.

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Screenshots
If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

  • Device: [e.g. Macbook Pro]
  • OS: [e.g. macOS 11]
  • Browser: [e.g. Chrome]
  • Browser Version [e.g. 88.0.4324.150 (Official Build) (x86_64)]

Additional context
Add any other context about the problem here.


Thanks,
Tommy

Video SDK Code Snippets

const onPeerVideoStateChangedListener = (zoomClient, mediaStream) => {
    zoomClient.on('peer-video-state-change', async (payload) => {
        console.log('onPeerVideoStateChange', payload);
        
        const { action, userId } = payload;

        if (userId !== state.participantId) {
            console.log('Detected unrecognized participant ID. Ignoring: ', userId);
            return;
        }

        if (action === PEER_VIDEO_STATE_CHANGE_ACTION_TYPE.Start) {
            toggleParticipantVideo(mediaStream, true);
        } else if (action === 'Stop') {
            toggleParticipantVideo(mediaStream, false);
        }
    });
};

To Reproduce(If applicable)
Steps to reproduce the behavior:

1.host joins session
2.participant join session
3. at host side both videos are rendered(host’s and participant’s)
4.at participant side only participant video is rendered.

Device (please complete the following information):

  • Device: Macbook Pro
  • OS: macOS 12.4
  • Browser: [Chrome]
  • Browser Version 103.0.5060.53 (Official Build) (x86_64)

Additional context
This below error is consoled when host joins
Detected unrecognized participant ID. Ignoring

@tommy

Hi @vic.yang @tommy ,
any inputs on this error ?

Hey @vamshidudducts

Does the code jump out of here if (userId !== state.participantId) { ?
Could you provide the assignment of state.participantId?

Thanks
Vic

code enters if (userId !== state.participantId) condition and console’s

Detected unrecognized participant ID. Ignoring

assignment of state.participantId is happening here.

const handleParticipantChange = (payloadEntry, addRemoveType) => {
    const { userId } = payloadEntry;

    // For this demo, only a single participant is handled to keep things simple
    // and succinct. This can be extended into a participant array/set here 
    if (userId === undefined) {
        return;
    }
    
    switch (addRemoveType) {
        case PARTICIPANT_CHANGE_TYPE.ADD:
            
            if (userId !== state.selfId && !state.hasParticipant) {
                console.log("userId",userId)
                state.participantId = userId;
                state.hasParticipant = !state.hasParticipant;
            } else {
                console.log('Detected new participant. Ignoring: ', userId);
                console.log('State has participant: ', state.hasParticipant);
                console.log('Participant ID: ', state.participantId);
            }
            break;
        case PARTICIPANT_CHANGE_TYPE.REMOVE:
            if (userId !== state.selfId && state.hasParticipant) {
                state.resetParticipantId();
                state.hasParticipant = !state.hasParticipant;
            } else {
                console.log('Detected unknown participant leaving. Ignoring: ', userId);
                console.log('Participant ID: ', state.participantId);
            }
            break;
        default:
            console.log('Unexpected ADD_REMOVE_TYPE');
            break;
    }
    
}

This error is occurred while trying out the official web-sample for videoSDK
Link to web-Sample: Link
@vic.yang

Hey @vamshidudducts

I apologize that we haven’t updated the sample code in time.

The participants should be assigned to an array object. Here is the pseudocode:

const participants =[];
switch(addRemoveType){
  case PARTICIPANT_CHANGE_TYPE.ADD:
    participants.push(payloadEntry.userId);
    // ...
    break;
  case PARTICIPANT_CHANGE_TYPE.REMOVE:
    const index = participants.findIndex(payloadEntry.userId);
    participants.splice(index,1);
    // ...
    break;
   // ...
}
zoomClient.on('peer-video-state-change', async (payload) => {
  if(!state.participants.includes(payload.userId)){
    console.log('Detected unrecognized participant ID. Ignoring: ',payload.userId);
    return;
  }
  // ...
})

Hope this can help you.

Thanks
Vic

Hi @vic.yang ,
can you please update sample code ?
still facing same issue after applying above code .

Hi @vic.yang ,
another error noticed when updated to above code

{type: 'INVALID_PARAMETERS', reason: 'user is not send video'}
reason: "user is not send video"
type: "INVALID_PARAMETERS"

any inputs on this?

Hey @vamshidudducts

OK. I will contact our engineer to update the sample code.

Thanks
Vic

Hey @vamshidudducts

It would be better to check the video state of the user before rendering the video, calling client.getAllUser() to obtain the user’s list, the bVideoOn property indicates whether the user is starting video.

Thanks
Vic

1 Like

Hey @vic.yang ,
Thank you .
I’ll try to check this.

Hi @vic.yang ,
any update regarding the sample code?

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