Platform

Platform

  • Getting Started
  • API

›WebRTC JS SDK

Getting Started

  • Create Your App

Quick Starts

  • 555 Samples

Mobile SDK (v1.0)

  • Overview
  • IOS SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to initiate or accept video call
    • How to set log level for SDK
    • Release Notes

    Android SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to initiate or accept video call
    • How to set log level for SDK
    • Release Notes

Mobile SDK (v2.0)

  • Overview
  • IOS SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to initiate or accept VIDEO call
    • How to initiate or join ANONYMOUS VIDEO call
    • Release Notes
    • Reference code - How to initiate or accept PSTN Call
    • Reference code - How to initiate or accept Video Call
    • Reference code - How to initiate or join Anonymous Video Call

    Android SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to intiate or accept Video Call
    • How to intiate or accept ANONYMOUS VIDEO Call
    • Release Notes
    • Reference code - How to initiate or accept PSTN Call
    • Reference code - How to initiate or accept Video Call
    • Reference code - How to initiate or join Anonymous Video Call

    React Native SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • Release Notes

WebRTC JS SDK

  • Overview
  • Getting Started
  • How to do user authentication
  • How to subscribe for notifications
  • How to initialize SDK
  • How to initiate or accept PSTN call
  • How to initiate or accept video call
  • How to create a screen share session
  • Release Notes

Screen Share Session

555 JS SDK supports screen share between its users. Make sure that the app is connected to RTC server before initiating a call. If RTC connection got disconnected due to inactivity, the user should again request for connection to make a successful call.

Screen share is initially started with no streams shared. Once session is created user can share his screen. Session related API requests have their respective callbacks to notify the user about the status of the request. List of callbacks specific to video session, in addition to the generic callbacks for any session type (audio, video or chat).


Initiate an Screen Share Session

Once the RTC connection is made, dial a valid user id to make an outgoing call. A 555 session is then created with the necessary config using IrisRtcSession class.

createSession API is invoked to create a video session, which involves creating and starting a screen share session using the room id for the room which has been already allocated for the involved participants. This API takes three params, userConfig a json object with attributes explained below, IrisRtcConnection object from rtc connetion and IrisRtcStream object from local stream

var irisRtcSession = new IrisRtcSession();

var userConfig = {
    type : "video",
    domain : "<app domain>",
    sessionType : "create",
    useBridge : true,
    useAnonymousLogin : true,
    stream:"nostream"
    irisToken : "<JWT Token>",
    routingId: "<Routing Id of the caller"
}

irisRtcSession.createSession(userConfig, irisRtcConn, irisRtcStream);

Parameters passed to createSession API are :

Parameters
userConfigJSON object for setting session configuration parameters
irisRtcConnIrisRtcConnection object after rtc is connetion is successfully established
irisRtcStreamIrisRtcStream object after local stream is successfully created

userConfig JSON contains below parameters :

Parameters
typeCall type must be video
irisToken555 JWT token
routingIdRouting id of the caller
useAnonymousLogintrue for anonymous Calls
useBridgetrue for PSTN Call
streamnostream for scree share session
traceIdUnique time based UUID to identify call uniquely
sessionTypeSession type 'create'
publicIdPublic id of the caller

Screen Share API

IrisRtcSession provides an API for sharing screen irisRtcSession.screenShare to be called with below stream config.

var irisRtcSession = new IrisRtcSession();
  var streamConfig = {
  
  constraints: {
        audio: false,
        video: {
            mandatory: {
                chromeMediaSource: "desktop",
                chromeMediaSourceId: streamId,
                maxWidth: window.screen.width,
                maxHeight: window.screen.height,
                minFrameRate: 15,
                maxFrameRate: 15,
            },
            optional: []
        }
    },
    screenShare: true,
    useGetDisplayMedia: false
   }

irisRtcSession.screenShare(roomId, irisRtcStream, streamConfig);


Moderator Controls

Admin/Moderator who owns the room has special privileges like he can lock or unlock room, he can grant or revoke moderator privileges to other participants in the session. Here are the list of APIs available for these functionality. At present admin can only grant screen share as one of the moderator privilege.

Grant moderator privilege to participants

Admin can grant moderator privilege to other participant with below API. admin object is generated for only admin/moderators

irisRtcSession.admin.grantModeratorPrivilege(roomId, remoteParticipantJid, { screenShare: true });

Revoke moderator privilege to participants

Admin can revoke moderator privilege to other participant with below API. admin object is generated for only admin/moderators

irisRtcSession.admin.revokeModeratorPrivilege(roomId, remoteParticipantJid, { screenShare: false });

Grant moderator privilege to all participants in the session

Admin can grant moderator privilege to all the participants in the room with below API. admin object is generated for only admin/moderators

irisRtcSession.admin.grantAllModeratorPrivilege(roomId, { screenShare: true });

Revoke moderator privilege from all participants in the session

Admin can revoke moderator privilege from all the participants in the room with below API. admin object is generated for only admin/moderators

irisRtcSession.admin.revokeAllModeratorPrivilege(roomId, { screenShare: false });

Lock room

Admin can a lock a room once required participants are joined. Once room is locked no other participant will be allowed to join the room, If anyone tries to join he will be errored out. Admin can decide on whether a disconnected participant is allowed to rejoin or not with the flag rejoin set while locking the room. If rejoin is true and a participant got disconnected or left the session he can join back. If rejoin is false he won't be able to join back.

irisRtcSession.admin.lockRoom(roomId, rejoin);

Unlock room

Admin can unlock the room at any point of time in session, once unlocked whoever has invite can join the room.

irisRtcSession.admin.unlockRoom(roomId);

End an Active Call

On end call, all data and objects associated with that particular call must be cleared for efficiency and to avoid memory leak . While closing a video call session following things must be kept in mind.

  • Close 555 Rtc session
    By invoking endSession() API in IrisRtcSession, 555 session will get closed by releasing all objects associated with it.
  • Close stream
    The close operation of stream class is synchronous and can take time while closing the stream. Closing the stream during a session can cause an error in video or audio sessions. Hence it is advisable to use stopMediaStream() API once the session is closed.
var irisRtcSession = new IrisRtcSession();
irisRtcSession.endSession(roomId);

Call Related Callbacks

onRemoteStream

This callback gets invoked when the remote stream is added to peerconnection (the mechanism in WebRTC that provides all the communication capabilities of WebRTC).

var irisRtcSession = new IrisRtcSession();
irisRtcSession.onRemoteStream = (roomId, remoteStream) => {
    // Remote stream is received from participant
};
Parameters
roomIdRoom id received from Iris backend
remoteStreamMedia stream of the participant

onRemoveRemoteStream

This callback gets invoked when the remote stream is removed from the peerconnection.

var irisRtcSession = new IrisRtcSession();
irisRtcSession.onRemoteStreamRemove = (roomId, participantId) => {
    // Other participant has removed his media stream from session
};
Parameters
participantIdRouting id of the participant
roomIdRoom id received from Iris backend

onSessionStreamReceiveComplete

This callback gets invoked after the onRemoteStream callback and this signifies that remote stream is received and a response to other participant is already sent.

var irisRtcSession = new IrisRtcSession();
irisRtcSession.onSessionStreamReceiveComplete = (roomId, participantId) => {
    // Stream is received and response is sent
};
Parameters
participantIdRouting id of the participant
roomIdRoom id received from Iris backend
← How to initiate or accept video callRelease Notes →
  • Initiate an Screen Share Session
  • Screen Share API
  • Moderator Controls
    • Grant moderator privilege to participants
    • Revoke moderator privilege to participants
    • Grant moderator privilege to all participants in the session
    • Revoke moderator privilege from all participants in the session
    • Lock room
    • Unlock room
  • End an Active Call
  • Call Related Callbacks
    • onRemoteStream
    • onRemoveRemoteStream
    • onSessionStreamReceiveComplete
Docs
Getting StartedGuidesAPI Reference
More
BlogGitHub
555 Platform
Copyright © 2024 555 Platform ™
555docs-v0.0.94