Search in sources :

Example 1 with TurnCallParticipantVideoOffRequest

use of com.fanap.podchat.call.request_model.TurnCallParticipantVideoOffRequest in project pod-chat-android-sdk by FanapSoft.

the class CallAsyncRequestsManager method createTurnOffVideoMessage.

public static String createTurnOffVideoMessage(long callId, String uniqueId) {
    ArrayList<Long> ids = new ArrayList<>();
    ids.add(CoreConfig.userId);
    TurnCallParticipantVideoOffRequest request = new TurnCallParticipantVideoOffRequest.Builder(callId, ids).build();
    AsyncMessage message = new AsyncMessage();
    message.setType(ChatMessageType.Constants.TURN_OFF_VIDEO_CALL);
    message.setToken(CoreConfig.token);
    message.setSubjectId(request.getCallId());
    message.setTokenIssuer(CoreConfig.tokenIssuer);
    message.setUniqueId(uniqueId);
    message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
    JsonObject a = (JsonObject) App.getGson().toJsonTree(message);
    return a.toString();
}
Also used : AsyncMessage(com.fanap.podchat.mainmodel.AsyncMessage) TurnCallParticipantVideoOffRequest(com.fanap.podchat.call.request_model.TurnCallParticipantVideoOffRequest) ArrayList(java.util.ArrayList) JsonObject(com.google.gson.JsonObject)

Example 2 with TurnCallParticipantVideoOffRequest

use of com.fanap.podchat.call.request_model.TurnCallParticipantVideoOffRequest in project pod-chat-android-sdk by FanapSoft.

the class CallAsyncRequestsManager method createTurnOnVideoMessage.

public static String createTurnOnVideoMessage(long callId, String uniqueId) {
    ArrayList<Long> ids = new ArrayList<>();
    ids.add(CoreConfig.userId);
    TurnCallParticipantVideoOffRequest request = new TurnCallParticipantVideoOffRequest.Builder(callId, ids).build();
    AsyncMessage message = new AsyncMessage();
    message.setType(ChatMessageType.Constants.TURN_ON_VIDEO_CALL);
    message.setToken(CoreConfig.token);
    message.setSubjectId(request.getCallId());
    message.setTokenIssuer(CoreConfig.tokenIssuer);
    message.setUniqueId(uniqueId);
    message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
    JsonObject a = (JsonObject) App.getGson().toJsonTree(message);
    return a.toString();
}
Also used : AsyncMessage(com.fanap.podchat.mainmodel.AsyncMessage) TurnCallParticipantVideoOffRequest(com.fanap.podchat.call.request_model.TurnCallParticipantVideoOffRequest) ArrayList(java.util.ArrayList) JsonObject(com.google.gson.JsonObject)

Aggregations

TurnCallParticipantVideoOffRequest (com.fanap.podchat.call.request_model.TurnCallParticipantVideoOffRequest)2 AsyncMessage (com.fanap.podchat.mainmodel.AsyncMessage)2 JsonObject (com.google.gson.JsonObject)2 ArrayList (java.util.ArrayList)2