LocalVideoStream class

Represents a local video stream for a local camera device

Constructors

LocalVideoStream(MediaStream)
LocalVideoStream(VideoDeviceInfo)

Create a local video stream

Properties

mediaStreamType

Get the media stream type for this LocalVideoStream

source

Get the current video source for this LocalVideoStream

Methods

feature<TFeature>(VideoStreamFeatureFactory<TFeature>)

Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended features in this package. Currently supported - Features.VideoEffects

getMediaStream()

Get media stream.

off("videoSourceChanged", VideoSourceChangedEvent)

Unsubscribe function for videoSourceChanged event.

on("videoSourceChanged", VideoSourceChangedEvent)

Subscribe function for videoSourceChanged event.

setMediaStream(MediaStream)

Set media stream.

switchSource(VideoDeviceInfo)

Switch to use a different video source

Constructor Details

LocalVideoStream(MediaStream)

new LocalVideoStream(source: MediaStream)

Parameters

source

MediaStream

LocalVideoStream(VideoDeviceInfo)

Create a local video stream

new LocalVideoStream(source: VideoDeviceInfo)

Parameters

source
VideoDeviceInfo

The video camera source to use.

Property Details

mediaStreamType

Get the media stream type for this LocalVideoStream

MediaStreamType mediaStreamType

Property Value

source

Get the current video source for this LocalVideoStream

VideoDeviceInfo source

Property Value

Method Details

feature<TFeature>(VideoStreamFeatureFactory<TFeature>)

Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended features in this package. Currently supported - Features.VideoEffects

function feature<TFeature>(factory: VideoStreamFeatureFactory<TFeature>): TFeature

Parameters

factory

VideoStreamFeatureFactory<TFeature>

The factory for the call client feature constructor that provides an extended API

Returns

TFeature

getMediaStream()

Get media stream.

function getMediaStream(): Promise<MediaStream>

Returns

Promise<MediaStream>

off("videoSourceChanged", VideoSourceChangedEvent)

Unsubscribe function for videoSourceChanged event.

function off(event: "videoSourceChanged", listener: VideoSourceChangedEvent)

Parameters

event

"videoSourceChanged"

event name.

listener
VideoSourceChangedEvent

callback fn that was used to subscribe to this event.

on("videoSourceChanged", VideoSourceChangedEvent)

Subscribe function for videoSourceChanged event.

function on(event: "videoSourceChanged", listener: VideoSourceChangedEvent)

Parameters

event

"videoSourceChanged"

event name.

listener
VideoSourceChangedEvent

callback fn that will be called when the video source will change.

setMediaStream(MediaStream)

Set media stream.

function setMediaStream(source: MediaStream): Promise<void>

Parameters

source

MediaStream

Returns

Promise<void>

switchSource(VideoDeviceInfo)

Switch to use a different video source

function switchSource(source: VideoDeviceInfo): Promise<void>

Parameters

source
VideoDeviceInfo

The new video source to use.

Returns

Promise<void>