Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat: Hide only the video of a participant from the recorder (#17816)

bgrozev5f7ce9a6ce4f
diff --git a/conference.js b/conference.js
index 4f15c46671..530ae911cf 100644
--- a/conference.js
+++ b/conference.js
@@ -1376,10 +1376,18 @@ export default {
return;
}
- // The logic shared between RN and web.
- commonUserJoinedHandling(APP.store, room, user);
+ // A participant whose video is hidden from the recorder is handled like a hidden participant: it is not
+ // added to the state, so it gets no tile. Its audio tracks are still added (see TRACK_ADDED below), and
+ // they are played and recorded. The optional call keeps this working with a lib-jitsi-meet release
+ // which does not have the method yet.
+ const videoHiddenFromRecorder = config.iAmRecorder && user.isVideoHiddenFromRecorder?.();
+
+ if (!videoHiddenFromRecorder) {
+ // The logic shared between RN and web.
+ commonUserJoinedHandling(APP.store, room, user);
+ }
- if (user.isHidden()) {
+ if (user.isHidden() || videoHiddenFromRecorder) {
return;
}
@@ -1389,10 +1397,14 @@ export default {
});
room.on(JitsiConferenceEvents.USER_LEFT, (id, user) => {
- // The logic shared between RN and web.
- commonUserLeftHandling(APP.store, room, user);
+ const videoHiddenFromRecorder = config.iAmRecorder && user.isVideoHiddenFromRecorder?.();
+
+ if (!videoHiddenFromRecorder) {
+ // The logic shared between RN and web.
+ commonUserLeftHandling(APP.store, room, user);
+ }
- if (user.isHidden()) {
+ if (user.isHidden() || videoHiddenFromRecorder) {
return;
}
@@ -1434,6 +1446,11 @@ export default {
if (participant.isHiddenFromRecorder()) {
return;
}
+
+ // Only the video of this participant is hidden from the recorder. Its audio is still recorded.
+ if (participant.isVideoHiddenFromRecorder?.() && track.isVideoTrack()) {
+ return;
+ }
}
APP.store.dispatch(trackAdded(track));