• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PlayerEndpoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kurento.client.PlayerEndpoint的典型用法代码示例。如果您正苦于以下问题:Java PlayerEndpoint类的具体用法?Java PlayerEndpoint怎么用?Java PlayerEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PlayerEndpoint类属于org.kurento.client包,在下文中一共展示了PlayerEndpoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: PlayMediaPipeline

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public PlayMediaPipeline(KurentoClient kurento, String user, final WebSocketSession session) {
  // Media pipeline
  pipeline = kurento.createMediaPipeline();

  // Media Elements (WebRtcEndpoint, PlayerEndpoint)
  webRtc = new WebRtcEndpoint.Builder(pipeline).build();
  player = new PlayerEndpoint.Builder(pipeline, RECORDING_PATH + user + RECORDING_EXT).build();

  // Connection
  player.connect(webRtc);

  // Player listeners
  player.addErrorListener(new EventListener<ErrorEvent>() {
    @Override
    public void onEvent(ErrorEvent event) {
      log.info("ErrorEvent: {}", event.getDescription());
      sendPlayEnd(session);
    }
  });
}
 
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:21,代码来源:PlayMediaPipeline.java


示例2: usePlainMethodsInNewObjectsInsideTx

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test(expected = TransactionNotCommitedException.class)
public void usePlainMethodsInNewObjectsInsideTx() throws InterruptedException, ExecutionException {

  // Pipeline creation (no transaction)
  MediaPipeline pipeline = kurentoClient.createMediaPipeline();
  PlayerEndpoint player =
      new PlayerEndpoint.Builder(pipeline, "http://" + getTestFilesHttpPath()
          + "/video/format/small.webm").build();

  // Creation in explicit transaction
  Transaction tx = pipeline.beginTransaction();
  HttpPostEndpoint httpEndpoint = new HttpPostEndpoint.Builder(pipeline).build(tx);

  // TransactionNotExecutedExcetion should be thrown
  httpEndpoint.connect(player);

}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:18,代码来源:TransactionTest.java


示例3: usePlainMethodsWithNewObjectsAsParamsInsideTx

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test(expected = TransactionNotCommitedException.class)
public void usePlainMethodsWithNewObjectsAsParamsInsideTx() throws InterruptedException,
    ExecutionException {

  // Pipeline creation (no transaction)
  MediaPipeline pipeline = kurentoClient.createMediaPipeline();
  PlayerEndpoint player =
      new PlayerEndpoint.Builder(pipeline, "http://" + getTestFilesHttpPath()
          + "/video/format/small.webm").build();

  // Creation in explicit transaction
  Transaction tx = pipeline.beginTransaction();
  HttpPostEndpoint httpEndpoint = new HttpPostEndpoint.Builder(pipeline).build(tx);

  // TransactionNotExecutedExcetion should be thrown
  player.connect(httpEndpoint);

}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:19,代码来源:TransactionTest.java


示例4: testRtpEndpointSimulatingAndroidSdp

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void testRtpEndpointSimulatingAndroidSdp() throws InterruptedException {

  PlayerEndpoint player = new PlayerEndpoint.Builder(pipeline, URL_BARCODES).build();

  RtpEndpoint rtpEndpoint = new RtpEndpoint.Builder(pipeline).build();

  String requestSdp = "v=0\r\n" + "o=- 12345 12345 IN IP4 95.125.31.136\r\n" + "s=-\r\n"
      + "c=IN IP4 95.125.31.136\r\n" + "t=0 0\r\n" + "m=video 52126 RTP/AVP 96 97 98\r\n"
      + "a=rtpmap:96 H264/90000\r\n" + "a=rtpmap:97 MP4V-ES/90000\r\n"
      + "a=rtpmap:98 H263-1998/90000\r\n" + "a=recvonly\r\n" + "b=AS:384\r\n";

  rtpEndpoint.processOffer(requestSdp);
  player.connect(rtpEndpoint, MediaType.VIDEO);
  player.play();

  // just a little bit of time before destroying
  Thread.sleep(2000);
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:20,代码来源:RtpEndpointAsyncTest.java


示例5: testRtpEndpointSimulatingAndroidSdp

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void testRtpEndpointSimulatingAndroidSdp() throws InterruptedException {

  PlayerEndpoint player = new PlayerEndpoint.Builder(pipeline, URL_BARCODES).build();

  String requestSdp = "v=0\r\n" + "o=- 12345 12345 IN IP4 95.125.31.136\r\n" + "s=-\r\n"
      + "c=IN IP4 95.125.31.136\r\n" + "t=0 0\r\n" + "m=video 52126 RTP/AVP 96 97 98\r\n"
      + "a=rtpmap:96 H264/90000\r\n" + "a=rtpmap:97 MP4V-ES/90000\r\n"
      + "a=rtpmap:98 H263-1998/90000\r\n" + "a=recvonly\r\n" + "b=AS:384\r\n";

  player.connect(sdp, MediaType.VIDEO);
  sdp.processOffer(requestSdp);
  player.play();

  // just a little bit of time before destroying
  Thread.sleep(2000);
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:18,代码来源:SdpBaseTest.java


示例6: setFeedUrl

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public void setFeedUrl(String feedUrl) {
  this.feedUrl = feedUrl;

  if (this.playerEndpoint != null) {
    log.debug("Releasing previous elements");
    this.crowdDetectorFilter.release();
    this.playerEndpoint.release();
  }

  log.debug("Creating new elements");

  this.crowdDetectorFilter = new CrowdDetectorFilter.Builder(this.pipe, this.rois).build();
  this.crowdDetectorFilter.setProcessingWidth(640);

  addOrionListeners();

  this.playerEndpoint = new PlayerEndpoint.Builder(this.pipe, this.feedUrl).build();
  addPlayerListeners();
  this.playing = true;

  this.playerEndpoint.connect(this.crowdDetectorFilter);
  this.playerEndpoint.play();

  log.debug("New player is now runing");
  log.debug("Connecting " + this.webRtcEndpoints.size() + " webrtcendpoints");
  // change the feed for all the webrtc clients connected.
  for (Entry<String, WebRtcEndpoint> ep : this.webRtcEndpoints.entrySet()) {
    this.crowdDetectorFilter.connect(ep.getValue());
  }
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:31,代码来源:Pipeline.java


示例7: main

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public static void main(String[] args) throws IOException,
		URISyntaxException, InterruptedException {
	// Connecting to Kurento Server
	KurentoClient kurento = KurentoClient
			.create("ws://localhost:8888/kurento");

	// Creating media pipeline
	MediaPipeline pipeline = kurento.createMediaPipeline();

	// Creating media elements
	PlayerEndpoint player = new PlayerEndpoint.Builder(pipeline,
			"http://files.kurento.org/video/fiwarecut.mp4").build();
	FaceOverlayFilter filter = new FaceOverlayFilter.Builder(pipeline)
			.build();
	filter.setOverlayedImage(
			"http://files.kurento.org/imgs/mario-wings.png", -0.2F, -1.1F,
			1.6F, 1.6F);
	HttpGetEndpoint http = new HttpGetEndpoint.Builder(pipeline).build();

	// Connecting media elements
	player.connect(filter);
	filter.connect(http);

	// Reacting to events
	player.addEndOfStreamListener(new EventListener<EndOfStreamEvent>() {
		@Override
		public void onEvent(EndOfStreamEvent event) {
			System.out.println("The playing has finished");
			System.exit(0);
		}
	});

	// Playing media and opening the default desktop browser
	player.play();
	String videoUrl = http.getUrl();
	Desktop.getDesktop().browse(new URI(videoUrl));

	// Setting a delay to wait the EndOfStream event, previously subscribed
	Thread.sleep(60000);
}
 
开发者ID:Invisibi,项目名称:kurento-tutorial-java,代码行数:41,代码来源:KurentoHttpPlayer.java


示例8: testEventWithoutTag

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void testEventWithoutTag() throws Exception {
  MediaPipeline mp = kurentoClient.createMediaPipeline();
  final CountDownLatch eventReceived = new CountDownLatch(1);

  PlayerEndpoint player =
      new PlayerEndpoint.Builder(mp, "http://" + getTestFilesHttpPath() + "/video/10sec/red.webm")
          .build();

  player.addTag("test_1", "value_1");
  player.addTag("test_2", "value_2");
  player.addTag("test_3", "value_3");

  player.addEndOfStreamListener(new EventListener<EndOfStreamEvent>() {
    @Override
    public void onEvent(EndOfStreamEvent event) {
      List<Tag> tags = event.getTags();

      if (tags.size() == 0) {
        eventReceived.countDown();
      }
    }
  });

  player.play();
  // Guard time to reproduce the whole video
  if (!eventReceived.await(TIMEOUT, TimeUnit.SECONDS)) {
    Assert.fail("Event not received");
  }
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:31,代码来源:EventTagTest.java


示例9: launchBrowser

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
private void launchBrowser(WebRtcEndpoint webRtcEp, PlayerEndpoint playerEp,
    RecorderEndpoint recorderEp) throws InterruptedException {

  getPage().subscribeEvents("playing");
  getPage().initWebRtc(webRtcEp, WebRtcChannel.AUDIO_AND_VIDEO, WebRtcMode.RCV_ONLY);
  playerEp.play();
  final CountDownLatch eosLatch = new CountDownLatch(1);
  playerEp.addEndOfStreamListener(new EventListener<EndOfStreamEvent>() {
    @Override
    public void onEvent(EndOfStreamEvent event) {
      eosLatch.countDown();
    }
  });

  if (recorderEp != null) {
    recorderEp.record();
  }

  // Assertions
  Assert.assertTrue("Not received media (timeout waiting playing event)",
      getPage().waitForEvent("playing"));
  Assert.assertTrue("The color of the video should be black",
      getPage().similarColor(Color.BLACK));
  Assert.assertTrue("Not received EOS event in player",
      eosLatch.await(getPage().getTimeout(), TimeUnit.SECONDS));
  double currentTime = getPage().getCurrentTime();
  Assert.assertTrue(
      "Error in play time (expected: " + PLAYTIME + " sec, real: " + currentTime + " sec)",
      getPage().compare(PLAYTIME, currentTime));
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:31,代码来源:RepositoryRecorderTest.java


示例10: testPlayerMultiplePause

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void testPlayerMultiplePause() throws Exception {
  // Test data
  final String mediaUrl = "http://" + getTestFilesHttpPath() + "/video/60sec/red.webm";
  final Color expectedColor = Color.RED;
  final int playTimeSeconds = 2;
  final int pauseTimeSeconds = 2;
  final int numPauses = 30;

  // Media Pipeline
  MediaPipeline mp = kurentoClient.createMediaPipeline();
  PlayerEndpoint playerEp = new PlayerEndpoint.Builder(mp, mediaUrl).build();
  WebRtcEndpoint webRtcEp = new WebRtcEndpoint.Builder(mp).build();
  playerEp.connect(webRtcEp);

  // WebRTC in receive-only mode
  getPage().subscribeEvents("playing");
  getPage().initWebRtc(webRtcEp, WebRtcChannel.AUDIO_AND_VIDEO, WebRtcMode.RCV_ONLY);
  playerEp.play();
  Assert.assertTrue("Not received media (timeout waiting playing event)",
      getPage().waitForEvent("playing"));

  for (int i = 0; i < numPauses; i++) {
    // Assert color
    Assert.assertTrue("The color of the video should be " + expectedColor,
        getPage().similarColor(expectedColor));

    // Pause and wait
    playerEp.pause();
    Thread.sleep(TimeUnit.SECONDS.toMillis(pauseTimeSeconds));

    // Resume video
    playerEp.play();
    Thread.sleep(TimeUnit.SECONDS.toMillis(playTimeSeconds));
  }

  // Release Media Pipeline
  mp.release();
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:40,代码来源:PlayerMultiplePauseTest.java


示例11: test

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void test() throws InterruptedException {

  // Media Pipeline
  MediaPipeline mp = kurentoClient.createMediaPipeline();

  String videoPath = "file://" + getTestFilesDiskPath() + "/video/filter/barcodes.webm";

  PlayerEndpoint p = new PlayerEndpoint.Builder(mp, videoPath).build();

  final CountDownLatch latch = new CountDownLatch(1);

  p.addErrorListener(new EventListener<ErrorEvent>() {
    @Override
    public void onEvent(ErrorEvent event) {
      log.warn("Error un player: " + event.getDescription());
      latch.countDown();
    }
  });

  p.play();

  if (latch.await(5, TimeUnit.SECONDS)) {
    fail("Player error");
  }

  // Release Media Pipeline
  mp.release();
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:30,代码来源:MetaTestMountedVolumeTest.java


示例12: transactionTest

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void transactionTest() throws InterruptedException, ExecutionException {

  // Pipeline creation (no transaction)
  MediaPipeline pipeline = kurentoClient.createMediaPipeline();

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

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

  player.connect(httpEndpoint);

  String url = httpEndpoint.getUrl();
  // End pipeline creation

  // Explicit transaction
  Transaction tx = pipeline.beginTransaction();
  player.play(tx);
  TFuture<String> fUrl = httpEndpoint.getUrl(tx);
  pipeline.release(tx);
  tx.commit();
  // End explicit transaction

  assertThat(url, is(fUrl.get()));
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:28,代码来源:TransactionTest.java


示例13: creationInTransaction

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void creationInTransaction() throws InterruptedException, ExecutionException {

  // Pipeline creation (transaction)
  Transaction tx1 = kurentoClient.beginTransaction();

  MediaPipeline pipeline = kurentoClient.createMediaPipeline(tx1);

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

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

  player.connect(tx1, httpEndpoint);
  TFuture<String> url1 = httpEndpoint.getUrl(tx1);
  tx1.commit();
  // End pipeline creation

  // Explicit transaction
  Transaction tx2 = pipeline.beginTransaction();
  player.play(tx2);
  TFuture<String> url2 = httpEndpoint.getUrl(tx2);
  pipeline.release(tx2);
  tx2.commit();
  // End explicit transaction

  assertThat(url1.get(), is(url2.get()));
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:30,代码来源:TransactionTest.java


示例14: waitCommitedTest

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@Test
public void waitCommitedTest() throws InterruptedException, ExecutionException {

  // Pipeline creation (transaction)

  Transaction tx = kurentoClient.beginTransaction();

  MediaPipeline pipeline = kurentoClient.createMediaPipeline(tx);

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

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

  player.connect(tx, httpEndpoint);

  final CountDownLatch readyLatch = new CountDownLatch(1);

  new Thread() {
    @Override
    public void run() {
      try {
        player.waitCommited();
        readyLatch.countDown();
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
  }.start();

  assertThat(readyLatch.getCount(), is(1l));

  tx.commit();

  if (!readyLatch.await(5000, TimeUnit.SECONDS)) {
    fail("waitForReady not unblocked in 5s");
  }
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:40,代码来源:TransactionTest.java


示例15: getPlayer

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public PlayerEndpoint getPlayer() {
  return player;
}
 
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:4,代码来源:PlayMediaPipeline.java


示例16: init

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
@PostConstruct
public void init() {

  this.pipe = this.kurento.createMediaPipeline();

  this.rois = new ArrayList<>();
  JsonArray loadedRois;

  JsonObject config = this.configuration.getConfig();

  if (config != null) {
    JsonElement feedUrlJson = config.get("feedUrl");
    if (feedUrlJson != null) {
      this.feedUrl = feedUrlJson.getAsString();
    } else {
      log.debug("Url feed not defined.");
    }

    JsonElement loadedRoisJson = config.get("rois");
    if (loadedRoisJson != null) {
      loadedRois = loadedRoisJson.getAsJsonArray();
      this.rois = readRoisFromJson(loadedRois);
    } else {
      this.rois = getDummyRois();
      log.debug("Rois not defined. Using dummy rois");
    }
  }

  if (this.feedUrl == null) {
    // PlayerEndpoint will be configured later.
    return;
  }

  try {
    this.orionPublisher.registerRoisInOrion(this.rois);
  } catch (OrionConnectorException e) {
    log.warn("Could not register ROIs in ORION");
  }

  this.crowdDetectorFilter = new CrowdDetectorFilter.Builder(this.pipe, this.rois).build();
  this.crowdDetectorFilter.setProcessingWidth(640);

  addOrionListeners();

  this.playerEndpoint = new PlayerEndpoint.Builder(this.pipe, this.feedUrl).build();
  addPlayerListeners();
  this.playing = true;

  this.playerEndpoint.connect(this.crowdDetectorFilter);
  this.playerEndpoint.play();
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:52,代码来源:Pipeline.java


示例17: getPlayerEndpoint

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public PlayerEndpoint getPlayerEndpoint() {
  return this.playerEndpoint;
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:4,代码来源:Pipeline.java


示例18: setPlayer

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public void setPlayer(PlayerEndpoint player) {
  this.player = player;
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:4,代码来源:UserSession.java


示例19: getPlayerEndpoint

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public PlayerEndpoint getPlayerEndpoint() {
  return playerEndpoint;
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:4,代码来源:UserSession.java


示例20: setPlayerEndpoint

import org.kurento.client.PlayerEndpoint; //导入依赖的package包/类
public void setPlayerEndpoint(PlayerEndpoint playerEndpoint) {
  this.playerEndpoint = playerEndpoint;
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:4,代码来源:UserSession.java



注:本文中的org.kurento.client.PlayerEndpoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RxBleClient类代码示例发布时间:2022-05-23
下一篇:
Java AuthFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap