java.lang.Object
one.jpro.platform.media.recorder.impl.FXMediaRecorder
- All Implemented Interfaces:
javafx.event.EventTarget,MediaEngine,MediaRecorder
MediaRecorder implementation for the desktop.- Author:
- Besmir Beqiri
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The current duration of the recording since it started.final javafx.beans.property.ReadOnlyObjectProperty<MediaRecorderException> Observable property set to aMediaRecorderExceptionif an error occurs.final javafx.beans.property.ReadOnlyObjectProperty<MediaSource> The current media source for this recorder.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when this recorder delivers media data to the application for its use.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when an error occurs.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when the recorder has paused, and status is set toMediaRecorder.Status.PAUSED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when the status changes toREADY.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when recording has resumed and the status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when the recording started.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when recording stopped and the status changes toMediaRecorder.Status.INACTIVE.final javafx.beans.property.ReadOnlyObjectProperty<MediaRecorder.Status> The current status of the MediaRecorder object (inactive, recording, or paused.) -
Nested Class Summary
Nested classes/interfaces inherited from interface one.jpro.platform.media.recorder.MediaRecorder
MediaRecorder.Status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.event.EventDispatchChainbuildEventDispatchChain(javafx.event.EventDispatchChain tail) javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The current duration of the recording since it started.voidenable()Enable camera stream from the device.final javafx.beans.property.ReadOnlyObjectProperty<MediaRecorderException> Observable property set to aMediaRecorderExceptionif an error occurs.javafx.util.DurationGets the current duration for the recording since it started.final MediaRecorderExceptiongetError()Retrieve the value of theerrorproperty ornullif there is no error.final MediaSourceRetrieves the current media source.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves the event handler when the recording has started and media data is delivered to the application.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves the event handler for errors.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves the event handler when the recording has paused and status is set toMediaRecorder.Status.PAUSED.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves theMediaRecorder.Status.READYevent handler.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves the event handler when recording has resumed and status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves the event handler when the recording has started and status is set toMediaRecorder.Status.RECORDING.final javafx.event.EventHandler<MediaRecorderEvent> Retrieves the event handler when recording is stopped and status changes toMediaRecorder.Status.INACTIVE.final MediaRecorder.StatusRetrieves the current recorder status.final javafx.beans.property.ReadOnlyObjectProperty<MediaSource> The current media source for this recorder.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when this recorder delivers media data to the application for its use.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when an error occurs.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when the recorder has paused, and status is set toMediaRecorder.Status.PAUSED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when the status changes toREADY.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when recording has resumed and the status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when the recording started.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> Event handler invoked when recording stopped and the status changes toMediaRecorder.Status.INACTIVE.voidpause()Pauses the recording of media.voidrelease()Stop the acquisition from the camera and microphone and release all the resources.final voidsetOnDataAvailable(javafx.event.EventHandler<MediaRecorderEvent> value) Sets the event handler when the recording has started and media data is delivered to the application.final voidsetOnError(javafx.event.EventHandler<MediaRecorderEvent> value) Sets the event handler to be called when an error occurs.final voidsetOnPaused(javafx.event.EventHandler<MediaRecorderEvent> value) Sets the event handler when the media recorder has paused and status is set toMediaRecorder.Status.PAUSED.final voidsetOnReady(javafx.event.EventHandler<MediaRecorderEvent> value) Sets theMediaRecorder.Status.READYevent handler.final voidsetOnResume(javafx.event.EventHandler<MediaRecorderEvent> value) Sets the event handler when recording has resumed and status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.final voidsetOnStart(javafx.event.EventHandler<MediaRecorderEvent> value) Sets the event handler when the recording has started and status is set toMediaRecorder.Status.RECORDING.final voidsetOnStopped(javafx.event.EventHandler<MediaRecorderEvent> value) Sets the event handler when recording is stopped and status changes toMediaRecorder.Status.INACTIVE.voidstart()Begins recording media or resumes recording of media after having been paused.final javafx.beans.property.ReadOnlyObjectProperty<MediaRecorder.Status> The current status of the MediaRecorder object (inactive, recording, or paused.)voidstop()Stops the recording of media.
-
Property Details
-
mediaSource
- Specified by:
mediaSourcePropertyin interfaceMediaRecorder- See Also:
-
status
The current status of the MediaRecorder object (inactive, recording, or paused.)- Specified by:
statusPropertyin interfaceMediaRecorder- See Also:
-
duration
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> durationProperty- Specified by:
durationPropertyin interfaceMediaRecorder- Returns:
- the duration of the media
- See Also:
-
onReady
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onReadyProperty- Specified by:
onReadyPropertyin interfaceMediaRecorder- See Also:
-
onDataAvailable
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onDataAvailableProperty- Specified by:
onDataAvailablePropertyin interfaceMediaRecorder- See Also:
-
onStart
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onStartProperty- Specified by:
onStartPropertyin interfaceMediaRecorder- See Also:
-
onPaused
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onPausedProperty- Specified by:
onPausedPropertyin interfaceMediaRecorder- See Also:
-
onResume
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onResumeProperty- Specified by:
onResumePropertyin interfaceMediaRecorder- See Also:
-
onStopped
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onStoppedProperty- Specified by:
onStoppedPropertyin interfaceMediaRecorder- See Also:
-
onError
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onErrorProperty- Specified by:
onErrorPropertyin interfaceMediaRecorder- See Also:
-
error
- Specified by:
errorPropertyin interfaceMediaRecorder- See Also:
-
-
Constructor Details
-
FXMediaRecorder
public FXMediaRecorder()
-
-
Method Details
-
enable
public void enable()Description copied from interface:MediaRecorderEnable camera stream from the device. If this process is successful, then use theMediaView.create(MediaRecorder)method to create the camera view and show it. -
start
public void start()Description copied from interface:MediaRecorderBegins recording media or resumes recording of media after having been paused. -
pause
public void pause()Description copied from interface:MediaRecorderPauses the recording of media. -
stop
public void stop()Description copied from interface:MediaRecorderStops the recording of media. -
release
public void release()Stop the acquisition from the camera and microphone and release all the resources. -
getMediaSource
Description copied from interface:MediaRecorderRetrieves the current media source.- Specified by:
getMediaSourcein interfaceMediaRecorder- Returns:
MediaSourceobject
-
mediaSourceProperty
Description copied from interface:MediaRecorderThe current media source for this recorder.- Specified by:
mediaSourcePropertyin interfaceMediaRecorder- Returns:
- the
mediaSourceproperty - See Also:
-
getStatus
Description copied from interface:MediaRecorderRetrieves the current recorder status.- Specified by:
getStatusin interfaceMediaRecorder- Returns:
- the recorder status
-
statusProperty
The current status of the MediaRecorder object (inactive, recording, or paused.)- Specified by:
statusPropertyin interfaceMediaRecorder- Returns:
- the
statusproperty - See Also:
-
getDuration
public javafx.util.Duration getDuration()Description copied from interface:MediaRecorderGets the current duration for the recording since it started.- Specified by:
getDurationin interfaceMediaRecorder
-
durationProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> durationProperty()Description copied from interface:MediaRecorderThe current duration of the recording since it started. The value will be reset toDuration.ZEROwhen the recording is stopped.- Specified by:
durationPropertyin interfaceMediaRecorder- Returns:
- the
durationproperty - See Also:
-
getOnReady
Description copied from interface:MediaRecorderRetrieves theMediaRecorder.Status.READYevent handler.- Specified by:
getOnReadyin interfaceMediaRecorder- Returns:
- the event handler or
null.
-
setOnReady
Description copied from interface:MediaRecorderSets theMediaRecorder.Status.READYevent handler.- Specified by:
setOnReadyin interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onReadyProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onReadyProperty()Description copied from interface:MediaRecorderEvent handler invoked when the status changes toREADY.- Specified by:
onReadyPropertyin interfaceMediaRecorder- Returns:
- the
onReadyproperty - See Also:
-
getOnDataAvailable
Description copied from interface:MediaRecorderRetrieves the event handler when the recording has started and media data is delivered to the application.- Specified by:
getOnDataAvailablein interfaceMediaRecorder- Returns:
- the event handler or
null.
-
setOnDataAvailable
Description copied from interface:MediaRecorderSets the event handler when the recording has started and media data is delivered to the application.- Specified by:
setOnDataAvailablein interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onDataAvailableProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onDataAvailableProperty()Description copied from interface:MediaRecorderEvent handler invoked when this recorder delivers media data to the application for its use.- Specified by:
onDataAvailablePropertyin interfaceMediaRecorder- Returns:
- the
onDataAvailableproperty - See Also:
-
getOnStart
Description copied from interface:MediaRecorderRetrieves the event handler when the recording has started and status is set toMediaRecorder.Status.RECORDING.- Specified by:
getOnStartin interfaceMediaRecorder- Returns:
- the event handler or
null.
-
setOnStart
Description copied from interface:MediaRecorderSets the event handler when the recording has started and status is set toMediaRecorder.Status.RECORDING.- Specified by:
setOnStartin interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onStartProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onStartProperty()Description copied from interface:MediaRecorderEvent handler invoked when the recording started.- Specified by:
onStartPropertyin interfaceMediaRecorder- Returns:
- the
onStartproperty - See Also:
-
getOnPaused
Description copied from interface:MediaRecorderRetrieves the event handler when the recording has paused and status is set toMediaRecorder.Status.PAUSED.- Specified by:
getOnPausedin interfaceMediaRecorder- Returns:
- the event handler or
null.
-
setOnPaused
Description copied from interface:MediaRecorderSets the event handler when the media recorder has paused and status is set toMediaRecorder.Status.PAUSED.- Specified by:
setOnPausedin interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onPausedProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onPausedProperty()Description copied from interface:MediaRecorderEvent handler invoked when the recorder has paused, and status is set toMediaRecorder.Status.PAUSED.- Specified by:
onPausedPropertyin interfaceMediaRecorder- Returns:
- the
onPausedproperty - See Also:
-
getOnResume
Description copied from interface:MediaRecorderRetrieves the event handler when recording has resumed and status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.- Specified by:
getOnResumein interfaceMediaRecorder- Returns:
- the event handler or
null.
-
setOnResume
Description copied from interface:MediaRecorderSets the event handler when recording has resumed and status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.- Specified by:
setOnResumein interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onResumeProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onResumeProperty()Description copied from interface:MediaRecorderEvent handler invoked when recording has resumed and the status changes toMediaRecorder.Status.RECORDINGafter previously was set toMediaRecorder.Status.PAUSED.- Specified by:
onResumePropertyin interfaceMediaRecorder- Returns:
- the
onResumeproperty - See Also:
-
getOnStopped
Description copied from interface:MediaRecorderRetrieves the event handler when recording is stopped and status changes toMediaRecorder.Status.INACTIVE.- Specified by:
getOnStoppedin interfaceMediaRecorder- Returns:
- the event handler or
null.
-
setOnStopped
Description copied from interface:MediaRecorderSets the event handler when recording is stopped and status changes toMediaRecorder.Status.INACTIVE.- Specified by:
setOnStoppedin interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onStoppedProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onStoppedProperty()Description copied from interface:MediaRecorderEvent handler invoked when recording stopped and the status changes toMediaRecorder.Status.INACTIVE.- Specified by:
onStoppedPropertyin interfaceMediaRecorder- Returns:
- the
onStoppedproperty - See Also:
-
getOnError
Description copied from interface:MediaRecorderRetrieves the event handler for errors.- Specified by:
getOnErrorin interfaceMediaRecorder- Returns:
- the event handler.
-
setOnError
Description copied from interface:MediaRecorderSets the event handler to be called when an error occurs.- Specified by:
setOnErrorin interfaceMediaRecorder- Parameters:
value- the event handler ornull.
-
onErrorProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onErrorProperty()Description copied from interface:MediaRecorderEvent handler invoked when an error occurs.- Specified by:
onErrorPropertyin interfaceMediaRecorder- Returns:
- the
onErrorproperty - See Also:
-
getError
Description copied from interface:MediaRecorderRetrieve the value of theerrorproperty ornullif there is no error.- Specified by:
getErrorin interfaceMediaRecorder- Returns:
- a
MediaRecorderExceptionornull.
-
errorProperty
Description copied from interface:MediaRecorderObservable property set to aMediaRecorderExceptionif an error occurs.- Specified by:
errorPropertyin interfaceMediaRecorder- Returns:
- the
errorproperty - See Also:
-
buildEventDispatchChain
public final javafx.event.EventDispatchChain buildEventDispatchChain(javafx.event.EventDispatchChain tail) - Specified by:
buildEventDispatchChainin interfacejavafx.event.EventTarget
-