use of com.fanap.podchat.call.request_model.screen_share.ScreenShareResult in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnScreenShareStarted.
public static ChatResponse<ScreenShareResult> handleOnScreenShareStarted(ChatMessage chatMessage) {
ChatResponse<ScreenShareResult> response = null;
try {
response = new ChatResponse<>();
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
ScreenShareResult screenSharer = App.getGson().fromJson(chatMessage.getContent(), ScreenShareResult.class);
response.setResult(screenSharer);
} catch (Exception e) {
Log.wtf(TAG, e);
}
return response;
}
use of com.fanap.podchat.call.request_model.screen_share.ScreenShareResult 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.request_model.screen_share.ScreenShareResult 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);
}
}
}
use of com.fanap.podchat.call.request_model.screen_share.ScreenShareResult in project pod-chat-android-sdk by FanapSoft.
the class Chat method handOnShareScreenStarted.
@Override
void handOnShareScreenStarted(ChatMessage chatMessage, Callback callback) {
if (deviceIsInCall) {
if (sentryResponseLog) {
showLog("RECEIVE_SHARE_SCREEN_STARTED", gson.toJson(chatMessage));
} else {
showLog("RECEIVE_SHARE_SCREEN_STARTED");
}
if (podVideoCall != null) {
ChatResponse<ScreenShareResult> response = CallAsyncRequestsManager.handleOnScreenShareStarted(chatMessage);
if (Util.isNotNullOrEmpty(response.getResult().getScreenShare())) {
if (callback != null) {
removeCallback(chatMessage.getUniqueId());
ScreenSharer screenSharer = new ScreenSharer.Builder().setPartnerType(PartnerType.LOCAL).setName("Your Screen").setVideoTopic(response.getResult().getScreenShare()).build();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
podVideoCall.addScreenSharer(screenSharer);
listenerManager.callOnScreenShareStarted(response);
}
} else {
addScreenSharer(response);
}
} else {
captureError(new PodChatException(ChatConstant.ERROR_METHOD_NOT_IMPLEMENTED, ChatConstant.ERROR_CODE_METHOD_NOT_IMPLEMENTED, chatMessage.getUniqueId()));
}
}
}
}
Aggregations