Home Manual Reference Source
public class | source

Local

The local stream

Member Summary

Public Members
public get

constraints: MediaConstraints

The Media Constraints.

public set

constraints(constraints: MediaConstraints)

The Media Constraints.

public

The local DOM container element where the Local~media is displayed

public

is the video is loaded int the local DOM media element

public get

The associated MediaStream

public set

The associated MediaStream

public

muted: {audio: boolean, video: boolean}

Indicates if a track is muted

public

The local DOM media element where the Local~media is displayed

public

List of the PeerConnections associated to this local stream

public

The uid of the room the stream is published in

public

Local stream status

public

The type of the stream

public

The uid of this stream

Method Summary

Public Methods
public

Removes stream for published list, closes associated PeerConnections and stops current MediaStream

public

mute(track: string, state: boolean)

Mute a track of a Stream

public

off(event: string, callback: function)

Register a callback for a specific event

public

on(event: string, callback: function)

Register a callback for a specific event

public

Switch video input device

public

Switch audio input device

public

unMute(track: string)

Un-mute a track of a Stream

public

updateConstraints(constraints: *): * | Promise<TResult>

Updates the stream constraints and retrieve the new MediaStream

Public Members

public get constraints: MediaConstraints source

The Media Constraints. (defaults to global config)

public set constraints(constraints: MediaConstraints) source

The Media Constraints. (defaults to global config)

public container: Element source

The local DOM container element where the Local~media is displayed

public isVideoLoaded: boolean source

is the video is loaded int the local DOM media element

public get media: MediaStream source

The associated MediaStream

public set media: MediaStream source

The associated MediaStream

public muted: {audio: boolean, video: boolean} source

Indicates if a track is muted

public node: Element source

The local DOM media element where the Local~media is displayed

public peerConnections: PeerConnection[] source

List of the PeerConnections associated to this local stream

public roomId: string source

The uid of the room the stream is published in

public status: string source

Local stream status

public type: string source

The type of the stream

public uid: string source

The uid of this stream

Public Methods

public close(): Promise source

Removes stream for published list, closes associated PeerConnections and stops current MediaStream

Return:

Promise

public mute(track: string, state: boolean) source

Mute a track of a Stream

Params:

NameTypeAttributeDescription
track string
  • optional
  • default: AUDIO

The track to mute. (AUDIO, VIDEO, AUDIO_VIDEO)

state boolean
  • optional
  • default: true

true for mute & false for un-mute

Example:

mute video
stream.mute(Reach.t.VIDEO)
mute audio
stream.mute(Reach.t.AUDIO)
// or
stream.mute()

public off(event: string, callback: function) source

Register a callback for a specific event

Params:

NameTypeAttributeDescription
event string
  • optional

The event name (Events/Stream)

callback function
  • optional

The callback for the event

public on(event: string, callback: function) source

Register a callback for a specific event

Params:

NameTypeAttributeDescription
event string

The event name (Events/Stream)

callback function

The callback for the event

public switchCamera(deviceId: string): Promise<Local, Error> source

Switch video input device

Params:

NameTypeAttributeDescription
deviceId string
  • optional

A video input device Id or the facingMode value

Return:

Promise<Local, Error>

public switchMicrophone(deviceId: string): Promise<Local, Error> source

Switch audio input device

Params:

NameTypeAttributeDescription
deviceId string
  • optional

A audio input device Id

Return:

Promise<Local, Error>

public unMute(track: string) source

Un-mute a track of a Stream

Params:

NameTypeAttributeDescription
track string
  • optional
  • default: AUDIO

The track to mute. (AUDIO, VIDEO, AUDIO_VIDEO)

Example:

Un-mute video
stream.unMute(Reach.t.VIDEO)
Un-mute audio
stream.unMute(Reach.t.AUDIO)
// or
stream.unMute()

public updateConstraints(constraints: *): * | Promise<TResult> source

Updates the stream constraints and retrieve the new MediaStream

Params:

NameTypeAttributeDescription
constraints *

Return:

* | Promise<TResult>