Class MiniAudioPlayer

The MiniAudioPlayer component manages audio playback for participants in a meeting, including volume control, audio visualization, and connection to the main application state. It uses audio analysis to display waveforms for active speakers and supports breakout room conditions, participant-specific audio decibel updates, and other media state dependencies.

<app-mini-audio-player
[stream]="audioStream"
[consumer]="audioConsumer"
[remoteProducerId]="producerId"
[parameters]="audioPlayerParameters">
</app-mini-audio-player>

The audio stream from the participant.

The audio consumer for the participant.

Unique ID for the remote producer of the audio stream.

Configuration object with various parameters and utility functions for audio management.

Optional audio visualization component injected into the MiniAudioPlayer.

Additional properties for configuring the audio visualization component.

The created audio player element.

The MiniAudioPlayer processes audio data and manage audio levels. It supports a dynamic breakout room feature that restricts audio visibility to limited participants, updates decibel levels for individual participants, and adjusts the waveforms based on audio activity.

Key functionalities include:

  • Automatically toggling wave visualization for active speakers.
  • Handling audio settings for different room states (e.g., shared screens, breakout rooms).
  • Injecting configuration and parameter dependencies dynamically through Injector.
  • setInterval for periodic volume level checks (auto-clears on component destruction).
  • ReUpdateInterType and UpdateParticipantAudioDecibelsType for dynamic participant audio decibel management.
const audioPlayerParameters: MiniAudioPlayerParameters = {
breakOutRoomStarted: true,
breakOutRoomEnded: false,
limitedBreakRoom: participantList,
reUpdateInter: reUpdateInterFunc,
updateParticipantAudioDecibels: updateAudioDecibelsFunc,
getUpdatedAllParams: () => getParams(),
};

// Initialize component with required inputs
<app-mini-audio-player
[stream]="audioStream"
[consumer]="audioConsumer"
[remoteProducerId]="participantId"
[parameters]="audioPlayerParameters"
></app-mini-audio-player>

Implements

  • OnInit
  • OnDestroy

Constructors

Methods

  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

    Returns void

Properties

stream: null | MediaStream = null
consumer: null | Consumer<AppData> = null
remoteProducerId: string = ''
parameters: MiniAudioPlayerParameters = ...
MiniAudioComponent: any
miniAudioProps: Record<string, any> = {}
audioElement: ElementRef<HTMLAudioElement>
showWaveModal: boolean = false
isMuted: boolean = false
intervalId: any
autoWaveCheck: boolean = false