Package com.storedobject.vaadin
Interface MediaCapture
- All Known Implementing Classes:
AudioCapture,VideoCapture
public interface MediaCapture
Interface that defines capturing of streams from devices such as video camera, mic etc.
- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface to be implemented in order to receive data from theMediaCaptureas a stream like audio/video/image etc.static interfaceInterface to implement to receive capturing status changes of aMediaCapture. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSource(com.vaadin.flow.server.StreamResource... resources) Add sources.com.vaadin.flow.shared.RegistrationAdd "status change" listener so that we can monitor recording/previewing status.voidclear()Clear the stream sources attached to this.Get theApplicationto which this is attached.default booleanCheck whether previewing is in progress or not.booleanCheck whether recording is in progress or not.voidsetSource(com.vaadin.flow.server.StreamResource... resources) Set sources.voidstartRecording(MediaCapture.DataReceiver dataReceiver) Start the recording of the media stream to a "data receiver".voidStop / switch off the device (activities such as previewing, recording etc. will be stopped).voidStop the recording of the video stream that may be currently in progress.
-
Method Details
-
getApplication
Application getApplication()Get theApplicationto which this is attached.- Returns:
- The application.
-
startRecording
Start the recording of the media stream to a "data receiver".- Parameters:
dataReceiver- Data receiver to receive the stream
-
isRecording
boolean isRecording()Check whether recording is in progress or not.- Returns:
- True or false.
-
stopRecording
void stopRecording()Stop the recording of the video stream that may be currently in progress. -
isPreviewing
default boolean isPreviewing()Check whether previewing is in progress or not. (Only applicable to certain media such as Video).- Returns:
- True or false.
-
stopDevice
void stopDevice()Stop / switch off the device (activities such as previewing, recording etc. will be stopped). -
addStatusChangeListener
com.vaadin.flow.shared.Registration addStatusChangeListener(MediaCapture.StatusChangeListener listener) Add "status change" listener so that we can monitor recording/previewing status.- Parameters:
listener- Listener to add- Returns:
- Registration that can be used to remove the listener.
-
clear
void clear()Clear the stream sources attached to this. -
setSource
void setSource(com.vaadin.flow.server.StreamResource... resources) Set sources.- Parameters:
resources- Sources to be set
-
addSource
void addSource(com.vaadin.flow.server.StreamResource... resources) Add sources.- Parameters:
resources- Sources to be added
-