import { HMSConnectionRole } from './model'; import { HMSLocalTrack } from '../media/tracks'; import { TrackState } from '../notification-manager'; import { ISignal } from '../signal/ISignal'; interface RTCIceCandidatePair { local: RTCIceCandidate; remote: RTCIceCandidate; } export default abstract class HMSConnection { readonly role: HMSConnectionRole; protected readonly signal: ISignal; abstract readonly nativeConnection: RTCPeerConnection; /** * We keep a list of pending IceCandidates received * from the signalling server. When the peer-connection * is initialized we call [addIceCandidate] for each. * * WARN: * - [HMSPublishConnection] keeps the complete list of candidates (for * ice-connection failed/disconnect) forever. * - [HMSSubscribeConnection] clears this list as soon as we call [addIceCandidate] */ readonly candidates: RTCIceCandidateInit[]; selectedCandidatePair?: RTCIceCandidatePair; protected constructor(role: HMSConnectionRole, signal: ISignal); get iceConnectionState(): RTCIceConnectionState; get connectionState(): RTCPeerConnectionState; private get action(); addTransceiver(track: MediaStreamTrack, init: RTCRtpTransceiverInit): RTCRtpTransceiver; createOffer(tracks?: Map, options?: RTCOfferOptions): Promise; createAnswer(options?: RTCOfferOptions | undefined): Promise; setLocalDescription(description: RTCSessionDescriptionInit): Promise; setRemoteDescription(description: RTCSessionDescriptionInit): Promise; addIceCandidate(candidate: RTCIceCandidateInit): Promise; get remoteDescription(): RTCSessionDescription | null; getSenders(): Array; logSelectedIceCandidatePairs(): void; removeTrack(sender: RTCRtpSender): void; setMaxBitrateAndFramerate(track: HMSLocalTrack): Promise; getStats(): Promise; close(): Promise; private getReceivers; } export {};