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
  • Overview
  • Example Device List Retrieval
  • Device List Changes
  • Input Device Related Events
  1. SDKs
  2. Video

Input Device Selection

PreviousDisconnecting Video ServiceNextMicrophone Selection

Last updated 4 years ago

Overview

Before joining a video channel you have the option of selecting which video input (camera) and audio input device (microphone) to use. If you do not specify an input devices the operating system's default devices will be used.

In order to get the current list of available video devices you can use the method.

Example Device List Retrieval

let devices = await aloVideo.getMediaList();
const listElement = document.querySelector('select#availableCameras');
listElement.innerText = null;

Object.values(devices[AloVideoSDK.MEDIA_DEVICE_LIST_VIDEO_INPUT]).forEach(device => {
  const inputOption = document.createElement('option');
  inputOption.value = device.id;
  inputOption.label = device.label;
  inputOption.innerText = device.label;
  listElement.add(inputOption);
});

Example getMediaList() response

{
    audioinput: {
        default: {…}, 
        60e23d3fe7f068be51ebe36890a9b1bbd7c522dc2b698b91b00828079177ed93: {…}, 
        d6c3b4a5f1221974561008c5c3ddc6b3768389c91fdd396a420ffc22a53deec3: {…}
    },
    audiooutput: {
        default: {…}, 
        698fb0e5ea599bd95e11c5636e7e651602046620ccfba4eb8a07173d91268884: {…}, 
        1fd3430ccd0dea76bba3f824ffd2b73073594e9cc395b6f2bfa36b065e476383: {…}
    },
    videoinput: {
        c72ee2c098ce749a5245ebbfd0560349c48929b42f89f7a3a3969ba1b5087517: {…}, 
        99ee472997a484234acd080b1153c88bd3a80dba716179a0c90af1c60de83685: {…}
    }
}

Device List Changes

You should also add a listener for the onDeviceListUpdate event. If the list of available input devices changes you can update your input device selection.

Input Device Related Events

Event

Description

onDeviceListUpdate

This event will let you know the list of available input devices has changed.

Example onDeviceListUpdate event payload:

{
  detail : {
      99ee472997a484234acd080b1153c88bd3a80dba716179a0c90af1c60de83685: {
        id: "99ee472997a484234acd080b1153c88bd3a80dba716179a0c90af1c60de83685",
        label: "Logitech HD Webcam C615 (046d:082c)",
        type: "videoinput"
      },
      c72ee2c098ce749a5245ebbfd0560349c48929b42f89f7a3a3969ba1b5087517: {
        id: "c72ee2c098ce749a5245ebbfd0560349c48929b42f89f7a3a3969ba1b5087517",
        label: "Some other camera,
        type: "videoinput"
      }
  }
}

When you instantiate the AloVideo object you can specify the input device id on the videoInputDeviceId property. See:

Instantiating Video Service
getMediaList()