@4players/odin
Version:
A cross-platform SDK enabling developers to integrate real-time VoIP chat technology into their projects
36 lines (35 loc) • 928 B
TypeScript
import { OdinStream } from './stream';
export declare class OdinRtcHandler {
private _worker;
private _rtc;
/**
* The `RTCDataChannel` for transmitting audio data.
*/
private _audioChannel;
/**
* Creates a new `RtcHandler` instance.
*
* @param _worker The web worker to handle audio
*/
constructor(_worker: Worker, _rtc: RTCPeerConnection);
/**
* Get the DataChannel for audio.
*/
get audioChannel(): RTCDataChannel;
/**
* Returns a promise which resolves with data providing statistics about the RTC connection.
*
* @returns A promise providing connection statistics
*/
getStats(): Promise<RTCStatsReport>;
/**
* Starts WebRTC on the given stream.
*
* @param mainStream
*/
startRtc(mainStream: OdinStream): Promise<void>;
/**
* Close the RTC peer connection.
*/
stopRtc(): void;
}