Questions regarding the new LocalRecording feature

For reference, the following is what I currently do to workaround the “user leave without stopping local recording” issue.

const api = new JitsiMeetExternalAPI('MEET.DOMAIN.COM', {
    roomName: 'YourRoomName',
    parentNode: document.querySelector('#meet'),
    configOverwrite: {
        // Intercept button click of 'hangup' (Leave) and 'end-meeting' (End meeting for all)
        buttonsWithNotifyClick: ['hangup', 'end-meeting']
    }
};);

// track local recording state
let localRecordingInProgress = false;
api.addListener("recordingStatusChanged", function (e) {
    if (e.mode === "local") {
        localRecordingInProgress = e.on || false;
    }
})

api.addListener("toolbarButtonClicked", function (e) {
    // When hangup button click, show warning instead of leave if local recording still in progress
    if (e.key === 'hangup') {
        if (localRecordingInProgress) {
            api.executeCommand("showNotification", {
                title: "Recording still in progress",
                description: "Please stop the recording before leaving the room in order to save it.",
                type: "warning",
                timeout: "medium",
            })
        } else {
            // Local recording not active. Proceed with hangup.
            api.executeCommand('hangup');
        }
    } else if (e.key === 'end-meeting') {
        if (localRecordingInProgress) {
            api.executeCommand("showNotification", {
                title: "Recording still in progress",
                description: "Please stop the recording before ending the meeting in order to save it.",
                type: "warning",
                timeout: "medium",
            })
        } else {
            // Local recording not active. Proceed with hangup.
            api.executeCommand('endConference');
        }
    }
});

N.B:

  • This handles case where use clicks Leave button before stopping local recording. It cannot however deal with the case where user closes the tab or navigates away.
  • Handling of end-meeting relies on IFrame API commands introduced in jitsi-meet 8072 (unstable) which, at the point of writing, has not yet hit stable.
1 Like

@saghul Now that the workaround above is no longer viable for meet.jit.si due to reliance on IFrame API, is this a good time to revisit if there is something that can be done about this?

There’s been several topics already about folks losing local recordings because they left the conference before stopping recording.

I can appreciate that automatically saving of recording on page unload is non-trivial, but some form of warning or confirmation dialog on hangup or end-conference might suffice for now to address some of the concerns?

It should actually be doable with a beforeunload handler no? Would you like to give it a try?

Would love to, but don’t have the bandwidth for the next few weeks I’m afraid. I’ll check back at some point and take a look if nobody has picked this up. I may have to bug you for pointers on where to begin :smiley:

No worries!

Can anyone help me how to enabling local recording within a self-hosted Jitsi

You should activate related params in your config.js but IIRC it should be enabled by default.

I already make changes
/usr/share/jitsi-meet-web-config/config.js
/etc/jitsi/meet/xxxx.xxxx.com-config.js
already removed // , value false, but don’t show local records

Note that local recording only works in Chromium based browsers.

thanks for your reply, is there anyway to support other browsers

Unfortunately not. They do t provide the necessary APIs.