How to use additionalUserKey and onClick related questions

I want to give an onClick event to the avatar component that is also rendered in the video-canvas, but only the canvas is clicked continuously when I click in the developer tools. My expectation is that the image is still being rendered on the canvas and it is located on the avatar. Is there a good way?
Second, I want to render the video of the same user on a different canvas. I know I need to use an additionalUserKey, but I need an example or explanation that I can refer to. Can you provide it? Thank you.

Hey @Deneb , happy to help! :slight_smile:

Can you clarify this one more? I don’t fully understand.

You can just call renderVideo and pass in the same userId. :slight_smile:


In this code, i want to give an onClick event to the avatar, but i don’t receive the event because the canvas is constantly on top. I can’t seem to find a good way for the canvas to be placed on top of it while rendering the camera image continuously.
In the second answer, do you mean that you can put the userId that is renderingVideo into the canvas AdditionalUserKey? have a nice day😊

        className={classnames("video-container", {
          "in-sharing": shareScreenState || layoutChange,

        <ul className="avatar-list">
          {, index) => {
            if (index > videoLayout.length - 1) {
              return null;
            const dimension = videoLayout[index];
            const { width, height, x, y } = dimension;
            const { height: canvasHeight } = canvasDimension;
            return (
                isActive={activeVideo === user.userId}
                  width: `${width}px`,
                  height: `${height}px`,
                  top: `${canvasHeight - y - height}px`,
                  left: `${x}px`,

Hey @Deneb

The first one, you can consider setting the zIndex of Avatar component or setting the canvas as pointer-events:none to not react with the click events.

The second one, AdditionalUserKey is used in the case of rendering multiple users with the same userId on the same canvas, the AdditionalUserKey is an extra key combined with userId to identify the unique drawing cell on the canvas. Following is the example:

// render the same user in different location

// adjust the position of the second drawing

// stop one of the videos, the other videos of same user id still preserved


1 Like

God, I tried z-index, but didn’t know pointer-events:none. Thank you so much for the example below. Have a nice day

1 Like

Happy to help! :slight_smile:


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