Skip to content

Web Component#

OpenVidu Meet's Web Component allows embedding the refined, well-crafted OpenVidu Meet interface directly into your application. It offers attributes to customize the videoconferencing experience, exposes commands for programmatic control, and emits events for integration with your own application's logic.

Installation#

Include the following script in your HTML:

<script src="https://{{ your-domain }}/meet/v1/openvidu-meet.js"></script>

Usage#

Add the <openvidu-meet> tag to your HTML. This will embed OpenVidu Meet interface into your application:

<openvidu-meet room-url="{{ my-room-url }}"></openvidu-meet>

One of room-url or recording-url is required: the former determines the room to access, the latter the recording to display. Different instances of the web component using the same room URL will join the same meeting.

A room URL is a room access link

The room URL is simply a room access link: the URL an individual opens to access a room. The role and identity a participant gets depend on which access link you use. This guide and most examples use the anonymous moderator/speaker links for simplicity, but a room also has user and identified-guest links — see Room Access for the full picture.

You can obtain a room's access links programmatically from your backend with the REST API: the access.anonymous.moderator.url, access.anonymous.speaker.url and access.user.url properties of the MeetRoom object, or the unique accessUrl of an identified-guest member.

Content Security Policy#

The Web Component runs in your page and opens its connections to OpenVidu Meet from it. If your page sets a Content Security Policy , allow the OpenVidu Meet origin in connect-src for HTTPS requests and for WebSocket too (wss://). The realtime connection of a participant waiting to be admitted uses the WebSocket one.

Content-Security-Policy: connect-src 'self' https://{{ your-domain }} wss://{{ your-domain }}

API Reference#

Attributes#

Declare attributes in the component to customize the meeting for your user.

Attribute Description Required
room-url The OpenVidu Meet room URL to access to. Yes (This attribute is required unless recording-url is provided.)
recording-url The URL of a recording to view. Yes (This attribute is required unless room-url is provided.)
participant-name Display name for the local participant. It fills and locks the join screen's name field, unless the participant is a room member or a signed-in user, whose own name is used instead. No
participant-external-id Identifier of the local participant in your own application, to correlate it with your users. Up to 64 characters (letters, digits, _ and -). Never interpreted by OpenVidu Meet. No
participant-metadata Opaque application-defined payload attached to the local participant (JSON is recommended). Up to 2048 bytes (UTF-8). Never interpreted by OpenVidu Meet. No
initial-audio-active Join the meeting with the microphone active (true) or not (false). It overrides the room's config.initialAudioActive; if omitted, the room's value applies. The participant can change it afterwards, and a denied mediaPublishAudio permission always wins. No
initial-video-active Join the meeting with the camera active (true) or not (false). It overrides the room's config.initialVideoActive; if omitted, the room's value applies. The participant can change it afterwards, and a denied mediaPublishVideo permission always wins. No
language Language the interface starts in, on the meeting and recording screens alike: en, es, de, fr, zh (Simplified), hi, it, ja, nl or pt (European). A regional variant uses its language (pt-BR is pt). auto uses the browser's preferred languages, and English when none is available. It overrides the participant's previous choice, which they can still change unless show-language-selector is false. An unsupported value is ignored. No
show-language-selector Show the language selectors (true by default). "false" hides them, so the participant cannot change the language. No
e2ee-key Secret key for end-to-end encryption (E2EE). Used only in a room whose config.e2ee.enabled is true, where it fills the join screen's encryption key; ignored otherwise. No
leave-redirect-url URL to redirect to when the participant dismisses the post-meeting, join, error or recording screen, or the end screen of a wait to join a locked room, right after the embeddedCloseRequested event fires. No
show-only-recordings Show only the recordings instead of the live meeting. A bare attribute or any value other than "false" is true. No
show-recording Identifier of the recording to display. When provided along with room-url, the app redirects to the recording view. No

Example:

<openvidu-meet
    room-url="{{ my-room-url }}"
    participant-name="John Doe"
    participant-external-id="user-42"
    initial-video-active="false"
    language="es"
    leave-redirect-url="https://meeting.end.url/"
></openvidu-meet>

Identify your own users

participant-external-id and participant-metadata are never interpreted by OpenVidu Meet: they travel untouched as the externalId and metadata properties of every participant payload, in the participantJoined / participantLeft events and webhooks and in the Meetings REST API, so your backend can correlate a participant with one of its own users.

Commands#

The OpenVidu Meet component exposes a set of commands that allow you to control the room from your application's logic.

Method Description Permission Restriction
meetingLeave()
Disconnects the local participant from the current meeting, or takes them out of the waiting room while they wait to be admitted. None Requires having joined the meeting
meetingEnd()
Ends the current meeting for all participants. meetingEnd Requires having joined the meeting
participantKick(
participantIdentity: string
)
Kicks a participant from the meeting. participantKick Requires having joined the meeting
participantMute(
participantIdentity: string,
media: {
audioActive?: false;
videoActive?: false;
screenShareActive?: false;
}
)
Turns off a participant's microphone, camera or screen share. The participant may turn the device back on. participantMute Requires having joined the meeting
participantMuteAll(
media: {
audioActive?: false;
videoActive?: false;
screenShareActive?: false;
}
)
Turns off the microphone, camera or screen share of every participant except the moderators and the caller. Each participant may turn their devices back on. participantMute Requires having joined the meeting
participantUpdateRole(
participantIdentity: string,
action: 'upgrade' | 'downgrade'
)
Promotes a participant to moderator (upgrade) or returns a promoted one to their original role (downgrade). The participant is told through the participantRoleChanged event. participantPromote Requires having joined the meeting
participantRaiseHand()
Raises the local participant's hand. Every participant is notified through the participantHandChanged event. Rejected while the room's raiseHand.enabled config is false. None Requires having joined the meeting
participantLowerHand(
participantIdentity?: string
)
Lowers the local participant's hand, or another participant's when participantIdentity is given. Only lowering someone else's hand needs the permission. participantLowerHand Requires having joined the meeting
participantLowerAllHands()
Lowers every raised hand in the meeting. participantLowerHand Requires having joined the meeting
waitingParticipantAdmit(
options?: {
participantIdentity: string;
}
)
Admits the waiting participant participantIdentity, if a place is free. waitingParticipantAdmin Requires having joined the meeting
waitingParticipantAdmitAll()
Admits everyone waiting, or nobody when they outnumber the free places. waitingParticipantAdmin Requires having joined the meeting
waitingParticipantReject(
options?: {
participantIdentity: string;
}
)
Rejects the waiting participant participantIdentity, who may ask to join again. waitingParticipantAdmin Requires having joined the meeting
waitingParticipantRejectAll()
Rejects everyone the meeting shows waiting. Those who stopped waiting meanwhile are not an error. waitingParticipantAdmin Requires having joined the meeting
participantSendReaction(
reaction:
| 'thumbs_up'
| 'thumbs_down'
| 'grinning_face'
| 'slightly_frowning_face'
| 'confused_face'
| 'face_with_open_mouth'
| 'clapping_hands'
| 'red_heart'
)
Sends a reaction from the local participant, which every participant sees for a few seconds and is notified of through the participantReactionSent event. participantSendReaction Requires having joined the meeting
mediaToggleAudio(active?: boolean)
Toggles the local participant's microphone, or sets it when active is provided. mediaPublishAudio Requires the prejoin screen or an ongoing meeting
mediaToggleVideo(active?: boolean)
Toggles the local participant's camera, or sets it when active is provided. mediaPublishVideo Requires the prejoin screen or an ongoing meeting
mediaToggleScreenShare(active?: boolean)
Toggles the local participant's screen share, or sets it when active is provided. mediaShareScreen Requires having joined the meeting
recordingStart()
Starts recording the meeting. Its progress is reported by the recordingStarted, recordingUpdated and recordingEnded events. recordingControl Requires having joined the meeting
recordingStop()
Stops the recording in progress. recordingControl Requires having joined the meeting
broadcastStart(
options?: {
destinationIds?: string[];
destinations?: {
name: string;
url: string;
}[];
}
)
Starts a live broadcast of the meeting to each of the given destinations, one broadcast per destination: the room destinations named by destinationIds, or, when it is omitted, each room destination not being streamed to yet, plus the destinations given by name and URL for this meeting only, which also need broadcastEdit. The room must have live broadcast enabled. broadcastControl Requires having joined the meeting
broadcastStop(
options?: {
broadcastId: string;
}
)
Stops the live broadcast of the meeting named by broadcastId. broadcastControl Requires having joined the meeting
broadcastStopAll()
Stops the live broadcasts of the current meeting that are running when it is called. broadcastControl Requires having joined the meeting
endMeeting()
Deprecated Renamed to meetingEnd. Removed in 3.12.0. meetingEnd Requires having joined the meeting
leaveRoom()
Deprecated Renamed to meetingLeave. Removed in 3.12.0. None Requires having joined the meeting
kickParticipant(
participantIdentity: string
)
Deprecated Renamed to participantKick. Removed in 3.12.0. participantKick Requires having joined the meeting

Invoke commands using JavaScript:

const openviduMeet = document.querySelector('openvidu-meet');
openviduMeet.meetingLeave();

Commands that take parameters receive them as arguments, in the order listed in the table:

openviduMeet.participantMute('participant-identity', { audioActive: false });
openviduMeet.mediaToggleVideo(false);

Events#

The OpenVidu Meet component emits events that you can listen to in your application.

Event Description Payload
meetingJoined Event emitted when the local participant joins the meeting.
{
roomId: string;
participantIdentity: string;
}
meetingLeft Event emitted when the local participant leaves the meeting.
{
roomId: string;
participantIdentity: string;
reason:
| 'voluntary_leave'
| 'network_disconnect'
| 'server_shutdown'
| 'participant_kicked'
| 'meeting_ended'
| 'meeting_ended_by_self'
| 'meeting_ended_by_duration_limit'
| 'duplicate_identity'
| 'unknown';
}
participantJoined Event emitted when a remote participant joins the meeting. Only live transitions are notified: participants already in the meeting when the local one joins are not replayed. The local participant's own join is notified through meetingJoined instead.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type?:
| 'user'
| 'identified_guest'
| 'anonymous';
externalId?: string;
metadata?: string;
role: 'moderator' | 'speaker';
joinDate: number;
};
}
participantLeft Event emitted when a remote participant leaves the meeting. The local participant's own departure is notified through meetingLeft instead.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type?:
| 'user'
| 'identified_guest'
| 'anonymous';
externalId?: string;
metadata?: string;
role: 'moderator' | 'speaker';
joinDate: number;
leaveReason:
| 'voluntary_leave'
| 'network_disconnect'
| 'server_shutdown'
| 'participant_kicked'
| 'meeting_ended'
| 'duplicate_identity'
| 'unknown';
};
}
participantRoleChanged Event emitted to the local participant when they are promoted to moderator or returned to their original role, once the permissions of the new role are in effect. A change made while the participant is still joining is reported after meetingJoined. The other participants are not notified.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type?:
| 'user'
| 'identified_guest'
| 'anonymous';
externalId?: string;
metadata?: string;
role: 'moderator' | 'speaker';
joinDate: number;
audioActive: boolean;
videoActive: boolean;
screenShareActive: boolean;
handRaised: boolean;
handRaiseDate?: number;
};
}
waitingParticipantKnocked Event emitted to the participants in the meeting holding waitingParticipantAdmin when a participant asks to join a locked room. Those already waiting on joining, and those waiting again after a failed admission, come only in waitingParticipantListUpdated.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type:
| 'user'
| 'identified_guest'
| 'anonymous';
role: 'moderator' | 'speaker';
externalId?: string;
metadata?: string;
knockDate: number;
};
}
waitingParticipantListUpdated Event emitted to the participants in the meeting holding waitingParticipantAdmin with the whole waiting list of a locked room: on joining, on gaining the permission, and on every change.
{
roomId: string;
participants: {
participantIdentity: string;
participantName: string;
type:
| 'user'
| 'identified_guest'
| 'anonymous';
role: 'moderator' | 'speaker';
externalId?: string;
metadata?: string;
knockDate: number;
}[];
}
waitingParticipantStatusChanged Event emitted when a wait to join a locked room changes status: to the waiting participant for their own wait, and to the participants in the meeting holding waitingParticipantAdmin for every wait of the room.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type:
| 'user'
| 'identified_guest'
| 'anonymous';
role: 'moderator' | 'speaker';
externalId?: string;
metadata?: string;
knockDate: number;
};
status:
| 'waiting'
| 'admitted'
| 'rejected'
| 'left'
| 'expired'
| 'meeting_ended'
| 'room_closed';
origin?:
| 'participant'
| 'moderator'
| 'system';
reason?:
| 'replaced'
| 'page_closed'
| 'connection_lost'
| 'admission_unused'
| 'room_unlocked';
}
participantHandChanged Event emitted to every participant when a participant's hand is raised or lowered, by themselves or by a moderator. A participant joining a meeting with raised hands receives one event per raised hand, in queue order, right after meetingJoined. The queue is ordered by participant.handRaiseDate.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type?:
| 'user'
| 'identified_guest'
| 'anonymous';
externalId?: string;
metadata?: string;
role: 'moderator' | 'speaker';
joinDate: number;
audioActive: boolean;
videoActive: boolean;
screenShareActive: boolean;
handRaised: boolean;
handRaiseDate?: number;
};
origin: 'participant' | 'moderator';
}
participantReactionSent Event emitted to every participant, the sender included, when a participant sends a reaction. Reactions are not replayed: a participant joining later is not notified of the ones sent before.
{
roomId: string;
participant: {
participantIdentity: string;
participantName: string;
type?:
| 'user'
| 'identified_guest'
| 'anonymous';
externalId?: string;
metadata?: string;
role: 'moderator' | 'speaker';
joinDate: number;
audioActive: boolean;
videoActive: boolean;
screenShareActive: boolean;
handRaised: boolean;
handRaiseDate?: number;
};
reaction:
| 'thumbs_up'
| 'thumbs_down'
| 'grinning_face'
| 'slightly_frowning_face'
| 'confused_face'
| 'face_with_open_mouth'
| 'clapping_hands'
| 'red_heart';
}
mediaAudioStatusChanged Event emitted to the local participant when their microphone state changes. Emitted from the prejoin screen onwards, before meetingJoined, and also on the waiting screen.
{
active: boolean;
origin:
| 'participant'
| 'moderator'
| 'system';
}
mediaVideoStatusChanged Event emitted to the local participant when their camera state changes. Emitted from the prejoin screen onwards, before meetingJoined, and also on the waiting screen.
{
active: boolean;
origin:
| 'participant'
| 'moderator'
| 'system';
}
mediaScreenShareStatusChanged Event emitted to the local participant when their screen share starts or stops, once the meeting is joined.
{
active: boolean;
origin:
| 'participant'
| 'moderator'
| 'system';
}
recordingStarted Event emitted to every participant when a recording of the meeting starts, whoever started it. A participant who joins while the meeting is being recorded receives it on joining, right after meetingJoined, so the host can always show that the meeting is being recorded.
{
recordingId: string;
roomId: string;
roomName: string;
status:
| 'starting'
| 'active'
| 'ending'
| 'complete'
| 'failed'
| 'aborted'
| 'limit_reached';
layout?:
| 'grid'
| 'speaker'
| 'single-speaker';
encoding?:
| 'H264_720P_30'
| 'H264_720P_60'
| 'H264_1080P_30'
| 'H264_1080P_60'
| 'PORTRAIT_H264_720P_30'
| 'PORTRAIT_H264_720P_60'
| 'PORTRAIT_H264_1080P_30'
| 'PORTRAIT_H264_1080P_60'
| {
video: {
width: number;
height: number;
framerate: number;
codec:
| 'DEFAULT_VC'
| 'H264_BASELINE'
| 'H264_MAIN'
| 'H264_HIGH'
| 'VP8';
bitrate: number;
keyFrameInterval: number;
depth: number;
};
audio: {
codec:
| 'DEFAULT_AC'
| 'OPUS'
| 'AAC'
| 'AC_MP3';
bitrate: number;
frequency: number;
};
};
filename?: string;
startDate?: number;
endDate?: number;
duration?: number;
size?: number;
errorCode?: number;
error?: string;
details?: string;
}
recordingUpdated Event emitted to every participant when a recording in progress changes, for example when it goes active once media is being recorded, or starts ending.
{
recordingId: string;
roomId: string;
roomName: string;
status:
| 'starting'
| 'active'
| 'ending'
| 'complete'
| 'failed'
| 'aborted'
| 'limit_reached';
layout?:
| 'grid'
| 'speaker'
| 'single-speaker';
encoding?:
| 'H264_720P_30'
| 'H264_720P_60'
| 'H264_1080P_30'
| 'H264_1080P_60'
| 'PORTRAIT_H264_720P_30'
| 'PORTRAIT_H264_720P_60'
| 'PORTRAIT_H264_1080P_30'
| 'PORTRAIT_H264_1080P_60'
| {
video: {
width: number;
height: number;
framerate: number;
codec:
| 'DEFAULT_VC'
| 'H264_BASELINE'
| 'H264_MAIN'
| 'H264_HIGH'
| 'VP8';
bitrate: number;
keyFrameInterval: number;
depth: number;
};
audio: {
codec:
| 'DEFAULT_AC'
| 'OPUS'
| 'AAC'
| 'AC_MP3';
bitrate: number;
frequency: number;
};
};
filename?: string;
startDate?: number;
endDate?: number;
duration?: number;
size?: number;
errorCode?: number;
error?: string;
details?: string;
}
recordingEnded Event emitted to every participant when a recording of the meeting ends, normally or because it failed.
{
recordingId: string;
roomId: string;
roomName: string;
status:
| 'starting'
| 'active'
| 'ending'
| 'complete'
| 'failed'
| 'aborted'
| 'limit_reached';
layout?:
| 'grid'
| 'speaker'
| 'single-speaker';
encoding?:
| 'H264_720P_30'
| 'H264_720P_60'
| 'H264_1080P_30'
| 'H264_1080P_60'
| 'PORTRAIT_H264_720P_30'
| 'PORTRAIT_H264_720P_60'
| 'PORTRAIT_H264_1080P_30'
| 'PORTRAIT_H264_1080P_60'
| {
video: {
width: number;
height: number;
framerate: number;
codec:
| 'DEFAULT_VC'
| 'H264_BASELINE'
| 'H264_MAIN'
| 'H264_HIGH'
| 'VP8';
bitrate: number;
keyFrameInterval: number;
depth: number;
};
audio: {
codec:
| 'DEFAULT_AC'
| 'OPUS'
| 'AAC'
| 'AC_MP3';
bitrate: number;
frequency: number;
};
};
filename?: string;
startDate?: number;
endDate?: number;
duration?: number;
size?: number;
errorCode?: number;
error?: string;
details?: string;
}
broadcastStarted Event emitted to every participant when a live broadcast of the meeting starts, one per destination. A participant who joins while broadcasts are running receives one event per running broadcast on joining, so the host can always show that the meeting is being streamed.
{
broadcastId: string;
roomId: string;
roomName: string;
status:
| 'starting'
| 'active'
| 'ending'
| 'complete'
| 'failed'
| 'aborted'
| 'limit_reached';
destination: {
id?: string;
name: string;
url: string;
};
layout:
| 'grid'
| 'speaker'
| 'single-speaker';
encoding:
| 'H264_720P_30'
| 'H264_720P_60'
| 'H264_1080P_30'
| 'H264_1080P_60'
| 'PORTRAIT_H264_720P_30'
| 'PORTRAIT_H264_720P_60'
| 'PORTRAIT_H264_1080P_30'
| 'PORTRAIT_H264_1080P_60'
| {
video: {
width: number;
height: number;
framerate: number;
codec:
| 'DEFAULT_VC'
| 'H264_BASELINE'
| 'H264_MAIN'
| 'H264_HIGH'
| 'VP8';
bitrate: number;
keyFrameInterval: number;
depth: number;
};
audio: {
codec:
| 'DEFAULT_AC'
| 'OPUS'
| 'AAC'
| 'AC_MP3';
bitrate: number;
frequency: number;
};
};
startDate?: number;
endDate?: number;
duration?: number;
errorCode?: number;
error?: string;
details?: string;
}
broadcastUpdated Event emitted to every participant when a running broadcast changes, for example when it goes active once media reaches its destination, or starts ending.
{
broadcastId: string;
roomId: string;
roomName: string;
status:
| 'starting'
| 'active'
| 'ending'
| 'complete'
| 'failed'
| 'aborted'
| 'limit_reached';
destination: {
id?: string;
name: string;
url: string;
};
layout:
| 'grid'
| 'speaker'
| 'single-speaker';
encoding:
| 'H264_720P_30'
| 'H264_720P_60'
| 'H264_1080P_30'
| 'H264_1080P_60'
| 'PORTRAIT_H264_720P_30'
| 'PORTRAIT_H264_720P_60'
| 'PORTRAIT_H264_1080P_30'
| 'PORTRAIT_H264_1080P_60'
| {
video: {
width: number;
height: number;
framerate: number;
codec:
| 'DEFAULT_VC'
| 'H264_BASELINE'
| 'H264_MAIN'
| 'H264_HIGH'
| 'VP8';
bitrate: number;
keyFrameInterval: number;
depth: number;
};
audio: {
codec:
| 'DEFAULT_AC'
| 'OPUS'
| 'AAC'
| 'AC_MP3';
bitrate: number;
frequency: number;
};
};
startDate?: number;
endDate?: number;
duration?: number;
errorCode?: number;
error?: string;
details?: string;
}
broadcastEnded Event emitted to every participant when a live broadcast of the meeting ends, normally or because it failed.
{
broadcastId: string;
roomId: string;
roomName: string;
status:
| 'starting'
| 'active'
| 'ending'
| 'complete'
| 'failed'
| 'aborted'
| 'limit_reached';
destination: {
id?: string;
name: string;
url: string;
};
layout:
| 'grid'
| 'speaker'
| 'single-speaker';
encoding:
| 'H264_720P_30'
| 'H264_720P_60'
| 'H264_1080P_30'
| 'H264_1080P_60'
| 'PORTRAIT_H264_720P_30'
| 'PORTRAIT_H264_720P_60'
| 'PORTRAIT_H264_1080P_30'
| 'PORTRAIT_H264_1080P_60'
| {
video: {
width: number;
height: number;
framerate: number;
codec:
| 'DEFAULT_VC'
| 'H264_BASELINE'
| 'H264_MAIN'
| 'H264_HIGH'
| 'VP8';
bitrate: number;
keyFrameInterval: number;
depth: number;
};
audio: {
codec:
| 'DEFAULT_AC'
| 'OPUS'
| 'AAC'
| 'AC_MP3';
bitrate: number;
frequency: number;
};
};
startDate?: number;
endDate?: number;
duration?: number;
errorCode?: number;
error?: string;
details?: string;
}
embeddedCloseRequested Event emitted when the participant asks to close OpenVidu Meet by dismissing the post-meeting, join, error or recording screen. The host application responds by removing the embedded element or routing the participant elsewhere; the meeting itself may still be running for the other participants. -
joined Deprecated Renamed to meetingJoined. Removed in 3.12.0.
{
roomId: string;
participantIdentity: string;
}
left Deprecated Renamed to meetingLeft. Removed in 3.12.0.
{
roomId: string;
participantIdentity: string;
reason:
| 'voluntary_leave'
| 'network_disconnect'
| 'server_shutdown'
| 'participant_kicked'
| 'meeting_ended'
| 'meeting_ended_by_self'
| 'meeting_ended_by_duration_limit'
| 'duplicate_identity'
| 'unknown';
}
closed Deprecated Renamed to embeddedCloseRequested. Removed in 3.12.0. -

Listen to events using JavaScript event listeners:

const openviduMeet = document.querySelector('openvidu-meet');

openviduMeet.addEventListener('meetingJoined', (event) => {
    console.log('The local participant has joined the meeting', event.detail);
});

You can also use the API on | once | off:

const openviduMeet = document.querySelector('openvidu-meet');

openviduMeet.on('meetingJoined', (event) => {
    console.log('The local participant has joined the meeting', event);
});

openviduMeet.on('participantJoined', (event) => {
    console.log(`${event.participant.participantName} has joined the meeting`, event);
});

openviduMeet.once('meetingLeft', (event) => {
    console.log('The local participant has left the meeting', event.reason);
});

Accessing the event payload

The way you access the event payload depends on the method you use to listen:

  • With the native addEventListener method, the callback receives a standard CustomEvent , so the payload is available in its detail property (e.g. event.detail).
  • With the on | once | off API, the callback receives the payload directly as its argument (e.g. event), without needing to access any detail property.

When the participant asks to close OpenVidu Meet, the component emits embeddedCloseRequested: that is the moment to remove it or show one of your own screens. Leaving the meeting does not emit it: meetingLeft fires and OpenVidu Meet shows its End view, and embeddedCloseRequested follows when the participant closes that view. The meeting may still be running for everyone else.

const openviduMeet = document.querySelector('openvidu-meet');

openviduMeet.once('embeddedCloseRequested', () => {
    openviduMeet.remove();
});