-
Notifications
You must be signed in to change notification settings - Fork 2
RoomRequest
Lejla Solak edited this page Feb 10, 2025
·
4 revisions
RoomRequest(String token, Context context, String roomName, RoomCallEventListener roomCallEventListenerString getToken()Context getContext()String getRoomName()RoomCallEventListener getRoomCallEventListener()
Creates an instance of RoomRequest required for making a room call
via joinRoom method.
-
token:String- Authentication token generated by client's app via Infobip's HTTP /webrtc/1/token endpoint. -
context:Context- An instance of theandroid.content.Contextclass, which provides access to system services, resources, and application-specific data in an Android application. -
roomName:String- Name of the room which user wants to join. -
roomCallEventListener:RoomCallEventListener- Event listener used for receiving room events.
-
RoomRequest- Instance of theRoomRequest.
RoomRequest roomRequest = new RoomRequest(
obtainToken(),
getApplicationContext(),
new DefaultRoomCallEventListener() {
@Override
public void onRoomJoined(RoomJoinedEvent roomJoinedEvent) {
Toast.makeText(getApplicationContext(), "Room joined!", Toast.LENGTH_LONG);
}
@Override
public void onParticipantJoined(ParticipantJoinedEvent participantJoinedEvent) {
Toast.makeText(getApplicationContext(), "Participant joined!", Toast.LENGTH_LONG);
}
@Override
public void onParticipantLeft(ParticipantLeftEvent participantLeftEvent) {
Toast.makeText(getApplicationContext(), "Participant left!", Toast.LENGTH_LONG);
}
@Override
public void onRoomLeft(RoomLeftEvent roomLeftEvent) {
Toast.makeText(getApplicationContext(), "Room left!", Toast.LENGTH_LONG);
}
},
"room-test"
);Getter for the token field.
none
-
String- The value of thetokenfield, which represents the authentication token provided in the request.
String token = roomRequest.getToken();Getter for the context field.
none
-
Context- The value of thecontextfield, which represents the Android context provided in the request.
Context context = roomRequest.getContext();Getter for the roomName field.
none
-
String- The value of theroomNamefield, which represents the name of the room provided in the request.
String roomName = roomRequest.getRoomName();Getter for the roomCallEventListener field.
none
-
RoomCallEventListener- The value of theroomCallEventListenerfield, which represents interface to be implemented, provided in the request.
RoomCallEventListener roomCallEventListener = roomRequest.getRoomCallEventListener();