@100mslive/hms-video-store
Version:
@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow
35 lines (34 loc) • 1.21 kB
TypeScript
import { TrackManager } from './TrackManager';
import { HMSUpdateListener } from '../../interfaces';
import { HMSPeer } from '../../sdk/models/peer';
import { Store } from '../../sdk/store';
import { PeerNotification } from '../HMSNotifications';
/**
* Handles:
* - New peer join
* - Peer Leave
* - Role update for peer
*
* Notes:
* - Peer join comes with track meta-data,
* we add it to the store and call TrackManager to process it when RTC Track comes in.
*/
export declare class PeerManager {
private store;
private trackManager;
listener?: HMSUpdateListener | undefined;
private readonly TAG;
constructor(store: Store, trackManager: TrackManager, listener?: HMSUpdateListener | undefined);
handleNotification(method: string, notification: any): void;
handlePeerList: (peers: PeerNotification[]) => void;
handlePeerJoin: (peer: PeerNotification) => void;
handlePeerLeave: (peer: PeerNotification) => void;
handlePeerUpdate(notification: PeerNotification): void;
handlePeerInfoUpdate({ peer, name, data }: {
peer?: HMSPeer;
name?: string;
data?: string;
}): void;
private makePeer;
private updateSimulcastLayersForPeer;
}