Record Presenter Mode through the API

Thank you for this excellent tool. I am trying to record presenter mode through the API. I have multiple recording jibri installed and it works great recording the camera, but want to also record the screen share. How do I add/merge the two tracks? Any assistance would be greatly appreciated.

After you start the screen-share you can unmute your camera and both will be available.

Thank you Saghul and thanks for your involvement and posts in the community. I have learned a lot from your post. I am able to start the presenter mode but am attempting to record both the screen and camera through the API using
api.executeCommand(‘startRecording’, {
mode: ‘file’, //recording mode, either file or stream.
});
I am not clear how to create one composite video stream to record. I can get the camera image from canvas and can obtain the screen with navigator.mediaDevices.getDisplayMedia({video: true});

but I am at a loss as how to combine on one track. Would you please give me some pointers or direction? Do I have to emulate a lot of the presenter mode code? I am trying to do this so that the screen and camera are started on page load and the recording of both initiated with an eventListener(button push).

That command will trigger a recording through Jibri, which joins the meeting as a hidden participant and does the recording. You don’t need to do any composition.

Are you perhaps trying to record this meeting “locally” in your own machine while participating in it?

That, local recordings, is coming very soon.

Hello, Thank you for your reply!
No not trying locally, I am streaming to a Jibri server and recording. Everything is working well streaming and recording the camera through the JitsiMeetExternalAPI, but I need to record the screen share as well and am having trouble, so far, combining the screen share and camera output on a single track to record through the API with api.executeCommand(“startRecording”). If I could simply record the Presenter Mode output through the API it would be ideal and is the goal but I can’t seem to record both simultaneously.

Jibri records its virtual desktop screen. If clients can see the presenter mode then jibri should also see it and record it.

Does the presenter mode work for normal participants?

Thank You emrah. Yes, presenter mode works using the screen-share then adding the camera. What I am attempting to do is avoid the user input needed to start screen-share then add camera(through toolbar) and instead, have screen-share and camera(presenter mode) initiated on page load, then start recording through the API with a button event. I have a successful, multiple-jibri setup on two servers and recording works well. I just need to compose the scree-share/camera load on page load instead of through the toolbar, then initiate the recoding of both. Thank you for any suggestions.

IIUC the main problem is not directly related in recording. You need to find a way to start the presenter mode without user interaction. Is this correct or am I missing something?

Yes, precisely.

Starting presenter mode automatically can be done by using the video unmute API once you are screen sharing.

The problem is you can start screen-sharing without user interaction, the browser no longer allows it.

Thank you! Huge tip. I was able to successfully start in screen share mode by setting startScreenSharing: true in config.js, and will attempt to add the camera using the video unmute API you mentioned. Thanks again!!

Note the warning, that option will not work in some cases and will be removed:

Lol I made a typo in the most critical part. @drenzla thet functionality will be going away entirely because browsers no longer allow it. IIRC Firefox and Safari already implement it.

Dang. Ok. Clearly states it in the config itself. I will make the flow work then after the interaction. The main thing I was trying to avoid was having the user start presenter mode using the toolbar, and I am getting closer. Thanks for pointing it out and the feedback about the video unmute API.

1 Like