Events API
You can listen for SDK events using the on
and off
methods:
Registering an Event Listener
window.MeetingDoctors.on("meeting_doctors_initialize", (data) => {
// Handle SDK initialization event
});
window.MeetingDoctors.on("meeting_doctors_ready", (data) => {
// The SDK is fully loaded and ready
});
window.MeetingDoctors.on("meeting_doctors_logout", (data) => {
// User has been logged out
});
window.MeetingDoctors.on("meeting_doctors_cancel_video_call", (data) => {
// Video call was cancelled
});
window.MeetingDoctors.on("meeting_doctors_error", (data) => {
// An error occurred in the SDK
// The `data` argument contains error details
});
Removing an Event Listener
To stop listening to an event:
window.MeetingDoctors.off("meeting_doctors_ready");
Available Events
Event | Description |
---|---|
meeting_doctors_ready | SDK is ready to use |
meeting_doctors_logout | User has been logged out |
meeting_doctors_cancel_video_call | Video call has been cancelled |
meeting_doctors_error | An error occurred in the SDK |