Skip to content

@camera.ui/sdk / camera / CameraSource

Interface: CameraSource ​

Defined in: camera/device.ts:14

Camera source with snapshot and probe capabilities.

Extends ​

Extended by ​

Properties ​

_id ​

readonly _id: string

Defined in: camera/config.ts:24

Unique source ID.

Inherited from ​

CameraInput._id


audioCodecs? ​

optional audioCodecs?: AudioCodec[]

Defined in: camera/config.ts:48

Probed audio codecs of this source (camera to client, deduplicated, in track order). Filled by the server once the stream has been probed; absent until then.

Inherited from ​

CameraInput.audioCodecs


backchannelAudioCodec? ​

optional backchannelAudioCodec?: AudioCodec

Defined in: camera/config.ts:50

Probed talkback audio codec (client to camera). Present only when the probed source has a backchannel.

Inherited from ​

CameraInput.backchannelAudioCodec


backchannelDisabled? ​

optional backchannelDisabled?: boolean

Defined in: camera/config.ts:38

Drop the talk channel of this source, so clients get no microphone (defaults to false).

Inherited from ​

CameraInput.backchannelDisabled


childCameraId? ​

optional childCameraId?: string

Defined in: camera/config.ts:54

Camera whose stream shows in the picture-in-picture overlay, instead of a source of this camera.

Inherited from ​

CameraInput.childCameraId


childCameraRole? ​

optional childCameraRole?: StreamingRole

Defined in: camera/config.ts:56

Role of the childCameraId stream shown in the overlay.

Inherited from ​

CameraInput.childCameraRole


childSourceId? ​

optional childSourceId?: string

Defined in: camera/config.ts:52

Child source ID (for snapshot fallback).

Inherited from ​

CameraInput.childSourceId


handshakeTimeout? ​

optional handshakeTimeout?: number

Defined in: camera/config.ts:42

Seconds allowed per RTSP request while connecting. Raise it for cameras that wake slowly. Unset means 5.

Inherited from ​

CameraInput.handshakeTimeout


hotMode ​

hotMode: boolean

Defined in: camera/config.ts:32

Keep connection always active.

Inherited from ​

CameraInput.hotMode


muted? ​

optional muted?: boolean

Defined in: camera/config.ts:36

Strip the audio track from this source (defaults to false).

Inherited from ​

CameraInput.muted


name ​

name: string

Defined in: camera/config.ts:26

Source display name.

Inherited from ​

CameraInput.name


preload ​

preload: boolean

Defined in: camera/config.ts:34

Keep a keyframe cache for this source, so the view opens faster. Use hotMode to keep the stream connected.

Inherited from ​

CameraInput.preload


role ​

role: CameraRole

Defined in: camera/config.ts:28

Resolution role.

Inherited from ​

CameraInput.role


timeout? ​

optional timeout?: number

Defined in: camera/config.ts:40

Seconds without media before the stream reconnects. Unset means the host default: 5 for cameras, 60 for plugin-served sources.

Inherited from ​

CameraInput.timeout


urls ​

urls: StreamUrls

Defined in: camera/config.ts:44

Generated streaming URLs.

Inherited from ​

CameraInput.urls


useForSnapshot ​

useForSnapshot: boolean

Defined in: camera/config.ts:30

Use this source for snapshots.

Inherited from ​

CameraInput.useForSnapshot


videoCodec? ​

optional videoCodec?: VideoCodec

Defined in: camera/config.ts:46

Probed video codec of this source. Filled by the server once the stream has been probed; absent until then.

Inherited from ​

CameraInput.videoCodec

Methods ​

generateSnapshotUrl() ​

generateSnapshotUrl(options?): string

Defined in: camera/device.ts:49

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

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

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

Get camera snapshot image.

Parameters ​

forceNew? ​

boolean

Force fresh snapshot (ignore cache)

Returns ​

Promise<ArrayBuffer | undefined>

JPEG image data or undefined if unavailable