Package com.kurento.kmf.content

Examples of com.kurento.kmf.content.ContentEvent


    for (Receiver receiver : receivers) {
      if (!receiver.isConnected()) {
        transmitter.getWebRtcEndpoint().connect(
            receiver.getWebRtcEndpoint());
        receiver.getContentSession().publishEvent(
            new ContentEvent("nickname", transmitter.getNick()));
        receiver.setConnected(true);
        break;
      }
    }
  }
View Full Code Here


    Constraints videoConstraints = contentSession.getVideoConstraints();

    if (videoConstraints.name().equalsIgnoreCase("SENDONLY")) {
      // it means the request is from the transmitter
      connection.setTransmitter(webRtcEndpoint, nickName);
      contentSession.publishEvent(new ContentEvent("nickname", nickName));
    } else {
      connection.addReceiver(webRtcEndpoint, contentSession);
    }

    // If at this moment the connection is full, then it can be established
View Full Code Here

    CpRtcRtpZbarHandler.sharedFilterReference
        .addCodeFoundListener(new MediaEventListener<CodeFoundEvent>() {

          @Override
          public void onEvent(CodeFoundEvent event) {
            session.publishEvent(new ContentEvent(event.getType(),
                event.getValue()));
          }
        });

    HttpGetEndpoint httpEndpoint = CpRtcRtpZbarHandler.sharedFilterReference
View Full Code Here

  private void notifyJoined(DispatcherParticipant participant) {
    String json = gson.toJson(participant);
    getLogger().info("Participant joined: {}", json);
    for (DispatcherParticipant p : participants.values()) {
      p.session.publishEvent(new ContentEvent(EVENT_ON_JOINED, json));
    }
  }
View Full Code Here

  private void notifyUnjoined(DispatcherParticipant participant) {
    String json = gson.toJson(participant);
    getLogger().info("Participant unjoined: {}", json);
    for (DispatcherParticipant p : participants.values()) {
      p.session.publishEvent(new ContentEvent(EVENT_ON_UNJOINED, json));
    }
  }
View Full Code Here

                    .toString().equals(event.getValue())) {
                  return;
                }
                session.setAttribute("eventValue",
                    event.getValue());
                session.publishEvent(new ContentEvent(event
                    .getType(), event.getValue()));
              }
            });
      }
View Full Code Here

                .toString().equals(event.getPlate())) {
              return;
            }
            contentSession.setAttribute("eventValue",
                event.getPlate());
            contentSession.publishEvent(new ContentEvent(event
                .getType(), event.getPlate()));
          }
        });
  }
View Full Code Here

        // connect elements
        playerendpoint.connect(crowdDetector);
        crowdDetector.connect(webRtcEndpoint);
        playerendpoint.play();

        contentSession.publishEvent(new ContentEvent("startConn",
            "startConn"));
        // addEventListener to crowddetector
        crowdDetector
            .addCrowdDetectorDirectionListener(new MediaEventListener<CrowdDetectorDirectionEvent>() {
              @Override
              public void onEvent(
                  CrowdDetectorDirectionEvent event) {
                String eventText = "Direction event detect in ROI "
                    + event.getRoiID()
                    + "with direction "
                    + event.getDirectionAngle();
                contentSession.publishEvent(new ContentEvent(
                    event.getType(), eventText));
              }
            });

        crowdDetector
            .addCrowdDetectorFluidityListener(new MediaEventListener<CrowdDetectorFluidityEvent>() {
              @Override
              public void onEvent(CrowdDetectorFluidityEvent event) {
                String eventText = "Fluidity event detect in ROI "
                    + event.getRoiID()
                    + ". Fluidity level = "
                    + event.getFluidityLevel()
                    + " and fluidity percentage = "
                    + event.getFluidityPercentage();
                contentSession.publishEvent(new ContentEvent(
                    event.getType(), eventText));
              }
            });

        crowdDetector
            .addCrowdDetectorOccupancyListener(new MediaEventListener<CrowdDetectorOccupancyEvent>() {
              @Override
              public void onEvent(
                  CrowdDetectorOccupancyEvent event) {
                String eventText = "Occupancy event detect in ROI "
                    + event.getRoiID()
                    + ". Occupancy level = "
                    + event.getOccupancyLevel()
                    + " and occupancy percentage = "
                    + event.getOccupancyPercentage();
                contentSession.publishEvent(new ContentEvent(
                    event.getType(), eventText));
              }
            });
      }
    }
View Full Code Here

  private void notifyJoined(WebRTCParticipant participant) {
    String json = gson.toJson(participant);
    getLogger().info("Participant joined: {}", json);
    for (WebRTCParticipant p : participants.values()) {
      p.session.publishEvent(new ContentEvent(EVENT_ON_JOINED, json));
    }
  }
View Full Code Here

  private void notifyUnjoined(WebRTCParticipant participant) {
    String json = gson.toJson(participant);
    getLogger().info("Participant unjoined: {}", json);
    for (WebRTCParticipant p : participants.values()) {
      p.session.publishEvent(new ContentEvent(EVENT_ON_UNJOINED, json));
    }
  }
View Full Code Here

TOP

Related Classes of com.kurento.kmf.content.ContentEvent

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.