Rate this page:

StreamManager

Class that provides API for creating and managing audio and video streams.

Methods

createAudioStream
Copy URL
createAudioStream(config: 

AudioConfig

,
deviceId:

string

):

Promise<LocalStream>

Creates an audio stream.

Returns a promise that resolves to a LocalStream object.

Parameters

  • Audio stream configuration

  • deviceId:

    string

    Optional

    Preferred audio device id

Returns

createScreenSharingStream
Copy URL
createScreenSharingStream(config: 

ScreenSharingConfig

):

Promise<LocalScreenSharingStream[]>

Creates a screen sharing stream.

Returns a promise that resolves to a LocalScreenSharingStream object.

Parameters

Returns

createVideoStream
Copy URL
createVideoStream(config: 

VideoConfig

,
deviceId:

string

):

Promise<LocalStream>

Creates a video stream.

The specified quality in the video configuration can be lowered if the device cannot provided, or if the stream capture has already begun.

Please avoid concurrent calls of this method with DevicePermission.requestCameraPermission and getUserMedia.

Returns a promise that resolves to a LocalStream object.

Parameters

  • Video stream configuration

  • deviceId:

    string

    Optional

    Preferred video device id

Returns

getStream
Copy URL
getStream(id: 

string

):

null | LocalStream | LocalScreenSharingStream

Returns a local audio or video stream by its id or null if there is no stream with the provided id.

Parameters

  • id:

    string

    Stream id

stopStream
Copy URL
stopStream(id: 

string

):

void

Stops and removes a stream by its id.

Stream stop results in closing all MediaStreamTrack associated with the stream and releasing its source (microphone, camera, or display)

After calling this method, the stream cannot be obtained by the StreamManager.getStream method.

Parameters

  • id:

    string

    Stream id

Returns

  • type:

    void

wrapAudioStream
Copy URL
wrapAudioStream(stream: 

MediaStream

):

LocalStream

Creates a local audio stream with a provided MediaStream object.

Parameters

Returns

wrapVideoStream
Copy URL
wrapVideoStream(stream: 

MediaStream

):

LocalStream

Creates a local video stream with a provided MediaStream object.

Parameters

Returns

Rate this page: