Process join responses and events
Understand what events your game should to listen to during the joining process.
Read time 1 minuteLast updated 20 hours ago
When joining a channel there are two types of events your game should be configured to listen to. The first set of events will give you the status of the audio and text channels. The second set of events will provide information for UI events to manage a roster of “in-channel” users.
Audio and text event responses
Audio events:Text events:void HandleMediaStreamUpdatedEvent(vx_evt_media_stream_updated *evt){ if (evt->state == session_media_connected) { printf("Audio Connected to %s\n", evt->session_handle);
Use media to respond to audio events and use text to respond to text channel events. Craft responses to both if both text and audio are being used.void HandleTextStreamUpdatedEvent(vx_evt_text_stream_updated *evt){ if (evt->state == session_text_connected) { printf("Text Connected to %s\n", evt->session_handle);
Participant updated events
Participant updated events allow you to manage a list of in-channel users for use in your game UI or elsewhere in your application.When tracking participant state, it is important to use thevoid HandleParticipantAddedEvent(vx_evt_participant_added *evt){ //use this to update your roster/game that a player has joined a channel}void HandleParticipantRemovedEvent(vx_evt_participant_removed *evt){ //use this to update your roster/game that player has left a channel}void HandleParticipantUpdatedEvent(vx_evt_participant_updated *evt){ //this indicates when a player is speaking, not speaking, and other key player events}
encoded_uri_with_tag
Next step, check for errors and verify your implementation.