Examples of RoomClient


Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

    try {
     
      IConnection current = Red5.getConnectionLocal();
      IServiceCapableConnection service = (IServiceCapableConnection) current;
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      Map returnMap = new HashMap();
      returnMap.put("result", "stopAll");
     
     
      log.debug("-----------  ");
     
      if (currentClient != null) {
       
        boolean stopStreaming = Boolean.valueOf(map.get("stopStreaming").toString());
        boolean stopRecording = Boolean.valueOf(map.get("stopRecording").toString());
       
       
        if (stopStreaming) {
         
          log.debug("start streamPublishStart Is Screen Sharing -- Stop ");
         
          //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());
                    //log.debug("is this users still alive? :"+rcl);
                    //Check if the Client is in the same room and same domain
                    if (rcl == null) {
                      //continue;
                    } else if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                        //continue;
                      } else {
                      IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                      //log.info("IServiceCapableConnection ID " + iStream.getClient().getId());
                      iStream.invoke("stopRed5ScreenSharing",new Object[] { currentClient }, this);
                      log.debug("send Notification to");
                    }
                  }
                }
              }
            }
          }
         
          if (currentClient.isStartRecording()) {
           
            returnMap.put("result", "stopSharingOnly");
           
          }
         
          currentClient.setStartStreaming(false);
          currentClient.setScreenPublishStarted(false);
         
          this.clientListManager.updateClientByStreamId(currentClient.getStreamid(), currentClient);
         
        }
       
        if (stopRecording) {
         
          if (currentClient.isStartStreaming()) {
            returnMap.put("result", "stopRecordingOnly");
          }
         
          //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());
                    //log.debug("is this users still alive? :"+rcl);
                    //Check if the Client is in the same room and same domain
                    if (rcl == null) {
                      //continue;
                    } else if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                        //continue;
                      } else {
                      IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                      //log.info("IServiceCapableConnection ID " + iStream.getClient().getId());
                      iStream.invoke("stopRecordingMessage",new Object[] { currentClient }, this);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

     
      log.debug("checkScreenSharing -2- "+streamid);
     
      List<RoomClient> screenSharerList = new LinkedList<RoomClient>();
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      HashMap<String,RoomClient> roomList = this.clientListManager.getClientListByRoomAll(currentClient.getRoom_id());
     
      for (Iterator<String> iter = roomList.keySet().iterator();iter.hasNext();) {
       
        RoomClient rcl = roomList.get(iter.next());
       
        if (rcl.isStartStreaming()) {
          screenSharerList.add(rcl);
        }
       
      }
     
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

      IConnection current = Red5.getConnectionLocal();
      //IServiceCapableConnection service = (IServiceCapableConnection) current;
     
      log.debug("### setConnectionAsSharingClient: ");
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());

      if (currentClient != null) {
       
        boolean startRecording = Boolean.valueOf(map.get("startRecording").toString());
        boolean startStreaming = Boolean.valueOf(map.get("startStreaming").toString());
       
        currentClient.setRoom_id(Long.parseLong(current.getScope().getName()));
       
        //Set this connection to be a RTMP-Java Client
        currentClient.setIsScreenClient(true);
        currentClient.setUser_id(Long.parseLong(map.get("user_id").toString()));
       
        if (startStreaming) {
          currentClient.setStartStreaming(true);
        }
       
        if (startRecording) {
          currentClient.setStartRecording(true);
        }
       
        currentClient.setOrganization_id(Long.parseLong(map.get("organization_id").toString()));
       
        this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
       
        Map returnMap = new HashMap();
        returnMap.put("alreadyPublished", false);
       
        //if is already started screen sharing, then there is no need to start it again
        if (currentClient.getScreenPublishStarted() != null && currentClient.getScreenPublishStarted()) {
          returnMap.put("alreadyPublished", true);
        }
       
        currentClient.setVX(Integer.parseInt(map.get("screenX").toString()));
        currentClient.setVY(Integer.parseInt(map.get("screenY").toString()));
        currentClient.setVWidth(Integer.parseInt(map.get("screenWidth").toString()));
        currentClient.setVHeight(Integer.parseInt(map.get("screenHeight").toString()));
       
        log.debug("screen x,y,width,height "+currentClient.getVX()+" "+currentClient.getVY()+" "+currentClient.getVWidth()+" "+currentClient.getVHeight());
       
        log.debug("publishName :: "+map.get("publishName"));
       
        currentClient.setStreamPublishName(map.get("publishName").toString());
     
        RoomClient currentScreenUser = this.clientListManager.getClientByPublicSID(currentClient.getStreamPublishName());
       
        currentClient.setFirstname(currentScreenUser.getFirstname());
        currentClient.setLastname(currentScreenUser.getLastname());
       
        //This is duplicated, but its not sure that in the meantime somebody requests this Client Object Info
        this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
       
        if (startStreaming) {
         
          returnMap.put("modus", "startStreaming");
         
          log.debug("start streamPublishStart Is Screen Sharing ");
         
          //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());
                    //log.debug("is this users still alive? :"+rcl);
                    //Check if the Client is in the same room and same domain
                    if (rcl == null) {
                      //continue;
                    } else if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                        //continue;
                      } else {
                      IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                      //log.info("IServiceCapableConnection ID " + iStream.getClient().getId());
                      iStream.invoke("newRed5ScreenSharing",new Object[] { currentClient }, this);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

   * this function is invoked directly after initial connecting
   * @return
   */
  public synchronized String getPublicSID() {
    IConnection current = Red5.getConnectionLocal();
    RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
    return currentClient.getPublicSID();
  }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

   * @param newPublicSID
   */
  public synchronized Boolean overwritePublicSID(String newPublicSID) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      if (currentClient == null) {
        return false;
      }
      currentClient.setPublicSID(newPublicSID);
      this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
      return true;
    } catch (Exception err) {
      log.error("[overwritePublicSID]",err);
    }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

     
      log.debug("roomLeave " + client.getId() + " "+ room.getClients().size() + " " + room.getContextPath() + " "+ room.getName());
     
      //IConnection current = Red5.getConnectionLocal();
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(client.getId());
     
//      //In case its a screen sharing we start a new Video for that
//      if (currentClient != null && currentClient.getIsScreenClient() != null && currentClient.getIsScreenClient()) {
//     
//        log.debug("start streamPublishStart Is Screen Sharing -- Stop ");
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
     
      log.debug(streamid + " is leaving");
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      this.roomLeaveByScope(currentClient, current.getScope());
     
    } catch (Exception err){
      log.error("[logicalRoomLeave]",err);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

            if (cons != null) {
              if (cons instanceof IServiceCapableConnection) {
           
                log.debug("sending roomDisconnect to " + cons + " client id " + cons.getClient().getId() );
               
                RoomClient rcl = this.clientListManager.getClientByStreamId(cons.getClient().getId());
               
                /*
                 * Check if the Client does still exist on the list
                 */
                if (rcl != null) {
                 
                  /*
                   * Do not send back to sender, but actually all other clients should receive this message
                   * swagner  01.10.2009
                   */
                  if (!currentClient.getStreamid().equals(rcl.getStreamid())){
                   
                   
                    if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                        //continue;
                      } else {
                      //Send to all connected users 
                      ((IServiceCapableConnection) cons).invoke("roomDisconnect",new Object[] { currentClient }, this);
                      log.debug("sending roomDisconnect to " + cons);
                    }
                   
                    //add Notification if another user is recording
                    log.debug("###########[roomLeave]");
                    if (rcl.getIsRecording()){
                      log.debug("*** roomLeave Any Client is Recording - stop that");
                      //StreamService.addRoomClientEnterEventFunc(rcl, rcl.getRoomRecordingName(), rcl.getUserip(), false);
                      //StreamService.stopRecordingShowForClient(cons, currentClient, rcl.getRoomRecordingName(), false);
                     
                      //this.flvRecorderService.stopRecordingShowForClient(cons, currentClient, false);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

  public synchronized void streamPublishStart(IBroadcastStream stream) {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
           
      // 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);
       
      }

      //Notify all users of the same Scope
      //We need to iterate through the streams to cathc 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) {
              if (conn.equals(current)){
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                if (rcl == null) {
                  //continue;
                } else if (rcl.getIsRecording()){
                  //StreamService.addRecordingByStreamId(current, streamid, currentClient, rcl.getFlvRecordingId());
                 
                  this.flvRecorderService.addRecordingByStreamId(current, streamid, currentClient, rcl.getFlvRecordingId());
                 
                }
                continue;
              } else {
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                //log.debug("is this users still alive? :"+rcl);
                //Check if the Client is in the same room and same domain
                if (rcl == null) {
                  //continue;
                } else {
                  IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                  //log.info("IServiceCapableConnection ID " + iStream.getClient().getId());
                  if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                      //continue;
                    } else {
                    iStream.invoke("newStream",new Object[] { currentClient }, this);
                  }
                 
                  if (rcl.getIsRecording()){
                    //StreamService.addRecordingByStreamId(current, streamid, currentClient, rcl.getFlvRecordingId());
                    this.flvRecorderService.addRecordingByStreamId(current, streamid, currentClient, rcl.getFlvRecordingId());
                   
                  }
                }
              }
            }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient

  public synchronized void streamBroadcastClose(IBroadcastStream stream) {

    // Notify all the clients that the stream had been started
    log.debug("start streamBroadcastClose broadcast close: "+ stream.getPublishedName());
    try {
      RoomClient rcl = this.clientListManager.getClientByStreamId(Red5.getConnectionLocal().getClient().getId());
     
      sendClientBroadcastNotifications(stream,"closeStream",rcl);
    } catch (Exception e){
      log.error("[streamBroadcastClose]",e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.