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
  • Published Stream Events
  • Adding the Event Listener
  • Looking at the onPublishedStreamChange Event Payload
  • Event Properties
  1. SDKs
  2. Video

Rendering Streams

PreviousChannel ParticipantsNextLocal Stream

Last updated 4 years ago

Published Stream Events

One of the events you should add a listener for, after you , is onPublishedStreamChange. This event will be fired for a variety of reasons related to a published stream:

  • You just joined a channel

    • You will receive an event for each that is currently publishing a stream.

  • A new stream is published in a channel

  • A stream has been unpublished

  • A stream has been modified

    • Audio track added/removed

    • Video track added/removed

Adding the Event Listener

aloVideo.events.addEventListener('onPublishedStreamChange', e => {    
    handlePublishedVideoChange(e.detail);
});

Looking at the onPublishedStreamChange Event Payload

Example Payload for Remote Stream

{
  detail: {
    channel: VideoChannel {...}
    inputDeviceIds: null
    isLocal: false
    isPublished: true
    participant: Participant
      connectionId: "5370_ON_d3b077a0-272d-4ee1-b43b-2951d6c2782b_*_*_1617366678452"
      id: "5370_ON_d3b077a0-272d-4ee1-b43b-2951d6c2782b"
      isCurrentUser: false
      isMutedLocally: false
      isPublishingAudio: true
      isPublishingStream: true
      isPublishingVideo: false
      mediaStream: MediaStream {id: "janus", active: true, onaddtrack: null, onremovetrack: null, onactive: null, …}
      ...
  }
}

Example Payload for Local Stream

{
  detail: {
    channel: VideoChannel {...}
    inputDeviceIds: {
      audioInputDeviceId: "default"
      videoInputDeviceId: "c72ee2c098ce749a5245ebbfd0560349c48929b42f89f7a3a3969ba1b5087517"
    }
    isLocal: true
    isPublished: true
    participant: Participant
      connectionId: "8921_ON_sb4556-1722-4dda-x43s-2145ds6c2782s_*_*_1617366678452"
      id: "8921_ON_sb4556-1722-4dda-x43s-2145ds6c2782s"
      isCurrentUser: true
      isPublishingAudio: true
      isPublishingStream: true
      isPublishingVideo: true
      mediaStream: MediaStream {...}
      ...
  }
}

Event Properties

Property

Type

Description

channel

The channel the stream is published in

inputDeviceIds

Hash

For remote streams this will be null. For local streams this will a hash showing the ids of the audio and video devices that were selected when the stream was published. This is helpful in determining which devices are in use if you did not specify input devices before publishing.

isLocal

Boolean

This will be true if the event is for a local stream

isPublished

Boolean

This will be true if the event represents a stream that is published. When a stream is unpublished you will receive and event with this value set to false

participant

The participant who is publishing the stream. From this object you can get the that is being published.

Instantiating Video Service
participant
VideoChannel
Participant
MediaStream