Camera

Wisej.Web.Ext.Camera.Camera

Namespace: Wisej.Web.Ext.Camera

Assembly: Wisej.Web.Ext.Camera (3.2.0.0)

The Camera component makes it possible to take pictures with the device's camera and upload them to the server.

public class Camera : Control, IWisejHandler

Constructors

Camera()

Initializes a new instance of the Camera class.

Properties

Audio

Boolean: Specifies whether audio should be recorded. (Default: False)

BorderStyle

BorderStyle: Indicates the border style for the control. (Default: Solid)

DeviceName

String: Specifies the video device to use. (Default: "")

If not specified or invalid it will use the first device returned by the browser.

FacingMode

VideoFacingMode: Specifies whether the video is front-facing (mobile-only). (Default: True)

HeightCapture

Int32: Video capture resolution - Height (Default: True)

Mirror

Boolean: Specifies whether the media should be mirrored. (Default: False)

ObjectFit

ObjectFit: Specifies the object-fit to apply to the video. (Default: True)

See css3_object-fit.

Video

Boolean: Specifies whether video should be recorded. (Default: True)

VideoFilter

String: Returns or sets the filter (filter) to apply to the video. (Default: null)

WidthCapture

Int32: Video capture resolution - Width (Default: True)

Methods

GetDevices(callback)

Returns the names of the available video devices.

Parameter
Type
Description

callback

Callback method to receive the device names.

Throws:

GetDevices(refresh, callback)

Returns the names of the available video devices.

Parameter
Type
Description

refresh

Refreshes the list of devices from the browser.

callback

Callback method to receive the device names.

Throws:

GetDevicesAsync(refresh)

Returns the names of the available video devices.

Parameter
Type
Description

refresh

Refreshes the list of devices from the browser. Default is false.

Returns: Task<String[]>. An awaitable Task.

GetImage(callback)

Returns the current image from the camera.

Parameter
Type
Description

callback

Callback method to receive the Image or null.

Throws:

GetImageAsync()

Returns the current image from the camera asynchronously.

Returns: Task<Image>. An awaitable Task.

StartRecording(format, bitsPerSecond, updateInterval)

Starts recording.

Parameter
Type
Description

format

The video encoding mime type format, MIME_types.

bitsPerSecond

Audio and video bits per second. MediaRecorder.

updateInterval

Update interval in seconds. The default is zero causing the video to be uploaded on StopRecording.

You must call StopRecordingto end recording.

StopRecording()

Stops recording and uploads the recorded stream to the Uploaded event.

Events

Error

CameraErrorHandler Fired when an error occurs in the camera setup or usage.

Progress

UploadProgressEventHandler Fired while the Camera control receives the recording stream being uploaded.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Uploaded

UploadedEventHandler Fired when the current recording is available for download.

Last updated

Was this helpful?