Alex Choroshin
Alex Choroshin

Reputation: 6187

Loom SDK: How to configure camera-only recording mode?

I'm trying to implement camera-only recording using the Loom SDK (version 2.2.0), but I'm having trouble getting it to work. I want to restrict the recording to webcam only, without screen sharing.

Here's my current implementation:

import {createInstance} from "@loomhq/record-sdk";

const PUBLIC_APP_ID = "xxx";

async function configureRecordButton(buttonElement) {
    try {
        const {configureButton} = await createInstance({
            publicAppId: PUBLIC_APP_ID,
            mode: 'standard',
            config: {
                allowedRecordingTypes: ["cam"],
                defaultRecordingType: "cam"
            }
        });
        const sdkButton = configureButton({
            element: buttonElement
        });
// ... event listeners ...
    } catch (error) {
        console.error(`Error setting up Loom: ${error.message}`);
        return null;
    }
}

According to the Loom SDK types, RecordingType should be:

enum RecordingType {
    ScreenAndCamera = "screen_cam",
    ScreenOnly = "screen",
    CameraOnly = "cam"
}

However, when I try to use "cam" as the recording type, it's not working as expected. The recorder still shows options for screen recording.

What I've tried:

Expected behavior:

Actual behavior:

Is there something I'm missing in the configuration? How can I properly restrict the recording to camera-only mode?

Environment:

Upvotes: 0

Views: 29

Answers (0)

Related Questions