UNPKG

@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

20 lines (19 loc) 1.52 kB
import { EventBus } from '../events/EventBus'; import { HMSPeerStats, HMSTrackStats, PeerConnectionType } from '../interfaces/webrtc-stats'; import { HMSLocalTrack, HMSRemoteTrack } from '../media/tracks'; export declare const getLocalTrackStats: (eventBus: EventBus, track: HMSLocalTrack, peerName?: string, prevTrackStats?: Record<string, HMSTrackStats>) => Promise<Record<string, HMSTrackStats> | undefined>; export declare const getTrackStats: (eventBus: EventBus, track: HMSRemoteTrack, peerName?: string, prevTrackStats?: HMSTrackStats) => Promise<HMSTrackStats | undefined>; export declare const getLocalPeerStatsFromReport: (type: PeerConnectionType, report?: RTCStatsReport, prevStats?: HMSPeerStats) => (RTCIceCandidatePairStats & { bitrate: number; }) | undefined; export declare const getActiveCandidatePairFromReport: (report?: RTCStatsReport) => RTCIceCandidatePairStats | undefined; export declare const getPacketsLostAndJitterFromReport: (report?: RTCStatsReport) => { packetsLost: number; jitter: number; }; export declare const union: <T>(arr1: T[], arr2: T[]) => T[]; /** * Ref: https://github.dev/peermetrics/webrtc-stats/blob/b5c1fed68325543e6f563c6d3f4450a4b51e12b7/src/utils.ts#L62 */ export declare const computeBitrate: <T extends HMSTrackStats>(statName: keyof T, newReport?: Partial<T> | undefined, oldReport?: Partial<T> | undefined) => number; export declare const computeNumberRate: (newVal?: number, oldVal?: number, newTimestamp?: number, oldTimestamp?: number) => number;