Show: Inherited Protected Private Deprecated

# ButtonCameraImage Class

Defined in: `src/ui/react/src/components/buttons/button-camera-image.jsx:4`

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

## Index

### Methods

- _handleStreamError
- _handleStreamSuccess
- componentDidMount
- componentWillUnmount
- getDefaultProps
- render
- takePhoto

### Properties

- key static

### Events

- imageCameraAdd

## Methods

### `_handleStreamError`

(

- `error`

)
protected

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:124`

Displays error message in case of video stream capturing failure.

#### Parameters:

- `error` Event

  The fired event in case of error.

### `_handleStreamSuccess`

(

- `stream`

)

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:135`

Starts streaming video in the video element and sets width/height to the video and canvas elements.

#### Parameters:

- `stream` Object

  The video stream

### `componentDidMount`

()

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:33`

Lifecycle. Invoked once, only on the client, immediately after the initial rendering occurs.

Focuses the take photo button.

### `componentWillUnmount`

()

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:44`

Lifecycle. Invoked immediately before a component is unmounted from the DOM.

### `getDefaultProps`

()

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:22`

Lifecycle. Returns the default values of the properties used in the widget.

### `render`

() Object

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:62`

Lifecycle. Renders the UI of the button.

#### Returns:

Object:

The content which should be rendered.

### `takePhoto`

()

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:88`

Takes photo from the video stream and inserts in into editor's content.

## Properties

### `key`

String static

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:12`

The name which will be used as an alias of the button in the configuration.

Default: cameraImage

## Events

### `imageCameraAdd`

Defined in `src/ui/react/src/components/buttons/button-camera-image.jsx:174`

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.