Skip to main content

Camera

Namespace: Wisej.Web.Ext.Camera

Assembly: Wisej.Web.Ext.Camera

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

Instance memberCamera()

Initializes a new instance of the Camera class.

Properties

Instance memberAudio

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

Instance memberBorderStyle

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

Instance memberDeviceName

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

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

Instance memberFacingMode

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

Instance memberHeightCapture

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

Instance memberMirror

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

Instance memberObjectFit

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

See css3_object-fit.

Instance memberVideo

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

Instance memberVideoFilter

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

Instance memberWidthCapture

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

Methods

Instance memberGetDevices(callback)

Returns the names of the available video devices.

ParameterTypeDescription
callbackAction<String[]>Callback method to receive the device names.

Throws:

Instance memberGetDevices(refresh, callback)

Returns the names of the available video devices.

ParameterTypeDescription
refreshBooleanRefreshes the list of devices from the browser.
callbackAction<String[]>Callback method to receive the device names.

Throws:

Instance memberGetDevicesAsync(refresh)

Returns the names of the available video devices.

ParameterTypeDescription
refreshBooleanRefreshes the list of devices from the browser. Default is false.

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

Instance memberGetImage(callback)

Returns the current image from the camera.

ParameterTypeDescription
callbackAction<Image>Callback method to receive the Image or null.

Throws:

Instance memberGetImageAsync()

Returns the current image from the camera asynchronously.

Returns: Task<Image>. An awaitable Task.

Instance memberStartRecording(format, bitsPerSecond, updateInterval)

Starts recording.

ParameterTypeDescription
formatStringThe video encoding mime type format, MIME_types.
bitsPerSecondInt32Audio and video bits per second. MediaRecorder.
updateIntervalInt32Update interval in seconds. The default is zero causing the video to be uploaded on StopRecording.

You must call StopRecordingto end recording.

Instance memberStopRecording()

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

Events

Instance memberError

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

Instance memberProgress

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.

Instance memberUploaded

UploadedEventHandler Fired when the current recording is available for download.