RTCForge API Reference v1.1.1
    Preparing search index...

    Interface CallOptions

    Configuration for a Call (and the PeerConnections it creates). All fields are optional; sensible defaults apply when omitted.

    interface CallOptions {
        candidateFilter?: (candidate: RTCIceCandidate) => boolean;
        codec?: string;
        iceServers?: RTCIceServer[];
        isPolite?: (localPeerId: string, remotePeerId: string) => boolean;
        logger?: Logger;
        maxBitrate?: number;
        maxIceRestarts?: number;
        metrics?: MetricsCollector;
        negotiationTimeoutMs?: number;
        peerConnectionFactory?: (config: RTCConfiguration) => RTCPeerConnection;
        rtcConfig?: RTCConfiguration;
        screenShare?: {
            codec?: string;
            contentHint?: "text" | "motion" | "detail";
            maxBitrate?: number;
        };
        simulcast?: {
            layers: {
                maxBitrate: number;
                rid: string;
                scaleResolutionDownBy?: number;
            }[];
        };
        stopTracksOnClose?: boolean;
        stream?: MediaStream;
    }
    Index

    Properties

    candidateFilter?: (candidate: RTCIceCandidate) => boolean

    Predicate used to drop unwanted ICE candidates before they are signaled. Return false to filter.

    codec?: string

    Preferred send codec, matched case-insensitively against the codec mime type (e.g. "VP9").

    iceServers?: RTCIceServer[]

    ICE servers (STUN/TURN) used for connectivity establishment.

    isPolite?: (localPeerId: string, remotePeerId: string) => boolean

    Determines which side is the "polite" peer for perfect negotiation. Defaults to comparing peer ids (localPeerId < remotePeerId). The polite peer rolls back on offer collisions; the impolite peer ignores the colliding remote offer.

    logger?: Logger

    Logger used for diagnostics. Defaults to a no-op logger.

    maxBitrate?: number

    Default maximum send bitrate, in bits per second, applied to published tracks.

    maxIceRestarts?: number

    Number of ICE restarts to attempt (impolite side) before dropping a connection that reaches the failed state, letting a transient network blip recover instead of tearing down the call.

    1

    Optional metrics collector.

    negotiationTimeoutMs?: number

    If set, a peer whose renegotiation does not complete within this many milliseconds is dropped.

    peerConnectionFactory?: (config: RTCConfiguration) => RTCPeerConnection

    Factory for the underlying RTCPeerConnection, e.g. to inject a Node WebRTC implementation.

    rtcConfig?: RTCConfiguration

    Additional RTCConfiguration merged into the peer connection config (e.g. bundle policy).

    screenShare?: {
        codec?: string;
        contentHint?: "text" | "motion" | "detail";
        maxBitrate?: number;
    }

    Overrides applied specifically to screen-share tracks added via Call.addScreenTrack.

    Type Declaration

    • Optionalcodec?: string

      Preferred codec for the screen-share track.

    • OptionalcontentHint?: "text" | "motion" | "detail"

      Content hint that tunes the encoder for the given content type.

    • OptionalmaxBitrate?: number

      Maximum send bitrate for the screen-share track, in bits per second.

    simulcast?: {
        layers: {
            maxBitrate: number;
            rid: string;
            scaleResolutionDownBy?: number;
        }[];
    }

    Simulcast configuration; each entry becomes an RTP send encoding on published tracks.

    Type Declaration

    • layers: { maxBitrate: number; rid: string; scaleResolutionDownBy?: number }[]

      Ordered simulcast layers (RID, max bitrate, and optional resolution downscale factor).

    stopTracksOnClose?: boolean

    When true, Call.close calls track.stop() on the local tracks (turning off the camera/mic). Leave false if the app owns and reuses the stream elsewhere.

    false

    stream?: MediaStream

    Initial local stream whose tracks are published to every peer connection.