Package org.openmeetings.app.conference.session

Examples of org.openmeetings.app.conference.session.RoomClient


  @Override
  public synchronized void streamPublishStart(IBroadcastStream stream) {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(streamid);

      //We make a second object the has the reference to the object
      //that we will use to send to all participents
      RoomClient clientObjectSendToSync = currentClient;
     
      // Notify all the clients that the stream had been started
      log.debug("start streamPublishStart broadcast start: "
          + stream.getPublishedName() + " CONN " + current);

      // In case its a screen sharing we start a new Video for that
      if (currentClient.getIsScreenClient()) {

        currentClient.setScreenPublishStarted(true);

        this.clientListManager.updateClientByStreamId(current
            .getClient().getId(), currentClient);
      }
      //If its an audio/video client then send the session object with the full
      //data to everybody
      else if (currentClient.getIsAVClient()) {
        clientObjectSendToSync = this.clientListManager.getClientByPublicSID(
                      currentClient.getPublicSID(), false);
      }
     
      log.debug("newStream SEND: "+currentClient);

      // Notify all users of the same Scope
      // We need to iterate through the streams to catch if anybody is recording
      Collection<Set<IConnection>> conCollection = current.getScope()
          .getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
             
              RoomClient rcl = this.clientListManager
                  .getClientByStreamId(conn.getClient()
                      .getId());
             
              if (rcl == null) {
                log.debug("RCL IS NULL newStream SEND");
                continue;
              }
             
              log.debug("check send to "+rcl);
             
              if (rcl.getPublicSID() == "") {
                log.debug("publicSID IS NULL newStream SEND");
                continue;
              }
              if (rcl.getIsRecording()) {
                log.debug("RCL getIsRecording newStream SEND");
                this.flvRecorderService
                    .addRecordingByStreamId(current,
                        streamid, currentClient,
                        rcl.getFlvRecordingId());
              }
              if (rcl.getIsAVClient()) {
                log.debug("RCL getIsAVClient newStream SEND");
                continue;
              }
              if (rcl.getIsScreenClient() == null || rcl.getIsScreenClient()) {
                log.debug("RCL getIsScreenClient newStream SEND");
                continue;
              }
             
              if (rcl.getPublicSID().equals(currentClient.getPublicSID())) {
                log.debug("RCL publicSID is equal newStream SEND");
                continue;
              }
             
              log.debug("RCL SEND is equal newStream SEND "+rcl.getPublicSID()+" || "+rcl.getUserport());
               
              IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
              iStream.invoke("newStream",
                  new Object[] { clientObjectSendToSync },
                  this);
View Full Code Here


  }

    public boolean streamPublishingStart(String host, String app, String id) {
      final boolean[] result = {true};
    final IConnection conn = Red5.getConnectionLocal();
    RoomClient rc = clientListManager.getClientByStreamId(conn.getClient().getId());
    String publishName = rc.getStreamPublishName();
   
    if (rc.getIsScreenClient() && rc.isStartStreaming()) {
          IScope scope = conn.getScope();
          IBroadcastStream stream = getBroadcastStream(scope, publishName);
          IBroadcastScope bsScope = getBroadcastScope(scope, publishName);
          final StreamingProxy proxy = new StreamingProxy();
          proxy.setHost(host);
View Full Code Here

    return result[0];
    }
   
    public void streamPublishingStop() {
    IConnection current = Red5.getConnectionLocal();
    RoomClient rc = clientListManager.getClientByStreamId(current.getClient().getId());
    String publishName = rc.getStreamPublishName();
   
    if (rc.getIsScreenClient() && publishName != null) {
          IScope scope = current.getScope();
          IBroadcastStream stream = getBroadcastStream(scope, publishName);
      StreamingProxy proxy = streamingProxyMap.remove(publishName);
      if (proxy != null) {
        proxy.stop();
View Full Code Here

        + stream.getPublishedName());
    try {
      streamPublishingStop();
     
      IConnection current = Red5.getConnectionLocal();
      RoomClient rcl = clientListManager.getClientByStreamId(current.getClient().getId());
      sendClientBroadcastNotifications(stream, "closeStream", rcl);
    } catch (Exception e) {
      log.error("[streamBroadcastClose]", e);
    }
  }
View Full Code Here

    String returnValue = "";
    try {
      log.debug("createPoll: " + pollQuestion);

      IConnection currentcon = Red5.getConnectionLocal();
      RoomClient rc = clientListManager.getClientByStreamId(currentcon
          .getClient().getId());

      log.debug("rc: " + rc.getStreamid() + " " + rc.getUsername() + " "
          + rc.getIsMod());

      if (rc.getIsMod()) {
        // will move all existing polls to the archive
        pollManagement.closePoll(rc.getRoom_id());
       
        sendNotification(currentcon, "newPoll",
            new Object[] { pollManagement.createPoll(rc,
                pollName, pollQuestion, (long) pollTypeId) });
        returnValue = "200";
View Full Code Here

      // Store the local so that we do not send notification to ourself
      // back
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(streamid);

      if (currentClient == null) {

        // In case the client has already left(kicked) this message
        // might be thrown later then the RoomLeave
        // event and the currentClient is already gone
        // The second Use-Case where the currentClient is maybe null is
        // if we remove the client because its a Zombie/Ghost

        return;

      }
      // Notify all the clients that the stream had been started
      log.debug("sendClientBroadcastNotifications: "
          + stream.getPublishedName());
      log.debug("sendClientBroadcastNotifications : " + currentClient
          + " " + currentClient.getStreamid());

      // Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope()
          .getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              if (conn.equals(current)) {
                // there is a Bug in the current implementation
                // of the appDisconnect
                if (clientFunction.equals("closeStream")) {
                  RoomClient rcl = this.clientListManager
                      .getClientByStreamId(conn
                          .getClient().getId());
                  if (clientFunction.equals("closeStream")
                      && rcl.getIsRecording()) {
                    log.debug("*** stopRecordingShowForClient Any Client is Recording - stop that");
                    // StreamService.stopRecordingShowForClient(conn,
                    // currentClient,
                    // rcl.getRoomRecordingName(), false);
                    this.flvRecorderService
                        .stopRecordingShowForClient(
                            conn, currentClient);
                  }
                  // Don't notify current client
                  current.ping();
                }
                continue;
              } else {
                RoomClient rcl = this.clientListManager
                    .getClientByStreamId(conn.getClient()
                        .getId());
                if (rcl != null) {
                  if (rcl.getIsScreenClient() != null
                      && rcl.getIsScreenClient()) {
                    // continue;
                  } else {
                    log.debug("is this users still alive? :"
                        + rcl);
                    // conn.ping();
                    IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                    // log.info("IServiceCapableConnection ID "
                    // + iStream.getClient().getId());
                    iStream.invoke(clientFunction,
                        new Object[] { rc }, this);
                  }

                  log.debug("sending notification to " + conn
                      + " ID: ");

                  // if this close stream event then stop the
                  // recording of this stream
                  if (clientFunction.equals("closeStream")
                      && rcl.getIsRecording()) {
                    log.debug("***  +++++++ ######## sendClientBroadcastNotifications Any Client is Recording - stop that");
                    // StreamService.stopRecordingShowForClient(conn,
                    // currentClient,
                    // rcl.getRoomRecordingName(), false);
                    this.flvRecorderService
View Full Code Here

  public boolean closePoll() {
    try {
      log.debug("closePoll: ");

      IConnection currentcon = Red5.getConnectionLocal();
      RoomClient rc = clientListManager.getClientByStreamId(currentcon
          .getClient().getId());

      log.debug("rc: " + rc.getStreamid() + " " + rc.getUsername() + " "
          + rc.getIsMod());

      if (rc.getIsMod()) {
        // will move all existing polls to the archive
        return pollManagement.closePoll(rc.getRoom_id());
      }

    } catch (Exception err) {
      log.error("[closePoll]", err);
    }
View Full Code Here

      log.debug("*..*addModerator publicSID: " + publicSID);

      // String streamid = current.getClient().getId();

      RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);

      if (currentClient == null) {
        return -1L;
      }
      Long room_id = currentClient.getRoom_id();

      currentClient.setIsMod(true);
      // Put the mod-flag to true for this client
      this.clientListManager.updateClientByStreamId(
          currentClient.getStreamid(), currentClient);

      List<RoomClient> currentMods = this.clientListManager
          .getCurrentModeratorByRoom(room_id);
     
      //Send message to all users
View Full Code Here

  public void setNewCursorPosition(Object item) {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(streamid);

      // log.debug("[setNewCursorPosition]"+item);

      @SuppressWarnings("rawtypes")
      Map cursor = (Map) item;
      cursor.put("streamPublishName",
          currentClient.getStreamPublishName());

      // log.debug("[setNewCursorPosition x]"+cursor.get("cursor_x"));
      // log.debug("[setNewCursorPosition y]"+cursor.get("cursor_y"));
      // log.debug("[setNewCursorPosition publicSID]"+cursor.get("publicSID"));

      // Notify all users of the same Scope
      Collection<Set<IConnection>> conCollection = current.getScope()
          .getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              if (conn.equals(current)) {
                continue;
              } else {
                RoomClient rcl = this.clientListManager
                    .getClientByStreamId(conn.getClient()
                        .getId());
                if (rcl == null) {
                  // continue;
                } else if (rcl.getIsScreenClient() != null
                    && rcl.getIsScreenClient()) {
                  // continue;
                } else {
                  // log.debug("is this users still alive? :"+rcl);
                  // Check if the Client is in the same room
                  // and same domain
View Full Code Here

  public boolean deletePoll(Long poll_id) {
    try {
      log.debug("closePoll: ");

      IConnection currentcon = Red5.getConnectionLocal();
      RoomClient rc = clientListManager.getClientByStreamId(currentcon
          .getClient().getId());

      log.debug("rc: " + rc.getStreamid() + " " + rc.getUsername() + " "
          + rc.getIsMod());

      if (rc.getIsMod()) {
        // will move all existing polls to the archive
        return pollManagement.deletePoll(poll_id);
      }

    } catch (Exception err) {
View Full Code Here

TOP

Related Classes of org.openmeetings.app.conference.session.RoomClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.