Platform

Platform

  • Getting Started
  • API

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 delegates.

Stream Related

Stream related callbacks are provided by IrisRtcStream class.

onLocalStream

This callback gets invoked when the local preview is available.

Stream.onLocalStream = (stream) => {
  // Stream is received
}
Parameters
streamMedia stream

onStreamError

This callback gets invoked when there is an error during stream creation process.

Stream.onStreamError = (errorCode, errorMessage) => {
  // Throws error if failed to create stream
}
Parameters
errorCodeError Code
errorMessageError 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.

irisRtcSession.onSessionCreated = (roomId) => {
  // Session is created
}
Parameters
roomIdRoom id received from 555 backend

onSessionJoined

This callback gets invoked when the receiver joins the room successfully.

irisRtcSession.onSessionJoined = (roomId, myJid) => {
  // User joined the session
}
Parameters
roomIdRoom id received from 555 backend
myJidJid of the user

onSessionParticipantJoined

This callback gets invoked at the sender side when the remote participant joins the room.

irisRtcSession.onSessionParticipantJoined = (roomId, participantJid) => {
  // Remote participant joined the session
Parameters
roomIdRoom id received from 555 backend
participantJidParticipant Jid

onSessionConnected

This callback gets invoked when the session is connected.

irisRtcSession.onSessionConnected = (roomId) => {
  // User joined the session
}
Parameters
roomIdRoom id received from 555 backend

onSessionEnd

This callback gets invoked when the session ends.

irisRtcSession.onSessionEnd = (roomId) => {

};
Parameters
roomIdRoom id received from 555 backend

onSessionParticipantLeft

This callback gets invoked when the participant leaves the room.

irisRtcSession.onSessionParticipantLeft = (roomId, participantJid, closeSession) => {
  //
}
Parameters
roomIdRoom id received from 555 backend
participantIdParticipant Id
closeSessionis true when all participants have left the room

onSessionParticipantProfile

This callback gets invoked when the participant profile is changed.

irisRtcSession.onUserProfileChange = (roomId, participantJid, profileJson) => {
  //
}
Parameters
roomIdRoom id received from Iris backend
participantJidParticipant Jid
profileJsonuser profile json object containing participant's name and role

onSessionDominantSpeakerChanged

This callback gets invoked when dominant speaker is changed in multiple stream.

irisRtcSession.onDominantSpeakerChanged = (roomId, dominantSpeakerId) => {
  //
}
Parameters
roomIdRoom id received from 555 backend
dominantSpeakerIdParticipant Jid
traceIdTrace id

onSessionParticipantNotResponding

This callback gets invoked when remote participant is not responding.

irisRtcSession.onSessionParticipantNotResponding = (roomId, participantJid) => {
  //
}
Parameters
roomIdRoom id received from 555 backend
participantJidParticipant Jid
traceIdTrace id

onSessionTypeChanged

This callback gets invoked when there is change in session type.

irisRtcSession.onSessionTypeChange = (roomId, participantJid, sessionType) => {
  //
}
Parameters
roomIdRoom id received from 555 backend
participantJidParticipant Jid
sessionTypeSession type

onSessionParticipantAudioMuted

This callback gets invoked when audio of remote participant muted or unmuted.

irisRtcSession.onSessionParticipantAudioMuted = (roomId, participantJid, audioMute) => {

};
Parameters
roomIdRoom id received from 555 backend
participantJidParticipant Jid
audioMuteAudio state, mute or unmute

onSessionParticipantVideoMuted

This callback gets invoked when video of remote participant muted or unmuted.

irisRtcSession.onSessionParticipantVideoMuted = (roomId, jid, videoMute) => {

};
Parameters
muteVideo state, mute or unmute
participantIdParticipant Id
roomIdRoom id received from Iris backend
traceIdTrace id

onSessionError

This callback gets invoked when there is error while the session is active.

irisRtcSession.onSessionError = (roomId, errorCode, errorMessage) => {
  //
}
Parameters
roomIdRoom id received from Iris backend
errorCodeError Code
errorMessageAdditional error description
  • Stream Related
    • onLocalStream
    • onStreamError
  • Session Related
    • onSessionCreated
    • onSessionJoined
    • onSessionParticipantJoined
    • onSessionConnected
    • onSessionEnd
    • onSessionParticipantLeft
    • onSessionParticipantProfile
    • onSessionDominantSpeakerChanged
    • onSessionParticipantNotResponding
    • onSessionTypeChanged
    • onSessionParticipantAudioMuted
    • onSessionParticipantVideoMuted
    • onSessionError
Docs
Getting StartedGuidesAPI Reference
More
BlogGitHub
555 Platform
Copyright © 2024 555 Platform ™
555docs-v0.0.94