import { EnhancedEventEmitter } from '../EnhancedEventEmitter'; import { ProducerCodecOptions } from '../Producer'; import { IceParameters, IceCandidate, DtlsParameters, ConnectionState } from '../Transport'; import { RtpCapabilities, RtpCodecCapability, RtpParameters, RtpEncodingParameters } from '../RtpParameters'; import { SctpCapabilities, SctpParameters, SctpStreamParameters } from '../SctpParameters'; export type HandlerFactory = () => HandlerInterface; export type HandlerRunOptions = { direction: 'send' | 'recv'; iceParameters: IceParameters; iceCandidates: IceCandidate[]; dtlsParameters: DtlsParameters; sctpParameters?: SctpParameters; iceServers?: RTCIceServer[]; iceTransportPolicy?: RTCIceTransportPolicy; additionalSettings?: any; proprietaryConstraints?: any; extendedRtpCapabilities: any; }; export type HandlerSendOptions = { track: MediaStreamTrack; encodings?: RtpEncodingParameters[]; codecOptions?: ProducerCodecOptions; codec?: RtpCodecCapability; }; export type HandlerSendResult = { localId: string; rtpParameters: RtpParameters; rtpSender?: RTCRtpSender; }; export type HandlerReceiveOptions = { trackId: string; kind: 'audio' | 'video'; rtpParameters: RtpParameters; /** * Stream id. WebRTC based devices try to synchronize inbound streams with * same streamId. If not given, the consuming device will be told to * synchronize all streams produced by the same endpoint. However libwebrtc * can just synchronize up to one audio stream with one video stream. */ streamId?: string; }; export type HandlerReceiveResult = { localId: string; track: MediaStreamTrack; rtpReceiver?: RTCRtpReceiver; }; export type HandlerSendDataChannelOptions = SctpStreamParameters; export type HandlerSendDataChannelResult = { dataChannel: RTCDataChannel; sctpStreamParameters: SctpStreamParameters; }; export type HandlerReceiveDataChannelOptions = { sctpStreamParameters: SctpStreamParameters; label?: string; protocol?: string; }; export type HandlerReceiveDataChannelResult = { dataChannel: RTCDataChannel; }; export type HandlerEvents = { '@close': []; '@connect': [ { dtlsParameters: DtlsParameters; }, () => void, (error: Error) => void ]; '@connectionstatechange': [ConnectionState]; }; export declare abstract class HandlerInterface extends EnhancedEventEmitter { constructor(); abstract get name(): string; abstract close(): void; abstract getNativeRtpCapabilities(): Promise; abstract getNativeSctpCapabilities(): Promise; abstract run(options: HandlerRunOptions): void; abstract updateIceServers(iceServers: RTCIceServer[]): Promise; abstract restartIce(iceParameters: IceParameters): Promise; abstract getTransportStats(): Promise; abstract send(options: HandlerSendOptions): Promise; abstract stopSending(localId: string): Promise; abstract pauseSending(localId: string): Promise; abstract resumeSending(localId: string): Promise; abstract replaceTrack(localId: string, track: MediaStreamTrack | null): Promise; abstract setMaxSpatialLayer(localId: string, spatialLayer: number): Promise; abstract setRtpEncodingParameters(localId: string, params: any): Promise; abstract getSenderStats(localId: string): Promise; abstract sendDataChannel(options: HandlerSendDataChannelOptions): Promise; abstract receive(optionsList: HandlerReceiveOptions[]): Promise; abstract stopReceiving(localIds: string[]): Promise; abstract pauseReceiving(localIds: string[]): Promise; abstract resumeReceiving(localIds: string[]): Promise; abstract getReceiverStats(localId: string): Promise; abstract receiveDataChannel(options: HandlerReceiveDataChannelOptions): Promise; } //# sourceMappingURL=HandlerInterface.d.ts.map