use of org.monte.screenrecorder.ScreenRecorder in project selenium_java by sergueik.
the class VideoRecorder method startRecording.
public void startRecording(WebDriver driver) {
try {
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
File dir = new File(RECORD_DIRECTORY);
Point point = driver.manage().window().getPosition();
Dimension dimension = driver.manage().window().getSize();
System.err.println(" Rectangle: " + dimension.width + " " + dimension.height);
Rectangle rectangle = new Rectangle(point.x, point.y, dimension.width, dimension.height);
this.screenRecorder = new ScreenRecorder(gc, rectangle, new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_AVI), new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, DepthKey, 24, FrameRateKey, Rational.valueOf(15), QualityKey, 1.0f, KeyFrameIntervalKey, 15 * 60), new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black", FrameRateKey, Rational.valueOf(30)), null, dir);
this.screenRecorder.start();
} catch (Exception e) {
System.out.println(e);
}
}
Aggregations