Skip to main content

Instance Events

The Twyng provides several events that you can listen to in order to handle various aspects of conference management and interaction.

Available Events:

  1. ON_CONFERENCE_INFO: Provides updated information about the conference, including stream and participant details.

  2. ON_SERVER_DISCONNECTED: Triggered when the WebSocket connection to the server is lost.

  3. ON_USER_LEFT: Indicates when a participant has left the conference.

  4. ON_NEW_PUBLISHER: Fired when a new publishing session starts.

ON_CONFERENCE_INFO


twyng.on(Twyng.ON_CONFERENCE_INFO, (conferenceInfo) => {
console.log('Conference information updated:', conferenceInfo);
});

ON_SERVER_DISCONNECTED


twyng.on(Twyng.ON_SERVER_DISCONNECTED, (info) => {
console.log('ON_SERVER_DISCONNECTED:', info);
});

ON_USER_LEFT


twyng.on(Twyng.ON_USER_LEFT, (info) => {
console.log('ON_USER_LEFT:', info);
});

ON_NEW_PUBLISHER


twyng.on(Twyng.ON_NEW_PUBLISHER, (info) => {
console.log('ON_NEW_PUBLISHER:', info);
});