ButtonCameraImage Class
The ButtonCameraImage class takes photo from camera and inserts it to the content.
Methods
_handleStreamError
-
error
Displays error message in case of video stream capturing failure.
Parameters:
-
error
EventThe fired event in case of error.
_handleStreamSuccess
-
stream
Starts streaming video in the video element and sets width/height to the video and canvas elements.
Parameters:
-
stream
ObjectThe video stream
componentDidMount
()
Lifecycle. Invoked once, only on the client, immediately after the initial rendering occurs.
Focuses the take photo button.
componentWillUnmount
()
Lifecycle. Invoked immediately before a component is unmounted from the DOM.
getDefaultProps
()
Lifecycle. Returns the default values of the properties used in the widget.
render
()
Object
Lifecycle. Renders the UI of the button.
Returns:
The content which should be rendered.
takePhoto
()
Takes photo from the video stream and inserts in into editor's content.
Properties
key
String
static
The name which will be used as an alias of the button in the configuration.
Default: cameraImage
Events
imageCameraAdd
Fired when an image is being taken from the camera and added as an element to the editor.
Event Payload:
-
el
CKEDITOR.dom.elementThe created img element in editor.