use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantJoined.
@Override
public void onCallParticipantJoined(ChatResponse<JoinCallParticipantResult> response) {
for (CallParticipantVO callParticipant : response.getResult().getJoinedParticipants()) {
try {
activity.runOnUiThread(() -> {
if (cpvManager != null) {
cpvManager.showPartnerName(callParticipant.getUserId(), callParticipant.getParticipantVO().getName());
return;
}
CallPartnerView pw = findParticipantView(callParticipant.getUserId());
pw.setDisplayName(true);
pw.setPartnerName(callParticipant.getParticipantVO().getName());
});
} catch (Exception exc) {
exc.printStackTrace();
}
view.showMessage(callParticipant.getParticipantVO().getName() + " وارد تماس شد!");
}
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onVoiceCallStarted.
@Override
public void onVoiceCallStarted(ChatResponse<CallStartResult> response) {
isInCall = true;
if (Util.isNotNullOrEmpty(response.getResult().getCallPartners())) {
if (response.getResult().getCallPartners().size() == 1) {
CallParticipantVO rp = response.getResult().getCallPartners().get(0);
if (!rp.hasVideo()) {
view.hideRemoteViews();
} else {
view.showRemoteViews();
}
}
}
view.onVoiceCallStarted(" " + response.getUniqueId(), "");
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method setNameOnView.
private void setNameOnView(List<CallParticipantVO> callParticipantVOArrayList) {
try {
activity.runOnUiThread(() -> {
for (CallParticipantVO cp : callParticipantVOArrayList) {
if (cp.hasVideo()) {
if (cpvManager != null) {
cpvManager.showPartnerName(cp.getUserId(), cp.getParticipantVO().getContactName());
} else {
CallPartnerView pw = findParticipantView(cp.getUserId());
pw.setPartnerName(cp.getParticipantVO().getContactName());
pw.setDisplayName(true);
}
}
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantUnMuted.
@Override
public void onCallParticipantUnMuted(ChatResponse<MuteUnMuteCallParticipantResult> response) {
for (CallParticipantVO participant : response.getResult().getCallParticipants()) {
Long userId = participant.getUserId();
if (cpvManager != null) {
activity.runOnUiThread(() -> cpvManager.hideMuteIcon(userId));
} else {
CallPartnerView partnerView = null;
if (userId != null) {
partnerView = findParticipantView(userId);
}
String name = Util.isNotNullOrEmpty(participant.getParticipantVO().getContactName()) ? participant.getParticipantVO().getContactName() : participant.getParticipantVO().getName();
view.showMessage(name + " میکروفنش رو باز کرد 😍");
view.callParticipantUnMuted(participant, partnerView);
}
}
}
use of com.fanap.podchat.call.model.CallParticipantVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantMuted.
@Override
public void onCallParticipantMuted(ChatResponse<MuteUnMuteCallParticipantResult> response) {
for (CallParticipantVO participant : response.getResult().getCallParticipants()) {
Long userId = participant.getUserId();
if (cpvManager != null) {
activity.runOnUiThread(() -> cpvManager.showMuteIcon(userId));
} else {
CallPartnerView partnerView = null;
if (userId != null) {
partnerView = findParticipantView(userId);
}
String name = Util.isNotNullOrEmpty(participant.getParticipantVO().getContactName()) ? participant.getParticipantVO().getContactName() : participant.getParticipantVO().getName();
view.showMessage(name + " میکروفنش رو بست 🤐");
view.callParticipantMuted(participant, partnerView);
}
}
}
Aggregations