Documentation
    Preparing search index...

    Interface WebrtcServiceOptions

    Options for createWebrtcService.

    interface WebrtcServiceOptions {
        close?: (
            sessionId: string,
            reason: string | undefined,
            context: WebrtcServiceContext,
        ) => void | Promise<void>;
        destroyWindow?: (windowId: string) => void;
        open?: (
            request: WebrtcOpenRequest,
            context: WebrtcServiceContext,
            plan: WebrtcOpenPlan,
        ) => WebrtcOpenResult | Promise<WebrtcOpenResult>;
        planOpen?: (
            request: WebrtcOpenRequest,
            context: WebrtcServiceContext,
        ) => WebrtcOpenPlan;
        revokeWindow?: (windowId: string) => void;
        send?: (
            sessionId: string,
            payload: unknown,
            context: WebrtcServiceContext,
        ) => void | Promise<void>;
        sendBytes?: (
            sessionId: string,
            bytes: Uint8Array,
            context: WebrtcServiceContext,
        ) => void | Promise<void>;
    }
    Index

    Properties

    close?: (
        sessionId: string,
        reason: string | undefined,
        context: WebrtcServiceContext,
    ) => void | Promise<void>
    destroyWindow?: (windowId: string) => void
    open?: (
        request: WebrtcOpenRequest,
        context: WebrtcServiceContext,
        plan: WebrtcOpenPlan,
    ) => WebrtcOpenResult | Promise<WebrtcOpenResult>

    Host-owned peer setup, called only under the approved plan.

    planOpen?: (
        request: WebrtcOpenRequest,
        context: WebrtcServiceContext,
    ) => WebrtcOpenPlan

    Select signaling and peer/room resources without creating a controller or peer.

    revokeWindow?: (windowId: string) => void

    Physically stop peer and signaling work when authorization is revoked.

    send?: (
        sessionId: string,
        payload: unknown,
        context: WebrtcServiceContext,
    ) => void | Promise<void>
    sendBytes?: (
        sessionId: string,
        bytes: Uint8Array,
        context: WebrtcServiceContext,
    ) => void | Promise<void>

    Send one decoded byte sequence as a single binary payload (NAP-WEBRTC sendBytes). The service has already rejected non-canonical base64 and payloads over the session's maxPayloadBytes; the hook must never send the base64 text. Without this hook webrtc.sendBytes answers unsupported.