java.lang.Object
one.jpro.platform.media.recorder.impl.WebMediaRecorder
- All Implemented Interfaces:
javafx.event.EventTarget,MediaEngine,MediaRecorder,WebMediaEngine
MediaRecorder implementation for the web.- 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.javafx.beans.property.ReadOnlyStringPropertyfinal 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
ConstructorsConstructorDescriptionWebMediaRecorder(com.jpro.webapi.WebAPI webAPI) Creates a new MediaRecorder object. -
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.Gets the value of themimeTypeproperty.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.com.jpro.webapi.JSVariableReturns the video element used to both play and record media on the browser.com.jpro.webapi.WebAPIReturns theWebAPIinstance.booleanisTypeSupported(String mimeType) Returns a boolean which istrueif the MIME type specified is one that this media recorder should be able to successfully record.final javafx.beans.property.ReadOnlyObjectProperty<MediaSource> The current media source for this recorder.javafx.beans.property.ReadOnlyStringPropertyfinal 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.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
-
mimeType
public javafx.beans.property.ReadOnlyStringProperty mimeTypeProperty- See Also:
-
mediaSource
- Specified by:
mediaSourcePropertyin interfaceMediaRecorder- Returns:
- the
mediaSourceproperty - See Also:
-
status
The current status of the MediaRecorder object (inactive, recording, or paused.)- Specified by:
statusPropertyin interfaceMediaRecorder- Returns:
- the
statusproperty - 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- Returns:
- the
onReadyproperty - See Also:
-
onDataAvailable
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onDataAvailableProperty- Specified by:
onDataAvailablePropertyin interfaceMediaRecorder- Returns:
- the
onDataAvailableproperty - See Also:
-
onStart
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onStartProperty- Specified by:
onStartPropertyin interfaceMediaRecorder- Returns:
- the
onStartproperty - See Also:
-
onPaused
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onPausedProperty- Specified by:
onPausedPropertyin interfaceMediaRecorder- Returns:
- the
onPausedproperty - See Also:
-
onResume
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onResumeProperty- Specified by:
onResumePropertyin interfaceMediaRecorder- Returns:
- the
onResumeproperty - See Also:
-
onStopped
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onStoppedProperty- Specified by:
onStoppedPropertyin interfaceMediaRecorder- Returns:
- the
onStoppedproperty - See Also:
-
onError
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaRecorderEvent>> onErrorProperty- Specified by:
onErrorPropertyin interfaceMediaRecorder- Returns:
- the
onErrorproperty - See Also:
-
error
- Specified by:
errorPropertyin interfaceMediaRecorder- Returns:
- the
errorproperty - See Also:
-
-
Constructor Details
-
WebMediaRecorder
public WebMediaRecorder(com.jpro.webapi.WebAPI webAPI) Creates a new MediaRecorder object.- Parameters:
webAPI- JPro WebAPI
-
-
Method Details
-
getWebAPI
public com.jpro.webapi.WebAPI getWebAPI()Description copied from interface:WebMediaEngineReturns theWebAPIinstance.- Specified by:
getWebAPIin interfaceWebMediaEngine- Returns:
- the
WebAPIinstance
-
getVideoElement
public com.jpro.webapi.JSVariable getVideoElement()Description copied from interface:WebMediaEngineReturns the video element used to both play and record media on the browser.- Specified by:
getVideoElementin interfaceWebMediaEngine- Returns:
- the video element as a
JSVariable
-
isTypeSupported
Returns a boolean which istrueif the MIME type specified is one that this media recorder should be able to successfully record.- Parameters:
mimeType- the MIME media type to check- Returns:
trueif this MediaRecorder implementation is capable of recording Blob objects for the specified MIME type. Recording may still fail if there are insufficient resources to support the recording and encoding process. If the value isfalse, the user agent is incapable of recording the specified format.- Throws:
Exception
-
getMimeType
Gets the value of themimeTypeproperty.- Property description:
- Returns:
- the value of the
mimeTypeproperty - See Also:
-
mimeTypeProperty
public javafx.beans.property.ReadOnlyStringProperty mimeTypeProperty()- Returns:
- the
mimeTypeproperty - See Also:
-
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.- Specified by:
enablein interfaceMediaRecorder
-
start
public void start()Description copied from interface:MediaRecorderBegins recording media or resumes recording of media after having been paused.- Specified by:
startin interfaceMediaRecorder
-
pause
public void pause()Description copied from interface:MediaRecorderPauses the recording of media.- Specified by:
pausein interfaceMediaRecorder
-
stop
public void stop()Description copied from interface:MediaRecorderStops the recording of media.- Specified by:
stopin interfaceMediaRecorder
-
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
-