Package one.jpro.platform.media.recorder


package one.jpro.platform.media.recorder

Media recorder via MediaRecorder

The basic steps required to record media are:

  1. Create a MediaRecorder object object by calling MediaRecorder.create(javafx.stage.Stage).
  2. Create a MediaView object by calling MediaView.create(MediaRecorder).
  3. Add the MediaView to the scene graph.
  4. Enable the MediaRecorder by calling MediaRecorder.enable()
  5. Invoke MediaRecorder.start().
  6. Retrieve the MediaSource of the recorded media via MediaRecorder.getMediaSource()
These steps are illustrated by the sample code in the MediaView class documentation. Some things which should be noted are:
  • The MediaRecorder will create the MediaSource object after the recording has started via MediaRecorder.start() and later stopped by calling MediaRecorder.stop().
  • Only one MediaView can be created for a MediaRecorder object.
  • Media may be recorded directly by a MediaRecorder without creating a MediaView although a view is required for display.
  • Enable camera recording on a device by calling MediaRecorder.enable(). This is required to acquire the permission to access the camera on the device
  • If MediaRecorder has been paused, the recording can be resumed by calling MediaRecorder.start().
  • MediaRecorder has few operational states defined by MediaRecorder.Status.
Author:
Besmir Beqiri