LogoLogo
ALO.ai
Developer Documentation
Developer Documentation
  • Developer Documentation
  • Developer Account
    • API Key
  • SDKs
    • Authentication
    • Chat
      • Configuration
      • Send Messages
        • Upload Files
      • Message History
      • Message Actions
      • Message Counts
      • Translation
      • Typing Indicators
      • API Reference
        • Event
        • Message
    • Presence
      • Configuration
      • Basic Usage
      • Methods
    • Audio
      • Prerequisites
      • Instantiating Audio Service
      • Connect to a Channel
      • Disconnecting Audio Service
      • Push To Talk (PTT)
      • Full Duplex
      • Mute and Unmute Audio
      • Input/Output Device Selection
        • Microphone Selection
        • Speaker Selection
      • Channel Participants
      • Text To Speech Audio (TTS)
      • Automatic Reconnects
      • Handling Events
      • Classes
        • AloAudio
        • AudioUser
        • AudioChannel
        • Participant
    • Video
      • Prerequisites
      • Instantiating Video Service
      • Connect to a Channel
      • Disconnecting Video Service
      • Input Device Selection
        • Microphone Selection
        • Camera Selection
      • Publishing Streams
      • Modifying Published Streams
      • Channel Participants
      • Rendering Streams
        • Local Stream
        • Remote Streams
      • Muting/Unmuting Remote Streams
      • Recording Video (coming soon)
      • Automatic Reconnects
      • Handling Events
      • Classes
        • AloVideo
        • Participant
        • VideoChannel
        • VideoUser
  • ALO APPS
    • Overview
    • Creating Apps
    • Webhooks
      • Verifying Requests from ALO
    • Custom Action Forms
    • Using the ALO Platform API
  • ALO Platform API
    • Overview
    • Authentication
    • API
      • Actions and Periods
      • Channels
      • Channel Messages
      • Channel Users
      • Direct Message Channels
      • Direct Message Channel Chat Messages
      • Direct Message Channel Users
      • Groups
      • Periods
      • Types
      • Users
      • Video Management System
  • Misc
    • Supported Language Codes
Powered by GitBook
LogoLogo

ALO.ai

  • ALO.ai

© Copyright 2025 ALO.ai, Inc. • All Rights Reserved

On this page
  • Constructor
  • Class Instantiation Properties
  • Methods
  • connect(channel)
  • changeAudioInput(deviceId)
  • changeVideoInput(deviceId)
  • disconnect()
  • enableAudio(enable)
  • enableVideo(enable)
  • forceReconnectWhenPending()
  • getMediaList()
  • muteParticipant(participantId, muted)
  • publishStream([options])
  • setUserAuthToken(token)
  • unpublishStream()
  1. SDKs
  2. Video
  3. Classes

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:

Property

Required

Description

user

Yes

userAuthToken

Yes

languageCode

en-US

audioInputDeviceId

No

This is the id of an audio input device (microphone). When specified, this is the device that will be used for audio input. If no device is specified the operating system's default audio input device will be used.

videoInputDeviceId

No

This is to be the id of a video input device (i.e. webcam). When specified, this is the device that will be used for video input. If no device is specified the operating system's default video input device will be used.

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)

Parameter

Type

Description

channel

Defines the channel to connect to in the Video Service

Example:

aloAudio.connect(audioChannel);

changeAudioInput(deviceId)

Parameter

Type

Description

deviceId

String

changeVideoInput(deviceId)

Parameter

Type

Description

deviceId

String

disconnect()

Disconnect Related Events

Event

Description

onDisconnect

Once disconnected, either intentionally or due to an error, the onDisconnect event will be dispatched.

enableAudio(enable)

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

Parameter

Type

Description

enable

Boolean

When you pass the value of false the audio track in your published stream will be disabled.

enableVideo(enable)

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

Parameter

Type

Description

enable

Boolean

When you pass the value of false the video track in your published stream will be disabled.

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()

muteParticipant(participantId, muted)

Parameter

Type

Description

participantId

String

mute

Boolean

When true the participant's audio will be muted.

publishStream([options])

Option

Default

Description

sendAudio

true

Include audio with the published stream.

sendVideo

true

Include video with the published stream.

setUserAuthToken(token)

Parameter

Type

Description

token

String

unpublishStream()

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

PreviousClassesNextParticipant

Last updated 3 years ago

The that defines the user that is participating in AloVideo.

See for information on acquiring this token.

BCP 47 language code that denotes the language that user speaks. This is helps the Video Service transcribe the user's audio. See: .

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

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

This is the id of the microphone to be used. See .

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

This is the id of the camera to be used. See .

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

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

This method it used to mute the audio track of a participant's stream. See .

The id pf the to mute/unmute

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

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 method to reconnect.

This is the authentication token needed to access audio rooms. See: for information about obtaining the token.

Connect to a Channel
Input Device Selection
Input Device Selection
Disconnecting Video Service
Input Device Selection
Muting/Unmuting Remote Streams
Publishing Streams
connect()
VideoUser
Authentication Token
Supported Language Codes
VideoChannel
Input Device Selection
Input Device Selection
participant
Authentication