Package org.openmeetings.app.persistence.beans.recording

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


      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

   * 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

   * @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

     
      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

      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

            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

  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

  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

    try {

      // 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("*** sendClientBroadcastNotifications 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.stopRecordingShowForClient(conn, currentClient);
                  }
                }
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.recording.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.