Video

The video is a GUI element with which multimedia files can be displayed. In addition, the camera of the device can be used as video input. This video can also be recorded. Screenshots are also possible.

The video element can be used as follows:

  1. Adding the element

    final Video video = new Video();
    this.add(video);
  2. Register listener for screenshots

    video.addPictureConsumer(pic -> {
      this.add(pic.toImage("Screenshot"));
    });
  3. Create a screenshot

    video.takePicture();

In addition, videos can be recorded:

video.addVideoConsumer(video -> {
  // ...Speichern des videos...
});

// Startet die Aufnahme
video.startRecording();

// Stoppt die Aufnahme und ruft den VideoConsumer auf, wenn das Video an dem Server geliefert wurde.
video.stopRecording();

However, videos can also be loaded from a link:

video.addSource(new Source("link/to/video", "video/mp4"));