import { OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core'; import { ControlMedia } from '../../../consumers/control-media.service'; import { Participant, ControlsPosition, InfoPosition, AudioDecibels, ControlMediaOptions, ShowAlert, CoHostResponsibility, CustomComponent } from '../../../@types/types'; import { Socket } from 'socket.io-client'; import { LiveSubtitleService } from '../../../services/live-subtitle.service'; import * as i0 from "@angular/core"; export interface AudioCardParameters { audioDecibels: AudioDecibels[]; participants: Participant[]; socket: Socket; coHostResponsibility: CoHostResponsibility[]; roomName: string; showAlert?: ShowAlert; coHost: string; islevel: string; member: string; eventType: string; getUpdatedAllParams(): AudioCardParameters; } export interface AudioCardOptions { controlUserMedia?: (options: ControlMediaOptions) => Promise; customStyle?: Partial; name: string; barColor?: string; textColor?: string; imageSource?: string; roundedImage?: boolean; imageStyle?: Partial; showControls?: boolean; showInfo?: boolean; videoInfoComponent?: HTMLElement | CustomComponent; videoControlsComponent?: HTMLElement | CustomComponent; controlsPosition?: ControlsPosition; infoPosition?: InfoPosition; participant: Participant; backgroundColor?: string; audioDecibels?: AudioDecibels; parameters: AudioCardParameters; } export type AudioCardType = (options: AudioCardOptions) => HTMLElement; /** * AudioCard component renders an audio card for participants with customizable options and media controls. * It shows audio waveform animations, video/audio toggle buttons, and additional info based on injected or passed properties. * * @selector app-audio-card * @standalone true * @imports CommonModule, FontAwesomeModule, MiniCard * * @inputs * - `controlUserMedia` (function): Optional function to control media actions for a participant. * - `customStyle` (Partial): Custom CSS styles for the audio card. * - `name` (string): Name of the participant. * - `barColor` (string): Color for the audio bar. Default is 'red'. * - `textColor` (string): Text color. Default is 'white'. * - `imageSource` (string): Image source URL for participant. * - `roundedImage` (boolean): Toggle for rounded image style. * - `imageStyle` (Partial): Custom styles for the image. * - `showControls` (boolean): Toggle for displaying media controls. Default is true. * - `showInfo` (boolean): Toggle for displaying info section. Default is true. * - `videoInfoComponent` (HTMLElement | CustomComponent): Custom component for participant info. * - `videoControlsComponent` (HTMLElement | CustomComponent): Custom component for video controls. * - `controlsPosition` (ControlsPosition): Position for controls on the card. Default is 'topLeft'. * - `infoPosition` (InfoPosition): Position for the info section. Default is 'topRight'. * - `participant` (Participant | null): Participant object reference. * - `backgroundColor` (string): Background color for the card. * - `audioDecibels` (AudioDecibels): Optional audio decibel levels for the participant. * - `parameters` (AudioCardParameters): Required object with configuration parameters. * * @methods * - `ngOnInit()`: Initializes the component, sets default media control behavior, and activates audio waveform animations. * - `ngOnDestroy()`: Clears the animation interval. * - `animateBar(index: number)`: Animates the audio bar at a specified index. * - `animateWaveform()`: Triggers animations across the waveform bars. * - `resetWaveform()`: Resets waveform animations to default. * - `getAnimationDuration(index: number)`: Retrieves the animation duration for a bar by index. * - `toggleAudio()`: Toggles audio for the participant if media control function is defined. * - `toggleVideo()`: Toggles video for the participant if media control function is defined. * - `renderControls()`: Returns `showControls` to render or hide media controls. * - `combineStyles(baseStyle: any, additionalStyles: any)`: Combines base and additional styles for inline styling. * - `getOverlayPosition(position: string)`: Retrieves calculated overlay position for elements. * - `isCustomComponent(comp: HTMLElement | CustomComponent)`: Type guard for identifying custom components. * - `isFunctionComponent(comp: HTMLElement | CustomComponent)`: Type guard for identifying function components. * * @example * ```html * * * ``` * **/ export declare class AudioCard implements OnInit, OnDestroy, OnChanges { private controlMediaService; private liveSubtitleService; controlUserMedia?: (options: ControlMediaOptions) => Promise; customStyle: Partial; name: string; barColor: string; textColor: string; imageSource: string; roundedImage: boolean; imageStyle: Partial; showControls: boolean; showInfo: boolean; videoInfoComponent?: HTMLElement | CustomComponent; videoControlsComponent?: HTMLElement | CustomComponent; controlsPosition: string; infoPosition: string; participant: Participant | null; backgroundColor: string; audioDecibels: any; parameters: AudioCardParameters; faVideo: import("@fortawesome/fontawesome-common-types").IconDefinition; faVideoSlash: import("@fortawesome/fontawesome-common-types").IconDefinition; faMicrophone: import("@fortawesome/fontawesome-common-types").IconDefinition; faMicrophoneSlash: import("@fortawesome/fontawesome-common-types").IconDefinition; waveformAnimations: number[]; ringBarIndices: number[]; showWaveform: boolean; audioLevelInterval: any; waveformInterval: any; isDarkModeEnabled: boolean; imageLoadFailed: boolean; constructor(controlMediaService: ControlMedia, liveSubtitleService: LiveSubtitleService, injectedControlUserMedia: (options: ControlMediaOptions) => Promise, injectedCustomStyle: Partial, injectedName: string, injectedBarColor: string, injectedTextColor: string, injectedImageSource: string, injectedRoundedImage: boolean, injectedImageStyle: Partial, injectedShowControls: boolean, injectedShowInfo: boolean, injectedVideoInfoComponent: HTMLElement | CustomComponent, injectedVideoControlsComponent: HTMLElement | CustomComponent, injectedControlsPosition: ControlsPosition, injectedInfoPosition: InfoPosition, injectedParticipant: Participant | null, injectedBackgroundColor: string, injectedAudioDecibels: AudioDecibels, injectedParameters: AudioCardParameters); get liveSubtitleText(): string | null; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; get hasRenderableImage(): boolean; get isSpeaking(): boolean; getWaveformRingHeight(index: number): number; handleImageError(): void; animateWaveform(): void; resetWaveform(): void; syncThemeMode(params?: any): void; toggleAudio(): Promise; toggleVideo(): Promise; renderControls(): boolean; combineStyles(baseStyle: any, additionalStyles: any): any; getOverlayPosition(position: string): import("../../../@types/types").OverlayPositionStyle; isCustomComponent(comp: HTMLElement | CustomComponent | (() => HTMLElement | CustomComponent)): comp is CustomComponent; isFunctionComponent(comp: HTMLElement | CustomComponent | (() => HTMLElement | CustomComponent)): comp is () => HTMLElement | CustomComponent; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }