@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
37 lines (36 loc) • 1.44 kB
TypeScript
import { EventBus } from '../events/EventBus';
import { HMSPeerStats, HMSTrackStats } from '../interfaces/webrtc-stats';
import { Store } from '../sdk/store';
export declare class HMSWebrtcStats {
private store;
private readonly eventBus;
private publishConnection?;
private subscribeConnection?;
private readonly TAG;
private localPeerID?;
private peerStats;
private remoteTrackStats;
private localTrackStats;
/**
* Removed localPeerID check in other places as it will be present before
* this is initialized
*/
constructor(store: Store, eventBus: EventBus, publishConnection?: RTCPeerConnection | undefined, subscribeConnection?: RTCPeerConnection | undefined);
setPeerConnections({ publish, subscribe }: {
publish?: RTCPeerConnection;
subscribe?: RTCPeerConnection;
}): void;
getPublishPeerConnection(): RTCPeerConnection | undefined;
getSubscribePeerConnection(): RTCPeerConnection | undefined;
getLocalPeerStats: () => HMSPeerStats | undefined;
getRemoteTrackStats: (trackId: string) => HMSTrackStats | undefined;
getAllRemoteTracksStats: () => Record<string, HMSTrackStats>;
getLocalTrackStats: () => Record<string, Record<string, HMSTrackStats>>;
/**
* @internal
*/
updateStats: () => Promise<void>;
private updateLocalPeerStats;
private updateRemoteTrackStats;
private updateLocalTrackStats;
}