Skip to content

@camera.ui/sdk / camera / CameraSource

Interface: CameraSource

Defined in: camera/device.ts:15

Camera source with snapshot and probe capabilities.

Extends

Extended by

Properties

_id

readonly _id: string

Defined in: camera/config.ts:12

Unique source ID

Inherited from

CameraInput._id


childSourceId?

optional childSourceId?: string

Defined in: camera/config.ts:26

Child source ID (for snapshot fallback)

Inherited from

CameraInput.childSourceId


hotMode

hotMode: boolean

Defined in: camera/config.ts:20

Keep connection always active

Inherited from

CameraInput.hotMode


name

name: string

Defined in: camera/config.ts:14

Source display name

Inherited from

CameraInput.name


preload

preload: boolean

Defined in: camera/config.ts:22

Preload stream on startup

Inherited from

CameraInput.preload


role

role: CameraRole

Defined in: camera/config.ts:16

Resolution role

Inherited from

CameraInput.role


urls

urls: StreamUrls

Defined in: camera/config.ts:24

Generated streaming URLs

Inherited from

CameraInput.urls


useForSnapshot

useForSnapshot: boolean

Defined in: camera/config.ts:18

Use this source for snapshots

Inherited from

CameraInput.useForSnapshot

Methods

generateSnapshotUrl()

generateSnapshotUrl(options?): string

Defined in: camera/device.ts:50

Generate Snapshot URL with specified options.

Parameters

options?

SnapshotUrlOptions

URL generation options

Returns

string

Snapshot URL string


getStreamStatus()

getStreamStatus(): Promise<string>

Defined in: camera/device.ts:41

Get the current stream connection status.

Returns

Promise<string>

Status string: 'connected', 'connecting', 'error', or 'idle'


probeStream()

probeStream(probeConfig?, refresh?): Promise<ProbeStream | undefined>

Defined in: camera/device.ts:34

Probe stream for codec and track information.

Parameters

probeConfig?

ProbeConfig

What to probe for

refresh?

boolean

Force fresh probe (ignore cache)

Returns

Promise<ProbeStream | undefined>

Stream information or undefined if unavailable


snapshot()

snapshot(forceNew?): Promise<ArrayBuffer | undefined>

Defined in: camera/device.ts:23

Get camera snapshot image.

Parameters

forceNew?

boolean

Force fresh snapshot (ignore cache)

Returns

Promise<ArrayBuffer | undefined>

JPEG image data or undefined if unavailable