MockRTC API Reference
    Preparing search index...

    Interface MockRTCSession

    Once a connection has been created, you can access its session API. This allows for renegotiation of an existing session, while persisting the same connection and ongoing handling process.

    interface MockRTCSession {
        sessionId: string;
        answerOffer(
            offer: RTCSessionDescriptionInit,
            options?: AnswerOptions,
        ): Promise<MockRTCSessionDescription>;
        completeOffer(answer: RTCSessionDescriptionInit): Promise<void>;
        createOffer(options?: OfferOptions): Promise<MockRTCSessionDescription>;
    }
    Index
    sessionId: string

    For most use cases explicitly using the session ID isn't necessary.

    For some advanced use cases though, it's more convenient to store session ids and use peer.getSession, rather than using the session property from the setup methods directly.

    • Provide an answer to complete an offer for this session, to renegotiate the existing connection.

      Parameters

      • answer: RTCSessionDescriptionInit

      Returns Promise<void>