use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class Chat method handleOnNewCallParticipantJoined.
@Override
void handleOnNewCallParticipantJoined(ChatMessage chatMessage) {
if (deviceIsInCall) {
if (sentryResponseLog) {
showLog("RECEIVE_PARTICIPANT_JOINED", gson.toJson(chatMessage));
} else {
showLog("RECEIVE_PARTICIPANT_JOINED");
}
ChatResponse<JoinCallParticipantResult> response = CallAsyncRequestsManager.handleOnParticipantJoined(chatMessage);
if (podVideoCall != null) {
for (CallParticipantVO callParticipant : response.getResult().getJoinedParticipants()) {
if (callParticipant.getUserId() == 0)
continue;
if (!callParticipant.getUserId().equals(CoreConfig.userId)) {
CallPartner.Builder rPartnerBuilder = new CallPartner.Builder();
rPartnerBuilder.setId(callParticipant.getUserId());
rPartnerBuilder.setPartnerType(PartnerType.REMOTE).setName("" + callParticipant.getUserId());
rPartnerBuilder.setVideoTopic(callParticipant.getSendTopicVideo());
rPartnerBuilder.setHasVideo(Util.isNotNullOrEmpty(callParticipant.getSendTopicVideo()));
rPartnerBuilder.setVideoOn(callParticipant.hasVideo());
if (callParticipant.hasVideo() && hasRemotePartnerView()) {
CallPartnerView view = assignCallPartnerView(callParticipant.getUserId());
if (view != null) {
visibleView(view);
view.setPartnerName(callParticipant.getParticipantVO() != null ? callParticipant.getParticipantVO().getName() : "");
rPartnerBuilder.setVideoView(view);
} else {
rPartnerBuilder.setVideoOn(false);
}
}
rPartnerBuilder.setAudioTopic(callParticipant.getSendTopicAudio());
rPartnerBuilder.setHasAudio(Util.isNotNullOrEmpty(callParticipant.getSendTopicAudio()));
rPartnerBuilder.setAudioOn(!callParticipant.isMute());
CallPartner rPartner = rPartnerBuilder.build();
podVideoCall.addPartner(rPartner);
}
}
}
listenerManager.callOnCallParticipantJoined(response);
}
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnParticipantLeft.
public static ChatResponse<LeaveCallResult> handleOnParticipantLeft(ChatMessage chatMessage) {
ChatResponse<LeaveCallResult> response = new ChatResponse<>();
ArrayList<CallParticipantVO> participantsLeft = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<CallParticipantVO>>() {
}.getType());
LeaveCallResult result = new LeaveCallResult();
result.setCallId(chatMessage.getSubjectId());
result.setCallParticipants(participantsLeft);
response.setResult(result);
response.setSubjectId(chatMessage.getSubjectId());
response.setUniqueId(chatMessage.getUniqueId());
return response;
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method fillResult.
public static ChatResponse<CallStartResult> fillResult(ChatResponse<StartedCallModel> callResponse) {
ChatResponse<CallStartResult> response = new ChatResponse<>();
ArrayList<CallParticipantVO> callPartners = new ArrayList<>();
if (Util.isNotNullOrEmpty(callResponse.getResult().getOtherClientDtoList())) {
for (ClientDTO client : callResponse.getResult().getOtherClientDtoList()) {
if (!client.getUserId().equals(CoreConfig.userId)) {
CallParticipantVO partner = new CallParticipantVO();
partner.setUserId(client.getUserId());
partner.setMute(client.getMute());
partner.setVideo(client.getVideo());
callPartners.add(partner);
}
}
}
CallStartResult result = new CallStartResult(callResponse.getResult().getCallName(), callResponse.getResult().getCallImage(), callPartners);
response.setResult(result);
response.setSubjectId(callResponse.getSubjectId());
response.setUniqueId(callResponse.getUniqueId());
return response;
}
Aggregations