"http://files.kurento.org/video/10sec/green.webm").build();
PlayerEndpoint playerBlue = mp.newPlayerEndpoint(
"http://files.kurento.org/video/10sec/blue.webm").build();
HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
.build();
RecorderEndpoint recorderEP = mp.newRecorderEndpoint(
FILE_SCHEMA + getDefaultFileForRecording()).build();
try (BrowserClient browser = new BrowserClient.Builder()
.browser(browserType).client(Client.PLAYER).build()) {
browser.setURL(httpEP.getUrl());
// red
playerRed.connect(httpEP);
playerRed.connect(recorderEP);
playerRed.play();
recorderEP.record();
browser.subscribeEvents("playing", "ended");
browser.start();
Assert.assertTrue("Timeout waiting playing event",
browser.waitForEvent("playing"));
Thread.sleep(2000);
// green
playerGreen.connect(httpEP);
playerGreen.connect(recorderEP);
playerGreen.play();
Thread.sleep(6000);
// blue
playerBlue.connect(httpEP);
playerBlue.connect(recorderEP);
playerBlue.play();
Thread.sleep(6000);
// Assertions
Assert.assertTrue("Timeout waiting ended event",
browser.waitForEvent("ended"));
Assert.assertTrue("Play time must be at least " + PLAYTIME
+ " seconds", browser.getCurrentTime() >= PLAYTIME);
}
// Stop and release media elements
recorderEP.stop();
playerRed.stop();
playerGreen.stop();
playerBlue.stop();
recorderEP.release();
playerRed.release();
playerGreen.release();
playerBlue.release();
// Media Pipeline #2