public class Camera extends Widget
Only works for browsers supporting HTML5 video tag
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
Modifier and Type | Method and Description |
---|---|
void |
countRecordTime()
Compare record time and record length limit,
if record time equals record length limit, fire LengthLimitExceed event.
|
String |
getConstraints()
Returns the constraints in JSON format String,
About allowed constraints setting,
see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints
Default: null.
|
int |
getLengthLimit()
Get the maximum record length limit, unit is "seconds".
|
int |
getMaxsize()
Get the max size setting of upload video and snapshot, unit is "KB".
|
String |
getRecordFormat()
Get the record video format, e.g., video/webm, video/mp4, video/ogg.
|
String |
getSnapshotFormat()
Get the snapshot image format, e.g., image/png, image/jpeg.
|
boolean |
isAudio()
Return whether to record sound while recording video.
|
void |
isMaxsizeExceed()
Compare record size and max size limit,
if record size bigger than max size limit, fire MaxsizeExceed event.
|
boolean |
isPreviewRecord()
Return whether the preview screen is on.
|
boolean |
isRecording()
Return whether camera is recording.
|
void |
pause()
Pause recording.
|
void |
requestCamera()
Ask user for permissions to get media stream from camera and microphone,
after permission is granted, init the video stream and preview screen according to the previewRecord attribute.
|
void |
resume()
Resume recording.
|
void |
setAudio(boolean audio)
Set whether to record sound while recording video.
|
void |
setConstraints(String constraints)
Sets the constraints in JSON format String,
if not specify constraints, it will use {audio: this.isAudio(), video: true}.
|
void |
setLengthLimit(int lengthLimit)
Set the maximum record length limit, unit is "seconds".
|
void |
setMaxsize(int maxsize)
Set the max size of upload video and snapshot, unit is "KB".
|
void |
setPreviewRecord(boolean previewRecord)
Set whether the preview screen is on.
|
void |
setRecordFormat(String recordFormat)
Set the record video format, e.g., video/webm, video/mp4, video/ogg.
|
void |
setRecording(boolean recording)
setRecording(true) means start or resume recording.
|
void |
setSnapshotFormat(String snapshotFormat)
Set the snapshot image format, e.g., image/png, image/jpeg.
|
void |
snapshot()
Take a snapshot.
|
void |
start()
Start recording.
|
void |
stop()
Stop recording.
|
void |
stopStreaming()
Stop getting media stream from user's camera and microphone.
|
void |
upload()
Upload a blob data and fire an event according to eventName.
|
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
$, $f, $f, $f, $init, $n, $n, $o, $s, $service, afterAnima_, afterParentChanged_, appendChild, appendChild, beforeParentChanged_, beforeSendAU_, bind_, bind, bindChildren_, bindDoubleTap_, bindMissingAncestors, bindSwipe_, bindTapHold_, canActivate, cleanDrag_, clear, clearCache, cloneDrag_, deferRedraw_, deferRedrawHTML_, detach, doBlur_, doClick_, doDoubleClick_, doFocus_, doKeyDown_, doKeyPress_, doKeyUp_, domAttrs_, domClass_, domListen_, doMouseDown_, doMouseMove_, doMouseOut_, doMouseOver_, doMouseUp_, domStyle_, domTextStyleAttr_, domTooltiptext_, domUnlisten_, doPaste_, doResizeScroll_, doRightClick_, doSelect_, doSwipe_, doTooltipOut_, doTooltipOver_, dropEffect_, extraBind_, fire, fireX, focus_, focus, forcerender, fromPageCoord, get, getAction, getCaveNode, getChildAt, getChildIndex, getClass, getCssflex, getDraggable, getDragMessage_, getDragNode, getDragOptions_, getDrop_, getDroppable, getElementsById, getElementsByName, getFirstNode_, getFloatZIndex_, getHeight, getHflex, getId, getLeft, getMold, getOldWidget_, getPage, getRenderdefer, getSclass, getScrollLeft, getScrollTop, getStyle, getTabindex, getTextNode, getTooltiptext, getTop, getTopWidget, getVflex, getWidth, getZclass, getZIndex, hide, ignoreDescendantFloatUp_, ignoreDrag_, initDrag_, insertBefore, insertChildHTML_, isAutoId, isBinding, isFloating_, isListen, isRealElement, isRealVisible, isRealVisible, isVisible, isVisible, isWatchable_, listen, listenOnFitSize_, mimicMouseDown_, newInstance, nextUuid, onAfterSize, onChildAdded_, onChildRemoved_, onChildRenderDefer_, onChildReplaced_, onChildVisible_, onDrop_, redraw, redrawHTML_, register, removeChild, removeChild, removeChildHTML_, removeHTML_, replaceCavedChildren_, replaceChildHTML_, replaceHTML, replaceWidget, rerender, rerender, rerenderLater_, rerenderNow_, scrollIntoView, sendAU_, set, set, setAction, setChildren, setCssflex, setDomVisible_, setDraggable, setDroppable, setFloating_, setFloatZIndex_, setHeight, setHflex, setId, setLeft, setListener, setListener, setListeners, setMold, setRenderdefer, setSclass, setScrollLeft, setScrollTop, setStyle, setTabindex, setTooltiptext, setTop, setTopmost, setVflex, setVisible, setWidth, setZclass, setZIndex, shallChildROD_, shallFireSizedLaterWhenAddChd_, shallIgnoreClick_, show, smartUpdate, unbind_, unbind, unbindChildren_, unbindDoubleTap_, unbindSwipe_, unbindTapHold_, uncloneDrag_, unlisten, unlistenOnFitSize_, updateDomClass_, updateDomStyle_, uuid, zsync
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy
public void setPreviewRecord(boolean previewRecord)
previewRecord
- public boolean isPreviewRecord()
Default: true
public void setMaxsize(int maxsize)
maxsize
- public int getMaxsize()
public void setAudio(boolean audio)
audio
- public boolean isAudio()
Default: true
public void setLengthLimit(int lengthLimit)
lengthLimit
- public int getLengthLimit()
Default: 60
public void setSnapshotFormat(String snapshotFormat)
snapshotFormat
- public String getSnapshotFormat()
Default: null.
public void setRecordFormat(String recordFormat)
recordFormat
- public String getRecordFormat()
Default: null.
public void setRecording(boolean recording)
recording
- public boolean isRecording()
public void setConstraints(String constraints)
constraints
- constraints in JSON format Stringpublic String getConstraints()
public void start()
public void requestCamera()
public void stopStreaming()
public void stop()
public void pause()
public void resume()
public void countRecordTime()
public void snapshot()
public void isMaxsizeExceed()
public void upload()
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.