Options
All
  • Public
  • Public/Protected
  • All
Menu

The AudioController class is a managing class to control the audio-related functions and states in an active meeting session, such as mute or unmute local or remote audio.

Hierarchy

  • AudioEventEmitter
    • AudioController

Index

Constructors

Events

  • Occurs when the local audio state changes.

    Parameters

    • event: LOCAL_AUDIO_MUTE_CHANGED
    • listener: ((mute: boolean) => void)
        • (mute: boolean): void
        • Parameters

          • mute: boolean

          Returns void

    Returns any

  • Occurs when the remote audio mute changes.

    Parameters

    • event: REMOTE_AUDIO_MUTE_CHANGED
    • listener: ((uid: string, mute: boolean) => void)
        • (uid: string, mute: boolean): void
        • Parameters

          • uid: string
          • mute: boolean

          Returns void

    Returns any

  • Occurs when the host or moderator wants you to unmute your audio. This is a demand request, the app can decide whether to unmute.

    Parameters

    Returns any

Methods

  • cancelDemandRequest(): void
  • Used for cancel audio demand request by host

    Returns void

  • Disables the audio session.

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise

  • enableAudio(spec: true | MediaTrackConstraints): Promise<MediaStream>
  • Enables the audio session.

    Parameters

    • spec: true | MediaTrackConstraints

      parameters to create the Audio stream

    Returns Promise<MediaStream>

    MediaStream means the API call is valid or fails otherwise

  • muteAllRemoteAudioStreams(allowUnmute?: boolean): Promise<ErrorCodeType>
  • Stops subscribing to the audio stream of all meeting users.

    description

    A successful call of muteAllRemoteAudioStreams triggers the AudioEvent.REMOTE_AUDIO_MUTE_CHANGED event callback to all remote users.

    description

    Only the meeting host or moderator has permission to invoke this method.

    Parameters

    • allowUnmute: boolean = true

      if True means the remote user can unmute the audio by themselves, False means they can not.

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise

  • Stops publishing the local audio stream.

    description

    A successful call of muteLocalAudioStream triggers the AudioEvent.LOCAL_AUDIO_MUTE_CHANGED event callback to the local user.

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise

  • Stops subscribing to the audio stream of a remote user.

    description

    A successful call of muteRemoteAudioStream triggers the AudioEvent.REMOTE_AUDIO_MUTE_CHANGED event callback to the specified remote user.

    description

    Only the meeting host or moderator has permission to invoke this method.

    Parameters

    • uid: string

      The unique id of the specified remote user

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise

  • Removes the specified listener from the listener array for the event named eventName.

    Parameters

    Returns void

  • Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

    Parameters

    Returns void

  • Resumes subscribing to the audio stream of all meeting users.

    description

    A successful call of unmuteAllRemoteAudioStreams triggers the AudioEvent.REMOTE_AUDIO_MUTE_CHANGED event callback to all remote users.

    description

    Only the meeting host or moderator has permission to invoke this method.

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise

  • Resumes publishing the local audio stream.

    description

    A successful call of unmuteLocalAudioStream triggers the AudioEvent.LOCAL_AUDIO_MUTE_CHANGED event callback to the local user.

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise

  • Resumes subscribing to the audio stream of a remote user.

    description

    A successful call of unmuteRemoteAudioStream triggers the AudioEvent.REMOTE_AUDIO_MUTE_CHANGED event callback to the specified remote user.

    description

    Only the meeting host or moderator has permission to invoke this method.

    Parameters

    • uid: string

      The unique id of the specified remote user

    Returns Promise<ErrorCodeType>

    0 means the API call is valid or fails otherwise