C++ SDK Events
onParticipantJoined()
The onParticipantJoined event listener is triggered when a remote participant joins the meeting. It receives the participant's ID and display name.
Parameters
- callback
- type:
std::function<void(const std::string& id, const std::string& name)> REQUIRED
- type:
Example
meeting.onParticipantJoined([](const std::string& id, const std::string& name) {
std::cout << "Participant joined: " << name << " (" << id << ")" << std::endl;
});
onParticipantLeft()
The onParticipantLeft event listener is triggered when a remote participant leaves the meeting.
Parameters
- callback
- type:
std::function<void(const std::string& id)> REQUIRED
- type:
Example
meeting.onParticipantLeft([](const std::string& id) {
std::cout << "Participant left: " << id << std::endl;
});
onError()
The onError event listener is triggered when an unrecoverable error occurs during the meeting session.
Parameters
- callback
- type:
std::function<void(videosdk::ErrorCode code, const std::string& message)> REQUIRED
- type:
Example
meeting.onError([](videosdk::ErrorCode code, const std::string& message) {
std::cerr << "Error: " << message << std::endl;
});
Got a Question? Ask us on discord

