@huddle01/web-core
Version:
The Huddle01 Javascript SDK offers a comprehensive suite of methods and event listeners that allow for seamless real-time audio and video communication with minimal coding required.
75 lines (72 loc) • 1.95 kB
TypeScript
import Bot from './Bot.js';
import { EnhancedEventEmitter } from './common-js/EnhancedEventEmitter.js';
import 'mediasoup-client/lib/DataConsumer';
import 'mediasoup-client/lib/DataProducer';
type ActiveSpeakersEvent = {
close: [];
};
type ActiveSpeakersOptions = {
bot: Bot;
size?: number;
};
/**
* ActiveSpeakers class.
* Functionality to get the active speakers in the room.
*/
declare class ActiveSpeakers extends EnhancedEventEmitter<ActiveSpeakersEvent> {
/**
* Room instance.
*/
private __room;
/**
* Bot instance which has the data producer connected directly to the room bot.
* This is used to handle all the states of the room and its functionality.
*/
private __bot;
/**
* Is the notification active.
*/
private __active;
/**
* Is the notification active.
*/
get active(): boolean;
/**
* Maximum number of entries in the list.
*/
private MAX_SIZE;
/**
* Size by which the active speakers list will be notified.
* `note: default size is 8`
*/
private __size;
/**
* Size by which the active speakers list will be notified.
*/
get size(): number;
/**
* Array of ActiveSpeakers ordered by volume.
*/
private __activePeerIds;
get activePeerIds(): string[];
/**
* Update the number of peerIds to notify.
* @param size
*/
updateSize: (size: number) => void;
/**
* Handle all the events emitted by the bot.
*/
private __handleBotEvents;
/**
* Emit the active speakers change event.
* @param data - Data containing the peerIds of the active speakers.
*/
private __handleActiveSpeakerChange;
constructor(data: ActiveSpeakersOptions);
/**
* Close the active speakers instance.
*/
close: () => void;
}
export { type ActiveSpeakersEvent, type ActiveSpeakersOptions, ActiveSpeakers as default };