use of com.fanap.podchat.call.result_model.JoinCallParticipantResult in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnParticipantJoined.
public static ChatResponse<JoinCallParticipantResult> handleOnParticipantJoined(ChatMessage chatMessage) {
ChatResponse<JoinCallParticipantResult> response = null;
try {
response = new ChatResponse<>();
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
ArrayList<CallParticipantVO> callParticipantVOS = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<CallParticipantVO>>() {
}.getType());
JoinCallParticipantResult result = new JoinCallParticipantResult();
result.setCallId(chatMessage.getSubjectId());
result.setJoinedParticipants(callParticipantVOS);
response.setResult(result);
} catch (Exception e) {
Log.wtf(TAG, e);
}
return response;
}
use of com.fanap.podchat.call.result_model.JoinCallParticipantResult 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);
}
}
Aggregations