Class: MindSDK

MindSDK()

MindSDK class is the entry point of Mind Web SDK. It contains static methods for joining and leaving conferences, for getting available cameras and microphones, and for creating local media streams. But before you can do all this, the SDK should be initialized:

MindSDK.initialize().then(function() {
   // Initialization of Mind SDK is completed, now you can participate in conferences.
});

Constructor

new MindSDK()

Methods

(static) createMediaStream(audioSupplier, videoSupplier) → {MediaStream}

Creates local media stream with audio and video from the specified suppliers. The null value can be passed instead of one of the suppliers to create audio-only or video-only media stream. Even if audio/video supplier wasn't null it doesn't mean that the result media stream would automatically contain audio/video, e.g. Microphone (as a supplier of audio) and Camera (as a supplier of video) supply no audio and no video, respectively, till they are acquired and after they were released.

Parameters:
Name Type Description
audioSupplier MediaStreamAudioSupplier | null

The audio supplier or null to create video-only media stream.

videoSupplier MediaStreamVideoSupplier | null

The video supplier or null to create audio-only media stream.

Returns:

The created media stream.

Type
MediaStream

(static) exit(conference)

Leaves the conference if it has been joined. The leaving is an idempotent synchronous operation. After the leaving the conference object itself and all other objects related to the conference aren't functional.

Parameters:
Name Type Description
conference Conference

The conference which we are leaving.

(static) getCameras() → {Array.<Camera>}

Returns the list of cameras which are currently plugged in to the computer. If no cameras are plugged in to the computer, the list will empty. If at least one camera is plugged in to the computer, the contents of the list will depend on whether there is permission to access cameras or not: if the permission has been granted, the list will contain a default camera and all other cameras, otherwise the list will contain the default camera only. The initial list of cameras is discovered during the initialization, but since any camera might be plugged in and unplugged at any moment, Mind Web SDK watches for changes and updates the list accordingly.

Returns:

The list of cameras which are currently plugged in to the computer.

Type
Array.<Camera>

(static) getMicrophones() → {Array.<Microphone>}

Returns the list of microphones which are currently plugged in to the computer. If no microphones are plugged in to the computer, the list will empty. If at least one microphone is plugged in to the computer, the contents of the list will depend on whether there is permission to access microphones or not: if the permission has been granted, the list will contain a default microphone and all other microphones, otherwise the list will contain the default microphone only. The initial list of microphones is discovered during the initialization, but since any microphone might be plugged in and unplugged at any moment, Mind Web SDK watches for changes and updates the list accordingly.

Returns:

The list of microphones which are currently plugged in to the computer.

Type
Array.<Microphone>

(static) getScreen() → {Screen|null}

Returns the screen that can be used for capturing the contents of the entire screen or portion thereof (such as a window of an application or a tab of the browser) or null value if the browser does not support screen capturing.

Returns:

The screen or null value if the browser doesn't support screen capturing.

Type
Screen | null

(static) initialize() → {Promise}

Initializes Mind Web SDK. The initialization is an asynchronous operation, that's why this method returns a Promise that either resolves with no value when the initialization is completed. The initialization should be completed only once before calling any other method of the MindSDK class.

Returns:

The promise that resolves with no value when the initialization is completed.

Type
Promise

(static) join(uri, token, listener) → {Promise.<Conference>}

Joins the conference on behalf of the participant with the specified token. The third argument is a listener which will be notified about all the changes in the conference. The joining is an asynchronous operation, that's why this method returns a Promise that either resolves with a Conference (if the operation succeeded) or rejects with an Error (if the operation failed).

Parameters:
Name Type Description
uri String

The URI of the conference.

token String

The token of the participant on behalf of whom we are joining the conference.

listener ConferenceListener

The listener that should notifications about all the changes in the conference.

Returns:

The promise that either resolves with a Conference or rejects with an Error.

Type
Promise.<Conference>