Show:

The ButtonCameraImage class takes photo from camera and inserts it to the content.

Methods

_handleStreamError

(
  • error
)
protected

Displays error message in case of video stream capturing failure.

Parameters:

  • error Event

    The 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 Object

    The 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:

Object:

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.element

    The created img element in editor.