Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.PlayerEndpoint


    EventListener.addEvent();

    MediaPipelineFactory mpf = contentSession.getMediaPipelineFactory();
    MediaPipeline mp = mpf.create();
    contentSession.releaseOnTerminate(mp);
    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint("").build();
    contentSession.setAttribute("player", playerEndpoint);
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerEndpoint.connect(httpEP);
    contentSession.start(httpEP);
  }
View Full Code Here


  @Override
  public void onContentStarted(HttpPlayerSession contentSession)
      throws Exception {
    EventListener.addEvent();
    PlayerEndpoint playerEndpoint = (PlayerEndpoint) contentSession
        .getAttribute("player");
    playerEndpoint.play();
  }
View Full Code Here

    @Override
    public void onContentRequest(WebRtcContentSession session)
        throws Exception {
      MediaPipeline mp = session.getMediaPipelineFactory().create();
      session.releaseOnTerminate(mp);
      PlayerEndpoint playerEP = mp.newPlayerEndpoint(
          "http://files.kurento.org/video/sintel.webm").build();
      WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
      playerEP.connect(webRtcEndpoint);
      playerEP.play();
      session.start(webRtcEndpoint);

      terminateLatch = new CountDownLatch(1);
    }
View Full Code Here

    recorderEP.stop();
    webRtcEP.release();
    recorderEP.release();

    // Media Pipeline #2
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        FILE_SCHEMA + getDefaultFileForRecording()).build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerEP.connect(httpEP);

    // Test execution #2. Play the recorded video
    try (BrowserClient browser = new BrowserClient.Builder()
        .browser(browserType).client(Client.PLAYER).build()) {
      browser.setURL(httpEP.getUrl());
      browser.subscribeEvents("playing", "ended");
      playerEP.play();
      browser.start();

      // Assertions
      Assert.assertTrue("Timeout waiting playing event",
          browser.waitForEvent("playing"));
View Full Code Here

    EventListener.addEvent();

    MediaPipelineFactory mpf = contentSession.getMediaPipelineFactory();
    MediaPipeline mp = mpf.create();
    contentSession.releaseOnTerminate(mp);
    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(
        VideoURLs.map.get("webm")).build();
    contentSession.setAttribute("player", playerEndpoint);
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerEndpoint.connect(httpEP);
    contentSession.start(httpEP);
  }
View Full Code Here

  @Override
  public void onContentStarted(HttpPlayerSession contentSession)
      throws Exception {
    EventListener.addEvent();

    PlayerEndpoint playerEndpoint = (PlayerEndpoint) contentSession
        .getAttribute("player");
    playerEndpoint.play();

    Thread.sleep(5000);
    playerEndpoint.release();
  }
View Full Code Here

  public void doTest(Browser browserType) throws Exception {
    // Media Pipeline
    MediaPipeline mp = pipelineFactory.create();

    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/30sec/red.webm").build();
    WebRtcEndpoint webRtcEP = mp.newWebRtcEndpoint().build();

    Dispatcher dispatcher = mp.newDispatcher().build();
    HubPort hubPort1 = dispatcher.newHubPort().build();
    HubPort hubPort2 = dispatcher.newHubPort().build();

    playerEP.connect(hubPort1);
    hubPort2.connect(webRtcEP);

    dispatcher.connect(hubPort1, hubPort2);
    playerEP.play();

    // Test execution
    try (BrowserClient browser = new BrowserClient.Builder()
        .browser(browserType).client(Client.WEBRTC).build()) {
View Full Code Here

  @Test
  public void testPlayer() throws Exception {
    // Media Pipeline
    MediaPipeline mp = pipelineFactory.create();
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/small.webm").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerEP.connect(httpEP);
    playerEP.play();

    // Test execution
    HttpClient client = HttpClientBuilder.create().build();
    HttpGet httpGet = new HttpGet(httpEP.getUrl());
    HttpResponse response = client.execute(httpGet);
View Full Code Here

  @Override
  public void onContentStarted(HttpPlayerSession contentSession)
      throws Exception {
    EventListener.addEvent();
    if (contentSession.getAttribute("player") != null) {
      PlayerEndpoint playerEndpoint = (PlayerEndpoint) contentSession
          .getAttribute("player");
      playerEndpoint.play();
    }
    super.onContentStarted(contentSession);
  }
View Full Code Here

public class BasicPipelineTest extends MediaPipelineBaseTest {

  @Test
  public void basicPipelineTest() {

    PlayerEndpoint player = pipeline.newPlayerEndpoint(
        "http://files.kurento.org/video/small.webm").build();

    HttpGetEndpoint httpGetEndpoint = pipeline.newHttpGetEndpoint().build();

    player.connect(httpGetEndpoint);

    String url = httpGetEndpoint.getUrl();

    player.release();

    Assert.assertNotSame("The URL shouldn't be empty", "", url);
  }
View Full Code Here

TOP

Related Classes of com.kurento.kmf.media.PlayerEndpoint

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.