DEV Community

Vitor Norton for SuperViz

Posted on

2 1

How to remove Presence3D when leaving a Video Conference

Hey there, today I want to share with you a quick tip on how to remove Presence3D when leaving a Video Conference, especially if you are migrating from version 4.

On v5, the components (such as Presence3D and Video Conference) are initialized separately, so you need to make sure you are removing both of them.

This is different from v4, where the components were initialized together and the participant would be removed from the 3D automatically once leaving the meeting.

The best way to remove the participant from the 3D model is to listen to an event from Video Conference for when the participant leaves, and for that you can use the MY_PARTICIPANT_LEFT event.

This will trigger once the current participant clicks on the “Leave” button, and then we can remove the Presence3D.

Here is what the code should look like:

video.subscribe("my-participant.left", onMyParticipantLeft);

function onMyParticipantLeft(participant) {
    room.removeComponent(presence);
}
Enter fullscreen mode Exit fullscreen mode

We hope this helps you to create amazing video experiences with SuperViz. If you are migrating from v4, please check out our migration guide for more details. If you have any questions or feedback, please join us at our Discord server.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more