use of com.fanap.podcall.model.CallPartner in project pod-chat-android-sdk by FanapSoft.
the class Chat method addScreenSharer.
private void addScreenSharer(ChatResponse<ScreenShareResult> response) {
if (hasRemotePartnerView()) {
visibleView(assignScreenShareView());
CallPartner rPartner = new CallPartner.Builder().setPartnerType(PartnerType.REMOTE).setName("Screen Sharer:" + response.getResult().getScreenOwner().getUserId()).setId(CallPartnerViewPool.SCREEN_SHARE_ID).setVideoTopic(response.getResult().getScreenShare()).setVideoView(getShareScreenView()).build();
rPartner.setHasVideo(Util.isNotNullOrEmpty(response.getResult().getScreenShare()));
rPartner.setVideoOn(true);
podVideoCall.addPartner(rPartner);
listenerManager.callOnCallParticipantSharedScreen(response);
}
}
use of com.fanap.podcall.model.CallPartner 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.podcall.model.CallPartner in project pod-chat-android-sdk by FanapSoft.
the class Chat method prepareRemotePartnersByClientDTOList.
private void prepareRemotePartnersByClientDTOList(ChatResponse<StartedCallModel> info) {
boolean hasScreenSharer = CallAsyncRequestsManager.checkIsAnyScreenSharing(info);
boolean isCallRecording = CallAsyncRequestsManager.checkIsCallIsRecording(info);
for (ClientDTO client : info.getResult().getOtherClientDtoList()) {
if (client.getUserId() == 0)
continue;
if (!client.getUserId().equals(CoreConfig.userId)) {
CallPartner.Builder rPartnerBuilder = new CallPartner.Builder();
rPartnerBuilder.setId(client.getUserId());
rPartnerBuilder.setPartnerType(PartnerType.REMOTE).setName("" + client.getUserId());
rPartnerBuilder.setVideoTopic(client.getTopicSendVideo());
rPartnerBuilder.setHasVideo(Util.isNotNullOrEmpty(client.getTopicSendVideo()));
rPartnerBuilder.setVideoOn(client.getVideo());
if (client.getVideo() && hasRemotePartnerView()) {
CallPartnerView view = assignCallPartnerView(client.getUserId());
if (view != null) {
visibleView(view);
rPartnerBuilder.setVideoView(view);
} else {
rPartnerBuilder.setVideoOn(false);
}
}
rPartnerBuilder.setAudioTopic(client.getTopicSendAudio());
rPartnerBuilder.setHasAudio(Util.isNotNullOrEmpty(client.getTopicSendAudio()));
rPartnerBuilder.setAudioOn(!client.getMute());
CallPartner rPartner = rPartnerBuilder.build();
podVideoCall.addPartner(rPartner);
}
}
if (hasScreenSharer) {
ChatResponse<ScreenShareResult> sc = CallAsyncRequestsManager.handleOnScreenIsSharing(info);
addScreenSharer(sc);
}
if (isCallRecording) {
ChatResponse<Participant> response = CallAsyncRequestsManager.handleCallIsRecordingCallResponse(info);
if (CoreConfig.userId.equals(response.getResult().getId())) {
removeCallback(info.getUniqueId());
listenerManager.callOnCallRecordStarted(response);
} else {
listenerManager.callOnCallParticipantStartRecording(response);
}
}
}
Aggregations