@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
25 lines (24 loc) • 1.24 kB
TypeScript
import ISubscribeConnectionObserver from './ISubscribeConnectionObserver';
import { InitFlags } from '../../signal/init/models';
import JsonRpcSignal from '../../signal/jsonrpc';
import { PreferAudioLayerParams, PreferLayerResponse, PreferVideoLayerParams } from '../channel-messages';
import HMSConnection from '../HMSConnection';
export default class HMSSubscribeConnection extends HMSConnection {
private isFlagEnabled;
private readonly TAG;
private readonly remoteStreams;
protected readonly observer: ISubscribeConnectionObserver;
private readonly MAX_RETRIES;
readonly nativeConnection: RTCPeerConnection;
private pendingMessageQueue;
private apiChannel?;
private eventEmitter;
private initNativeConnectionCallbacks;
constructor(signal: JsonRpcSignal, config: RTCConfiguration, isFlagEnabled: (flag: InitFlags) => boolean, observer: ISubscribeConnectionObserver);
sendOverApiDataChannel(message: string): void;
sendOverApiDataChannelWithResponse<T extends PreferAudioLayerParams | PreferVideoLayerParams>(message: T, requestId?: string): Promise<PreferLayerResponse>;
close(): void;
private handlePendingApiMessages;
private sendMessage;
private waitForResponse;
}