AloVideo

Constructor

There are a number of properties available when instantiating the AloVideo class:

Class Instantiation Properties

In order to instantiate the AloVideo object you are required to provide a number of properties. Below are the properties that are available:

Example Properties

  const user = new VideoUser(
    "12345",
    {      
      name: "James Jones",
      deviceId: "abcd-efsg-wqer-qewe"
    }
  );
  
  const props = {
    user: user,
    aloConnections: aloConnections
  };

Instantiating AloVideo

const aloVideo = new AloVideo(props);

Methods

connect(channel)

Connects the user to a channel in the Video Service. See Connect to a Channel.

Example:

aloAudio.connect(audioChannel);

changeAudioInput(deviceId)

You can use this method to change the active microphone after connecting to a channel. See Input Device Selection.

changeVideoInput(deviceId)

You can use this method to change the active camera after connecting to a channel. See Input Device Selection.

disconnect()

Use this method to disconnect from the Audio Service. See Disconnecting Video Service.

enableAudio(enable)

While publishing a stream you can change whether or not the stream should include audio.

enableVideo(enable)

While publishing a stream you can change whether or not the stream should include video.

forceReconnectWhenPending()

If the connection to the service has been lost and you do not want to wait for the service to automatically try reconnecting you can call this method and an attempt will be made to reconnect immediately.

getMediaList()

This method will return the list of available audio input and output devices. See Input Device Selection

muteParticipant(participantId, muted)

This method it used to mute the audio track of a participant's stream. See Muting/Unmuting Remote Streams.

publishStream([options])

This method will publish a stream to the channel the user is currently connected to. See Publishing Streams.

setUserAuthToken(token)

If the user's authentication token expires you will receive a onInvalidAuthenticationToken event. When you receive the event you must generate a new token and call setUserAuthToken with the new token. Then you must call the connect()method to reconnect.

unpublishStream()

If you are currently publishing a stream, this method will end the stream publication.

Last updated