Rate this page:

LocalStream

Interface that represents any local stream.

Methods

addEventListener

Copy URL
- (

void

)addEventListener:(

StreamEvent.Ended

)eventName

Registers a handler for the specified event.

One event can have more than one handler; handlers are executed in order of their registration.

Parameters

  • Event name

  • listener:

    (event: StreamEnded) => void | Promise<void>

    Handler function that is triggered when an event of the specified type occurs

  • Object that specifies characteristics about the event listener

Returns

  • type:

    void

close

Copy URL
- (

void

)close

Stops capturing media and releases all resources.

Returns

  • type:

    void

removeEventListener

Copy URL
- (

void

)removeEventListener:(

StreamEvent.Ended

)eventName

Registers a handler for the specified event.

One event can have more than one handler; handlers are executed in order of their registration.

Parameters

  • Event name

  • listener:

    (event: StreamEnded) => void | Promise<void>

    Handler function that is triggered when an event of the specified type occurs

  • Object that specifies characteristics about the event listener

Returns

  • type:

    void

Props

id

Copy URL
@property () id

Stream id.

source

Copy URL
@property () source

Stream source type (local).

sourceDeviceId

Copy URL
@property () sourceDeviceId

Media device id that produces media data for the local stream.

sourceStream

Copy URL
@property () sourceStream

MediaStream object.

track

Copy URL
@property () track

type

Copy URL
@property () type

Stream type.