Function useWebRTC

  • Parameters

    • config: RTCConfig = {}

    Returns {
        addIceCandidate: (candidate: RTCIceCandidateInit) => Promise<boolean>;
        close: () => void;
        createAnswer: (
            offer: RTCSessionDescriptionInit,
        ) => Promise<null | RTCSessionDescriptionInit>;
        createDataChannel: (
            label: string,
            options?: RTCDataChannelInit,
        ) => null | RTCDataChannel;
        createOffer: () => Promise<null | RTCSessionDescriptionInit>;
        createPeerConnection: () => null | RTCPeerConnection;
        isSupported: boolean;
        get state(): RTCState;
        subscribe(callback: (state: RTCState) => void): () => boolean;
    }