@HtmlImport(value="frontend://webapi/video.html") @Tag(value="rap-video") public class Video extends JavascriptTemplate<Video.VideoTemplateModel> implements com.vaadin.flow.component.HasSize
addSource(Source)
method can be used. To add the users device camera the addDeviceCameraVideoSource(boolean, boolean, boolean)
method can be used. You can also take pictures with the takePicture() method.| Modifier and Type | Class and Description |
|---|---|
static interface |
Video.VideoTemplateModel |
| Constructor and Description |
|---|
Video() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeviceCameraVideoSource(boolean withVideo,
boolean useFrontCamera,
boolean withAudio)
Add the users device camera as a source.
|
com.vaadin.flow.shared.Registration |
addPictureConsumer(com.vaadin.flow.function.SerializableConsumer<ImageWrapper> consumer)
Add a consumer for the picture received event triggered by
takePicture(). |
void |
addSource(Source source)
Add a source to the list of sources for the video element.
|
com.vaadin.flow.shared.Registration |
addVideoConsumer(com.vaadin.flow.function.SerializableConsumer<VideoWrapper> consumer)
Add a consumer for the video received event triggered by
stopRecording(). |
List<Source> |
getSources() |
void |
onPictureReceived(elemental.json.JsonString data) |
void |
removeSource(int index)
Remove a source with the given index.
|
void |
setHeight(String height) |
void |
setHeightFull() |
Video |
setSources(List<Source> sources)
Set the list of sources for the video element.
|
void |
setWidth(String width) |
void |
setWidthFull() |
void |
startRecording()
Start recording the current source.
|
void |
stopRecording()
Stop recording the current source and return the result to the consumers added via the
addVideoConsumer(SerializableConsumer) method. |
void |
takePicture()
Grap the current frame displayed in the video element.
|
clearConsumers, notifyConsumers, registerConsumer, registerConsumer, unregisterAllConsumers, unregisterAllConsumersgetModel, getModelType, getModelType, getStateNode, initModel, isSupportedClassaddListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic com.vaadin.flow.shared.Registration addVideoConsumer(com.vaadin.flow.function.SerializableConsumer<VideoWrapper> consumer)
stopRecording(). This consumer will be called
when the video transmition has ended.public com.vaadin.flow.shared.Registration addPictureConsumer(com.vaadin.flow.function.SerializableConsumer<ImageWrapper> consumer)
takePicture(). It will consume the image
received. The result is wrapped in an ImageWrapper that contains convinience methods such as
ImageWrapper.toStreamResource(String)public Video setSources(List<Source> sources)
public void addSource(Source source)
public void addDeviceCameraVideoSource(boolean withVideo,
boolean useFrontCamera,
boolean withAudio)
public void removeSource(@RepeatIndex
int index)
public void startRecording()
public void stopRecording()
addVideoConsumer(SerializableConsumer) method.public void takePicture()
addPictureConsumer(SerializableConsumer) method.public void setWidth(String width)
setWidth in interface com.vaadin.flow.component.HasSizepublic void setWidthFull()
setWidthFull in interface com.vaadin.flow.component.HasSizepublic void setHeight(String height)
setHeight in interface com.vaadin.flow.component.HasSizepublic void setHeightFull()
setHeightFull in interface com.vaadin.flow.component.HasSize@ClientCallable public void onPictureReceived(elemental.json.JsonString data)
Copyright © 2020 XDEV Software Corp.. All rights reserved.