Java Code Examples for org.kurento.client.KurentoClient#create()

The following examples show how to use org.kurento.client.KurentoClient#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtraKmsFakeUsers.java    From kurento-room with Apache License 2.0 6 votes vote down vote up
protected synchronized KurentoClient getTestExtraFakeKurento() {
  if (testExtraFakeKurento == null) {
    testExtraFakeKurento = KurentoClient.create(testExtraFakeKmsWsUri,
        new KurentoConnectionListener() {
      @Override
      public void connected() {
      }

      @Override
      public void connectionFailed() {
      }

      @Override
      public void disconnected() {
        testExtraFakeKurento = null;
      }

      @Override
      public void reconnected(boolean sameServer) {
      }
    });
  }

  return testExtraFakeKurento;
}
 
Example 2
Source File: FixedOneKmsManager.java    From openvidu with Apache License 2.0 6 votes vote down vote up
@Override
public List<Kms> initializeKurentoClients(List<KmsProperties> kmsProperties, boolean disconnectUponFailure) throws Exception {
	KmsProperties firstProps = kmsProperties.get(0);
	KurentoClient kClient = null;
	Kms kms = new Kms(firstProps, loadManager);
	try {
		kClient = KurentoClient.create(firstProps.getUri(), this.generateKurentoConnectionListener(kms.getId()));
		this.addKms(kms);
		kms.setKurentoClient(kClient);

		// TODO: This should be done in KurentoClient connected event
		kms.setKurentoClientConnected(true);
		kms.setTimeOfKurentoClientConnection(System.currentTimeMillis());

	} catch (KurentoException e) {
		log.error("KMS in {} is not reachable by OpenVidu Server", firstProps.getUri());
		if (kClient != null) {
			kClient.destroy();
		}
		throw new Exception();
	}
	return Arrays.asList(kms);
}
 
Example 3
Source File: FixedNKmsManager.java    From kurento-room with Apache License 2.0 5 votes vote down vote up
public FixedNKmsManager(List<String> kmsWsUri, int kmsLoadLimit) {
  for (String uri : kmsWsUri) {
    Kms kms = new Kms(KurentoClient.create(uri), uri);
    kms.setLoadManager(new MaxWebRtcLoadManager(kmsLoadLimit));
    this.addKms(kms);
  }
}
 
Example 4
Source File: HelloWorldRecApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 5
Source File: Application.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient()
{
  return KurentoClient.create();
}
 
Example 6
Source File: ShowDataChannelApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 7
Source File: SendDataChannelApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 8
Source File: One2OneCallAdvApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 9
Source File: CrowdDetectorApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 10
Source File: One2OneCallRecApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 11
Source File: ChromaApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 12
Source File: PointerDetectorApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 13
Source File: GroupCallApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 14
Source File: ConnectionListenerTest.java    From kurento-java with Apache License 2.0 4 votes vote down vote up
@Test
public void reconnectTest() throws InterruptedException, IOException {

  String kmsUrl = kms.getWsUri();

  log.debug("Connecting to KMS in " + kmsUrl);

  KurentoClient kurentoClient = KurentoClient.create(kmsUrl);

  kurentoClient.createMediaPipeline();

  kms.stopKms();

  Thread.sleep(3000);

  kms.start();

  kurentoClient.createMediaPipeline();

  kms.stopKms();
}
 
Example 15
Source File: ConnectionListenerTest.java    From kurento-java with Apache License 2.0 4 votes vote down vote up
@Test
public void disconnectionEventTest() throws InterruptedException, IOException {

  final CountDownLatch disconnectedLatch = new CountDownLatch(1);

  String kmsUrl = kms.getWsUri();

  log.debug("Connecting to KMS in " + kmsUrl);

  KurentoClient kurentoClient = KurentoClient.create(kmsUrl, new KurentoConnectionListener() {

    @Override
    public void disconnected() {
      log.debug("disconnected from KMS");
      disconnectedLatch.countDown();
    }

    @Override
    public void connectionFailed() {

    }

    @Override
    public void connected() {

    }

    @Override
    public void reconnected(boolean sameServer) {

    }
  });

  MediaPipeline pipeline = kurentoClient.createMediaPipeline();

  PlayerEndpoint player =
      new PlayerEndpoint.Builder(pipeline, "http://" + getTestFilesHttpPath()
          + "/video/format/small.webm").build();

  HttpPostEndpoint httpEndpoint = new HttpPostEndpoint.Builder(pipeline).build();

  player.connect(httpEndpoint);

  try {
    kms.stopKms();
  } catch (Exception e) {
    fail("Exception thrown when destroying kms. " + e);
  }

  log.debug("Waiting for disconnection event");
  if (!disconnectedLatch.await(60, TimeUnit.SECONDS)) {
    fail("Event disconnected should be thrown when kcs is destroyed");
  }
  log.debug("Disconnection event received");
}
 
Example 16
Source File: PlayerApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 17
Source File: PlateDetectorApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
Example 18
Source File: KmsService.java    From kurento-java with Apache License 2.0 4 votes vote down vote up
public KurentoClient createKurentoClient() {
  return KurentoClient.create(wsUri);
}
 
Example 19
Source File: KurentoRoomServerApp.java    From kurento-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create("ws://localhost:8888/kurento");
}
 
Example 20
Source File: One2OneCallApp.java    From kurento-tutorial-java with Apache License 2.0 4 votes vote down vote up
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}