-
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 roomCallEventListener
String 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.Context
class, 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 thetoken
field, which represents the authentication token provided in the request.
String token = roomRequest.getToken();
Getter for the context
field.
none
-
Context
- The value of thecontext
field, which represents the Android context provided in the request.
Context context = roomRequest.getContext();
Getter for the roomName
field.
none
-
String
- The value of theroomName
field, 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 theroomCallEventListener
field, which represents interface to be implemented, provided in the request.
RoomCallEventListener roomCallEventListener = roomRequest.getRoomCallEventListener();