Package com.storedobject.vaadin
Class AudioCapture
java.lang.Object
com.vaadin.flow.component.Component
com.storedobject.vaadin.Media
com.storedobject.vaadin.Audio
com.storedobject.vaadin.AudioCapture
- All Implemented Interfaces:
HasSize,MediaCapture,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
A special
Audio class that gets input from the client Computer's mic. The audio stream from the
mic can be streamed to the server and saved.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.vaadin.MediaCapture
MediaCapture.DataReceiver, MediaCapture.StatusChangeListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationAdd "status change" listener so that we can monitor recording status.Get theApplicationto which this is attached.booleanCheck whether recording is in progress or not.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) voidstartRecording(MediaCapture.DataReceiver dataReceiver) Start the recording of the audio stream to a "data receiver".voidStop / switch off the mic (activities such as recording etc. will be stopped).voidStop the recording of the audio stream that may be currently in progress.Methods inherited from class com.storedobject.vaadin.Media
addSource, addSource, clear, setSource, setSource, showControlsMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.storedobject.vaadin.MediaCapture
addSource, clear, isPreviewing, setSource
-
Constructor Details
-
AudioCapture
public AudioCapture()Constructor.
-
-
Method Details
-
onAttach
-
onDetach
-
getApplication
Get theApplicationto which this is attached.- Specified by:
getApplicationin interfaceMediaCapture- Returns:
- The application.
-
startRecording
Start the recording of the audio stream to a "data receiver".- Specified by:
startRecordingin interfaceMediaCapture- Parameters:
dataReceiver- Data receiver to receive the audio stream
-
isRecording
public boolean isRecording()Check whether recording is in progress or not.- Specified by:
isRecordingin interfaceMediaCapture- Returns:
- True or false.
-
stopRecording
public void stopRecording()Stop the recording of the audio stream that may be currently in progress.- Specified by:
stopRecordingin interfaceMediaCapture
-
stopDevice
public void stopDevice()Stop / switch off the mic (activities such as recording etc. will be stopped).- Specified by:
stopDevicein interfaceMediaCapture
-
addStatusChangeListener
public com.vaadin.flow.shared.Registration addStatusChangeListener(MediaCapture.StatusChangeListener listener) Add "status change" listener so that we can monitor recording status.- Specified by:
addStatusChangeListenerin interfaceMediaCapture- Parameters:
listener- Listener to add- Returns:
- Registration that can be used to remove the listener.
-