• Public
  • Public/Protected
  • All

Interface AudioVideoController

AudioVideoController manages the signaling and peer connections.


Implemented by



Readonly activeSpeakerDetector

activeSpeakerDetector: ActiveSpeakerDetector

Returns the ActiveSpeakerDetector for this audio-video controller.

Readonly audioMixController

audioMixController: AudioMixController

Returns the AudioMixController for this audio-video controller.

Readonly configuration

Returns the session configuration for this audio-video controller.

Optional Readonly eventController

eventController: EventController

Returns the EventController for this audio-video controller.

Readonly logger

logger: Logger

Returns the Logger for this audio-video controller.

Readonly mediaStreamBroker

mediaStreamBroker: MediaStreamBroker

Returns the MediaStreamBroker for this audio-video controller.

Readonly realtimeController

realtimeController: RealtimeController

Returns the RealtimeController for this audio-video controller.

Readonly rtcPeerConnection

rtcPeerConnection: RTCPeerConnection

Returns the RTCPeerConnection for this audio-video controller if there is one.

Readonly videoTileController

videoTileController: VideoTileController

Returns the VideoTileController for this audio-video controller.




  • demoteFromPrimaryMeeting(): void
  • Remove the promoted attendee from the Primary meeting. This client will stop sharing audio, video, and data messages. This will revert the end-user to precisely the state they were before a call to promoteToPrimaryMeeting

    This will have no effect if there was no previous successful call to promoteToPrimaryMeeting. This may result in AudioVideoObserver.audioVideoWasDemotedFromPrimaryMeeting but there is no need to wait for that callback to revert UX, etc.

    Returns void



  • getRTCPeerConnectionStats(selector?: MediaStreamTrack): Promise<RTCStatsReport>
  • This API will be deprecated in favor of ClientMetricReport.getRTCStatsReport().

    It makes an additional call to the getStats API and therefore may cause slight performance degradation.

    Please subscribe to metricsDidReceive(clientMetricReport: ClientMetricReport) callback, and get the raw RTCStatsReport via clientMetricReport.getRTCStatsReport().


    • Optional selector: MediaStreamTrack

    Returns Promise<RTCStatsReport>




  • pauseReceivingStream(streamId: number): void


  • Allows an attendee in a Replica meeting to immediately transition to a Primary meeting attendee without need for reconnection. The promise should always return a session status even upon failure (i.e. it should never reject). See the guide for more information.

    The resolved MeetingSessionStatus will contain a MeetingSessionStatusCode of the following:

    • MeetingSessionStatusCode.OK: The promotion was successful (i.e. session token was valid, there was room in the Primary meeting, etc.), audio will begin flowing and the attendee can begin to send data messages, and content/video if the call is not already at limit.
    • MeetingSessionStatusCode.AudioAuthenticationRejected: Credentials provided were invalid when connection attempted to Primary meeting. There may be an issue with your mechanism which allocates the Primary meeting attendee for the Replica meeting proxied promotion. This also may indicate that this API was called in a non-Replica meeting.
    • MeetingSessionStatusCode.AudioCallAtCapacity: Credentials provided were correct but there was no room in the Primary meeting. Promotions to Primary meeting attendee take up a slot, just like regular Primary meeting attendee connections and are limited by the same mechanisms.
    • MeetingSessionStatusCode.SignalingBadRequest or MeetingSessionStatusCode.SignalingInternalServerError: Other failure, possibly due to disconnect or timeout. These failures are likely retryable.

    Application code may also receive a callback on AudioVideoObserver.videoAvailabilityDidChange to indicate they can begin to share video.

    chime::DeleteAttendee on the Primary meeting attendee will result in AudioVideoObserver.audioVideoWasDemotedFromPrimaryMeeting to indicate the attendee is no longer able to share.

    Any disconnection will trigger an automatic demotion to avoid unexpected or unwanted promotion state on reconnection. If the attendee still needs to be an interactive participant in the Primary meeting, promoteToPrimaryMeeting should be called again with the same credentials.

    This function should not be called until the first one resolves.


    Returns Promise<MeetingSessionStatus>

    Promise which resolves to a session status for the request. See possible options above.




  • replaceLocalAudio(audioStream: MediaStream): Promise<void>


  • replaceLocalVideo(videoStream: MediaStream): Promise<void>
  • Replaces the local video device without a WebRTC negotiation on the sender side and avoids that all video subscribers to re-negotiate at the same time. This is an optimized way of replacing video stream and requires WebRTC Unified Plan.


    • videoStream: MediaStream

      The video stream to be replaced with

    Returns Promise<void>


  • restartLocalVideo(callback: () => void): void


  • resumeReceivingStream(streamId: number): void


Optional setVideoCodecSendPreferences

  • Set codec preferences for this clients send stream in order of most preferred to least preferred. The controller will fallback for one of two reasons

    • The codec is not supported by the browser
    • Another client that has joined the conference does not support receiving the video. Note that if another client does not support any of the codecs provided the sender will not fallback, and that client will not be able to receive from this sender.

    If there is no overlap between what is passed in and what is supported by the browser, this function may not have any effect, and the default set of codecs for this browser will be used.


    Returns void


  • setVideoMaxBandwidthKbps(maxBandwidthKbps: number): void


  • start(options?: { signalingOnly?: boolean }): void
  • Start the meeting session. By default this will connect and begin sending and receiving audio, depending on the implementation.

    This method also allows you to provide options for how connection occurs.

    The only supported option is signalingOnly. Specifying this option will cause the controller to only connect the meeting signaling channel. This can be performed relatively early in the join lifecycle (e.g., prior to choosing audio devices), which can improve join latency.

    Your code is responsible for calling start again without signalingOnly to complete connection.


    • Optional options: { signalingOnly?: boolean }

      Passing signalingOnly: true will cause only the initial signaling connection to occur.

      • Optional signalingOnly?: boolean

    Returns void


  • stop(): void


  • update(options?: { needsRenegotiation?: boolean }): boolean
  • Updates the peer connection when video tiles have changed. If needsRenegotiation is set explicitly to false, we may skip SDP negotiation if it is not necessary.


    • Optional options: { needsRenegotiation?: boolean }
      • Optional needsRenegotiation?: boolean

    Returns boolean

Generated using TypeDoc