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
  • Publish a Stream to a Channel
  • Unpublish a Stream
  • Publish Video Related Events
  • Example Event Payloads
  1. SDKs
  2. Video

Publishing Streams

PreviousCamera SelectionNextModifying Published Streams

Last updated 4 years ago

Publish a Stream to a Channel

Before allowing the end user to publish video you should make sure you have received a VIDEO_STATE_AVAILABLE state from the event.

To publish the stream you call the method. By default this will publish both the video and audio track within the current local media stream.

aloVideo.publishStream();

If you wish to specify which tracks to publish you can provide the sendAudio and sendVideo options.

The following is an example when you publish the stream with video and without the audio:

aloVideo.publishStream({sendVideo: true, sendAudio: false});

You can also change which tracks are published after calling the publishStream method as well. See .

See for information about rendering streams.

Unpublish a Stream

You may unpublish video in the channel and remain connected to a video channel (so you still see and hear others) using the methhod.

aloVideo.unpublishStream();

Publish Video Related Events

Event

Description

onVideoAvailabilityChange

This event will let you know when the publishing video is available (meaning you are connected to a video channel). The possible states are AloVideo.VIDEO_STATE_AVAILABLE and AloVideo.VIDEO_STATE_UNAVAILABLE.

onParticipantsChanged

onPublishedStreamChange

When a remotely published stream changes in anyway (for example, the participant removed the audio track ) this event will be fired.

Example Event Payloads

// onVideoAvailabilityChange
detail : {
    state : 'VIDEO_STATE_UNAVAILABLE'
}

detail : {
    state : 'VIDEO_STATE_AVAILABLE'
}

//onParticipantsChanged
detail : {
    channel: VideoChannel{...},
    currentParticipantId: "dhsdjfhgs-dfsdfdd",
    participants: [Participant, Participant]
}


// onPublishedVideoChange
detail : {
    channel: VideoChannel{...},
    isPublished: true,
    participant: Participant{...}
}

When a participant (including the current user) published/unpublished video this event will be dispatched. See for more information.

Participants
Modifying Published Streams
Rendering Streams
onVideoAvailabilityChange
publishStream()
unpublishStream()