Search in sources :

Example 1 with DeskShareStoppedEventMessage

use of org.bigbluebutton.common.messages.DeskShareStoppedEventMessage in project bigbluebutton by bigbluebutton.

the class DeskShareMessageReceiver method handleMessage.

@Override
public void handleMessage(String pattern, String channel, String message) {
    if (channel.equalsIgnoreCase(MessagingConstants.FROM_VOICE_CONF_SYSTEM_CHAN)) {
        JsonParser parser = new JsonParser();
        JsonObject obj = (JsonObject) parser.parse(message);
        if (obj.has("header") && obj.has("payload")) {
            JsonObject header = (JsonObject) obj.get("header");
            if (header.has("name")) {
                String messageName = header.get("name").getAsString();
                if (DeskShareStartedEventMessage.DESKSHARE_STARTED_MESSAGE.equals(messageName)) {
                    DeskShareStartedEventMessage msg = DeskShareStartedEventMessage.fromJson(message);
                    log.info("^^^^^^^DESKSHARE STARTED^^^^^^");
                    bbbGW.deskShareStarted(msg.conferenceName, msg.callerId, msg.callerIdName);
                } else if (DeskShareStoppedEventMessage.DESK_SHARE_STOPPED_MESSAGE.equals(messageName)) {
                    DeskShareStoppedEventMessage msg = DeskShareStoppedEventMessage.fromJson(message);
                    log.info("^^^^^^^DESKSHARE STOPPED^^^^^^");
                    bbbGW.deskShareStopped(msg.conferenceName, msg.callerId, msg.callerIdName);
                } else if (DeskShareRTMPBroadcastStartedEventMessage.DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE.equals(messageName)) {
                    log.info("^^^^^^^DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE^^^^^^");
                    DeskShareRTMPBroadcastStartedEventMessage msg = DeskShareRTMPBroadcastStartedEventMessage.fromJson(message);
                    bbbGW.deskShareRTMPBroadcastStarted(msg.conferenceName, msg.streamname, msg.vw, msg.vh, msg.timestamp);
                } else if (DeskShareRTMPBroadcastStoppedEventMessage.DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE.equals(messageName)) {
                    log.info("^^^^^^^DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE^^^^^^");
                    DeskShareRTMPBroadcastStoppedEventMessage msg = DeskShareRTMPBroadcastStoppedEventMessage.fromJson(message);
                    bbbGW.deskShareRTMPBroadcastStopped(msg.conferenceName, msg.streamname, msg.vw, msg.vh, msg.timestamp);
                } else if (DeskShareGetInfoRequestMessage.GET_DESKTOP_SHARE_GET_INFO_REQUEST.equals(messageName)) {
                    log.info("^^^^^^^GET_DESKTOP_SHARE_INFO_REQUEST^^^^^^");
                    DeskShareGetInfoRequestMessage msg = DeskShareGetInfoRequestMessage.fromJson(message);
                    bbbGW.deskShareGetInfoRequest(msg.meetingId, msg.requesterId, msg.replyTo);
                }
            }
        }
    }
}
Also used : DeskShareStartedEventMessage(org.bigbluebutton.common.messages.DeskShareStartedEventMessage) DeskShareStoppedEventMessage(org.bigbluebutton.common.messages.DeskShareStoppedEventMessage) DeskShareGetInfoRequestMessage(org.bigbluebutton.common.messages.DeskShareGetInfoRequestMessage) DeskShareRTMPBroadcastStartedEventMessage(org.bigbluebutton.common.messages.DeskShareRTMPBroadcastStartedEventMessage) JsonObject(com.google.gson.JsonObject) DeskShareRTMPBroadcastStoppedEventMessage(org.bigbluebutton.common.messages.DeskShareRTMPBroadcastStoppedEventMessage) JsonParser(com.google.gson.JsonParser)

Aggregations

JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 DeskShareGetInfoRequestMessage (org.bigbluebutton.common.messages.DeskShareGetInfoRequestMessage)1 DeskShareRTMPBroadcastStartedEventMessage (org.bigbluebutton.common.messages.DeskShareRTMPBroadcastStartedEventMessage)1 DeskShareRTMPBroadcastStoppedEventMessage (org.bigbluebutton.common.messages.DeskShareRTMPBroadcastStoppedEventMessage)1 DeskShareStartedEventMessage (org.bigbluebutton.common.messages.DeskShareStartedEventMessage)1 DeskShareStoppedEventMessage (org.bigbluebutton.common.messages.DeskShareStoppedEventMessage)1