Module one.jpro.platform.media
Package one.jpro.platform.media.recorder
package one.jpro.platform.media.recorder
Media recorder via MediaRecorder
The basic steps required to record media are:
- Create a
MediaRecorderobject object by callingMediaRecorder.create(javafx.stage.Stage). - Create a
MediaViewobject by callingMediaView.create(MediaRecorder). - Add the
MediaViewto the scene graph. - Enable the
MediaRecorderby callingMediaRecorder.enable() - Invoke
MediaRecorder.start(). - Retrieve the
MediaSourceof the recorded media viaMediaRecorder.getMediaSource()
MediaView class documentation.
Some things which should be noted are:
- The
MediaRecorderwill create theMediaSourceobject after the recording has started viaMediaRecorder.start()and later stopped by callingMediaRecorder.stop(). - Only one
MediaViewcan be created for aMediaRecorderobject. - Media may be recorded directly by a
MediaRecorderwithout creating aMediaViewalthough 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
MediaRecorderhas been paused, the recording can be resumed by callingMediaRecorder.start(). MediaRecorderhas few operational states defined byMediaRecorder.Status.
- Author:
- Besmir Beqiri
-
ClassDescriptionThe MediaRecorder provides functionality to easily record media, both on desktop/mobile and web platforms.Media recorder status.Media recorder exception.