Callbacks
Responses to any API call from the app is handled by callbacks. For example, on successful creation of audio session, onSessionCreated callback gets invoked or, if there is any error, onSessionError API gets invoked.
Following are the callbacks SDK provides. Session callbacks are common for all session types (audio, video, chat) and each session type has its own specific callbacks. The app can receive these callbacks by implementing appropriate interfaces.
Stream Related
onLocalStream
This callback is called when the local preview is available to the app.
void onLocalStream(IrisRtcMediaTrack mediaTrack);
Parameters | |
---|---|
mediaTrack | Media track that is associated with camera instance. |
onStreamError
This callback is called when there in an error during camera capture processs.
void onStreamError(WebRTCError.ErrorCode errorCode, JSONObject additionalData);
Parameters | |
---|---|
errorCode | The basic error code details |
additionalData | Additional error details including description. |
Session Related
Session related callbacks are common for video, audio and chat sessions. By implementing corresponding delegates for each sessions user can access these callbacks.
onSessionCreated
This callback gets invoked when the room is created successfully.
void onSessionCreated(String roomId, String traceId);
Parameters | |
---|---|
roomId | Room id received from backend |
traceId | Trace id |
onSessionJoined
This callback gets invoked when the receiver joins the room successfully.
void onSessionJoined(String roomId, String traceId);
Parameters | |
---|---|
roomId | Room id received from backend |
traceId | Trace id |
onSessionParticipantJoined
This callback gets invoked at the sender side when the remote participant joins the room.
void onSessionParticipantJoined(String participantId, String roomId, String traceId);
Parameters | |
---|---|
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionConnected
This callback gets invoked when the session is connected.
void onSessionConnected(String roomId,String traceId);
Parameters | |
---|---|
roomId | Room id received from backend |
traceId | Trace id |
onSessionEnded
This callback gets invoked when the session ends.
void onSessionEnded(String roomId, String traceId);
Parameters | |
---|---|
roomId | Room id received from backend |
traceId | Trace id |
onSessionParticipantLeft
This callback gets invoked when the participant leaves the room.
void onSessionParticipantLeft(String participantId, String roomId, String traceId);
Parameters | |
---|---|
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionParticipantProfile
This callback gets invoked when the participant profile is changed.
void onSessionParticipantProfile(IrisRtcUserProfile userProfile, String participantId, String roomId, String traceId);
Parameters | |
---|---|
userProfile | IriRtcUserProfile object containing participant's name and image url |
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionDominantSpeakerChanged
This callback gets invoked when dominant speaker is changed in multiple stream.
void onSessionDominantSpeakerChanged(String participantId, String roomId, String traceId);
Parameters | |
---|---|
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionRemoteParticipantActivated
This callback gets invoked when stream of particular particiapnt is activated/viewed in multiple stream.
@optional
void onSessionRemoteParticipantActivated(String participantId, String roomId, String traceId);
Parameters | |
---|---|
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionParticipantNotResponding
This callback gets invoked when remote participant is not responding.
void onSessionParticipantNotResponding(String participantId, String roomId, String traceId);
Parameters | |
---|---|
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionTypeChanged
This callback gets invoked when there is change in session type.
void onSessionTypeChanged(String sessionType, String participantId,String roomId, String traceId);
Parameters | |
---|---|
sessionType | Session type |
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionParticipantAudioMuted
This callback gets invoked when audio of remote participant muted or unmuted.
void onSessionParticipantAudioMuted(boolean mute, String participantId, String roomId, String traceId);
Parameters | |
---|---|
mute | Audio state, mute or unmute |
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionParticipantVideoMuted
This callback gets invoked when video of remote participant muted or unmuted.
void onSessionParticipantVideoMuted(boolean mute, String participantId, String roomId, String traceId);
Parameters | |
---|---|
mute | Video state, mute or unmute |
participantId | Participant Id |
roomId | Room id received from backend |
traceId | Trace id |
onSessionError
This callback gets invoked when there is error while the session is active.
void onSessionError(WebRTCError.ErrorCode error, JSONObject additionalInfo, String roomId, String traceId);
Parameters | |
---|---|
error | The basic error code details |
additionalInfo | Additional error details including description |
roomId | Room id received from backend |
traceId | Trace id |
onLogAnalytics
This callback gets invoked when there is any message is to be convey to the app.
void onLogAnalytics(String log, String roomId, String traceId);
Parameters | |
---|---|
log | Log message to the app |
roomId | Room id received from backend |
traceId | Trace id |