Circle V2 API Docs
    Preparing search index...

    Decides which stream the recorder records and how the mic is swapped, without the recorder or the UI knowing about it. The strategy never touches the recorder — it only returns streams; the RecordingProvider owns all recorder.* calls. This keeps the asymmetry between recording paths (mic-only must switchStream; a mixer-backed path must not, because the recorded stream is stable) encapsulated in one place.

    type CaptureStrategy = {
        changeDevice: (
            newMicStream: MediaStream,
        ) => MediaStream | null | Promise<MediaStream | null>;
        resume: (newMicStream: MediaStream) => MediaStream | Promise<MediaStream>;
        start: (
            micStream: MediaStream,
        ) => Promise<{ cleanup: () => void; stream: MediaStream }>;
    }
    Index

    Properties

    changeDevice: (
        newMicStream: MediaStream,
    ) => MediaStream | null | Promise<MediaStream | null>

    Mic-device change while recording. Returns the stream to hand to recorder.switchStream, or null if the strategy swapped its mic input internally (mixer) and the recorded stream is unchanged.

    resume: (newMicStream: MediaStream) => MediaStream | Promise<MediaStream>

    Returns the stream to pass to recorder.resume.

    start: (
        micStream: MediaStream,
    ) => Promise<{ cleanup: () => void; stream: MediaStream }>

    Returns the stream to record + a cleanup to run when recording fully ends.