Interface ICamera
-
- All Superinterfaces:
IAnyGroup<ICamera>,IComponent<ICamera>,IHtmlBasedComponent<ICamera>,IXulElement<ICamera>
public interface ICamera extends IXulElement<ICamera>, IAnyGroup<ICamera>
ImmutableCameracomponentThe Camera component is used to record videos and take snapshots in the browser.
Support @Action
Name Action Type onVideoUpload ActionData: FileData
Notifies after the video has been uploaded.onSnapshotUpload ActionData: FileData
Notifies after the snapshot has been uploaded.onMaxsizeExceed Notifies if the recorded size is bigger than the max size. onLengthLimitExceed Notifies if the recorded length exceeds the max length. onStateChange ActionData: StateChangeData
Notifies when invoking start(), stop(), pause() or resume().onCameraUnavailable ActionData: DOMExceptionData
Notifies if camera is unavailable after requesting media devices from user.- Author:
- katherine
- See Also:
Camera
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classICamera.BuilderBuilds instances of typeICamera.static classICamera.UpdaterBuilds an updater of typeICameraforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>getConstraints()Returns the constraints.default intgetLengthLimit()Returns the maximum record length limit, unit is "seconds".default intgetMaxsize()Returns the max size setting of upload video and snapshot, unit is "KB".java.lang.StringgetRecordFormat()Returns the record video format, e.g.,"video/webm","video/mp4", and"video/ogg".java.lang.StringgetSnapshotFormat()Returns the snapshot image format, e.g., image/png, image/jpeg.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisAudio()Return whether to record sound while recording video.default booleanisPreviewRecord()Returns whether the preview screen is on.static ICameraofId(java.lang.String id)Returns the instance with the given id.static ICameraofSize(java.lang.String width, java.lang.String height)Returns the instance with the given size, width and heightICamerawithAudio(boolean audio)Returns a copy ofthisimmutable component with the specifiedaudio.ICamerawithConstraints(java.util.Map<java.lang.String,? extends java.lang.Object> constraints)Returns a copy ofthisimmutable component with the specifiedconstraints.ICamerawithLengthLimit(int lengthLimit)Returns a copy ofthisimmutable component with the specifiedlengthLimit.ICamerawithMaxsize(int maxsize)Returns a copy ofthisimmutable component with the specifiedmaxsize.ICamerawithPreviewRecord(boolean previewRecord)Returns a copy ofthisimmutable component with the specifiedpreviewRecord.ICamerawithRecordFormat(java.lang.String recordFormat)Returns a copy ofthisimmutable component with the specifiedrecordFormat.ICamerawithSnapshotFormat(java.lang.String snapshotFormat)Returns a copy ofthisimmutable component with the specifiedsnapshotFormat.-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final ICamera DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zkmax.med.Camera"- Specified by:
getWidgetClassin interfaceIComponent<ICamera>
-
getSnapshotFormat
@Nullable java.lang.String getSnapshotFormat()
Returns the snapshot image format, e.g., image/png, image/jpeg. If the requested type is invalid or unspecified, it will use image/png.Default:
null.
-
withSnapshotFormat
ICamera withSnapshotFormat(@Nullable java.lang.String snapshotFormat)
Returns a copy ofthisimmutable component with the specifiedsnapshotFormat.Sets the snapshot image format, e.g.,
"image/png","image/jpeg". If the requested type is invalid or unspecified, it will use"image/png".- Parameters:
snapshotFormat- The snapshot image formatDefault:
null.- Returns:
- A modified copy of the
thisobject
-
getRecordFormat
@Nullable java.lang.String getRecordFormat()
Returns the record video format, e.g.,"video/webm","video/mp4", and"video/ogg". If the requested type is invalid or unspecified, it will use"video/webm".Default:
null.
-
withRecordFormat
ICamera withRecordFormat(@Nullable java.lang.String recordFormat)
Returns a copy ofthisimmutable component with the specifiedrecordFormat.Sets the record video format, e.g.,
"video/webm","video/mp4", and"video/ogg". If the requested type is invalid or unspecified, it will use"video/webm"- Parameters:
recordFormat- The record video formatDefault:
null.- Returns:
- A modified copy of the
thisobject
-
getConstraints
@Nullable java.util.Map<java.lang.String,java.lang.Object> getConstraints()
Returns the constraints. About allowed constraints setting, see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraintsDefault:
null.
-
withConstraints
ICamera withConstraints(@Nullable java.util.Map<java.lang.String,? extends java.lang.Object> constraints)
Returns a copy ofthisimmutable component with the specifiedconstraints.Sets the constraints. About allowed constraints setting, see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints
- Parameters:
constraints- The constraintsDefault:
null.- Returns:
- A modified copy of the
thisobject
-
getMaxsize
default int getMaxsize()
Returns the max size setting of upload video and snapshot, unit is "KB". Refer towithMaxsize(int)for more details.Default:
Configuration.getMaxUploadSize()
-
withMaxsize
ICamera withMaxsize(int maxsize)
Returns a copy ofthisimmutable component with the specifiedmaxsize.Sets the max size of upload video and snapshot, unit is "KB". Notice: Both video and snapshot files must smaller than max size, or nothing will upload.
- Parameters:
maxsize- The max size of upload video and snapshot, unit is "KB"Default:
Configuration.getMaxUploadSize().- Returns:
- A modified copy of the
thisobject
-
isAudio
default boolean isAudio()
Return whether to record sound while recording video.Default:
true
-
withAudio
ICamera withAudio(boolean audio)
Returns a copy ofthisimmutable component with the specifiedaudio.Sets whether to record sound while recording video.
- Parameters:
audio- Whether to record sound while recording video.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isPreviewRecord
default boolean isPreviewRecord()
Returns whether the preview screen is on. If you want to take a snapshot, must turn on preview screen, or nothing will happen.Default:
true
-
withPreviewRecord
ICamera withPreviewRecord(boolean previewRecord)
Returns a copy ofthisimmutable component with the specifiedpreviewRecord.Sets whether the preview screen is on. If you want to take a snapshot, must turn on preview screen, or nothing will happen.
- Parameters:
previewRecord- Whether the preview screen is on.Default:
true.- Returns:
- A modified copy of the
thisobject
-
getLengthLimit
default int getLengthLimit()
Returns the maximum record length limit, unit is "seconds". If recording seconds exceed length limit, recording will stop immediately.Default:
60
-
withLengthLimit
ICamera withLengthLimit(int lengthLimit)
Returns a copy ofthisimmutable component with the specifiedlengthLimit.Sets the maximum record length limit, unit is "seconds". If recording seconds exceed length limit, recording will stop immediately.
- Parameters:
lengthLimit- The maximum record length limit, unit is "seconds".Default:
60.- Returns:
- A modified copy of the
thisobject
-
ofSize
static ICamera ofSize(java.lang.String width, java.lang.String height)
Returns the instance with the given size, width and height- Parameters:
width- The width of the componentheight- The height of the component
-
ofId
static ICamera ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component.
-
-