use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantLeft.
@Override
public void onCallParticipantLeft(ChatResponse<LeaveCallResult> response) {
for (CallParticipantVO c : response.getResult().getCallParticipants()) {
view.showMessage(c.getParticipantVO().getName() + " تماس رو ترک کرد");
}
activity.runOnUiThread(() -> {
try {
if (cpvManager != null) {
cpvManager.releasePartnerView(response.getResult().getCallParticipants().get(0).getUserId());
} else {
CallPartnerView pw = findParticipantView(response.getResult().getCallParticipants().get(0).getUserId());
if (pw != null) {
pw.setId(0);
pw.setPartnerName("");
pw.setDisplayName(false);
pw.setDisplayIsMuteIcon(false);
pw.setDisplayCameraIsOffIcon(false);
pw.reset();
chat.addPartnerView(pw, 0);
}
}
} catch (Exception e) {
view.onError(e.getMessage());
}
});
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantStartedVideo.
@Override
public void onCallParticipantStartedVideo(ChatResponse<JoinCallParticipantResult> response) {
try {
if (cpvManager != null) {
CallParticipantVO callParticipant = response.getResult().getJoinedParticipants().get(0);
new MainThreadExecutor().execute(() -> {
try {
Objects.requireNonNull(cpvManager.getPartnerAssignedView(callParticipant.getUserId())).setVisibility(View.VISIBLE);
cpvManager.showPartnerName(callParticipant.getUserId(), callParticipant.getParticipantVO().getName());
} catch (Exception e) {
e.printStackTrace();
}
});
}
view.showMessage(response.getResult().getJoinedParticipants().get(0).getParticipantVO().getName() + " الان تصویر داره!");
} catch (Exception e) {
view.onError(e.getMessage());
}
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnScreenIsSharing.
public static ChatResponse<ScreenShareResult> handleOnScreenIsSharing(ChatResponse<StartedCallModel> info) {
ChatResponse<ScreenShareResult> response = null;
try {
response = new ChatResponse<>();
response.setUniqueId(info.getUniqueId());
response.setSubjectId(info.getSubjectId());
ScreenShareResult scr = new ScreenShareResult();
scr.setScreenshare(info.getResult().getChatDataDTO().getScreenShare());
CallParticipantVO callParticipantVO = new CallParticipantVO();
callParticipantVO.setUserId(Long.valueOf(info.getResult().getChatDataDTO().getScreenShareUser()));
scr.setScreenOwner(callParticipantVO);
response.setResult(scr);
} catch (Exception e) {
Log.wtf(TAG, e);
}
return response;
}
use of com.fanap.podchat.call.model.CallParticipantVO 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.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnCallDelivered.
public static ChatResponse<CallDeliverResult> handleOnCallDelivered(ChatMessage chatMessage) {
CallParticipantVO participant = App.getGson().fromJson(chatMessage.getContent(), CallParticipantVO.class);
CallDeliverResult result = new CallDeliverResult(participant);
ChatResponse<CallDeliverResult> response = new ChatResponse<>();
response.setResult(result);
response.setSubjectId(chatMessage.getSubjectId());
response.setUniqueId(chatMessage.getUniqueId());
return response;
}
Aggregations