config.iAmRecorder and customization

Hi folks!

I made Jitsi+Jibri installation and faced with a problem: I need to capture and record video from only one person(e.g., not a moderator)

I know Jibri sets config.iAmRecorder = true; after login and the possible solution is to modify JS to check iAmRecorder and force-pin video of the participant.
So question are:

  1. Where i should insert
    if (config.iAmRecorder) { doPin(); }
    to run it after web-interface initialization?
  2. Which JS API i should use to pin the users video?

Thanks in advance!

Currently jibri is using that and is following whatever is happening in the conference. And if someone wants to change that, it just enables follows me and pins the participant to be in the recording …
If you want to pin someone you should be doing that after participant joins …

Let’s assume that we have all participant before jibri connect.
I want to pin certain participant in jibri chromium webdriver(Only in UI for Jibri).
Is there some workaround like API.UI.pin(participant_id) to evaluate it in WebDriver or put it under if(config.iAmRecorder) in the main code for UI?
I am ready to do it in my own jitsi/jibri build

Hi @damencho can we do it like, a conference is with 2 participant and by default the pin will be set to 2nd participant.

Thanks,

/usr/share/jitsi-meet/body.html

<script>
var activeMember = -1;

function setFocusedMember() {
  try {
    const myId = APP.conference.getMyUserId();
    const plist= APP.store.getState()["features/base/participants"];
    const pl = plist.findIndex(
                 item => item.role != 'moderator' && item.id != myId);

    if (pl && pl != -1 && activeMember != pl) { APP.UI.clickOnVideo(pl); }
    activeMember = pl;
  } catch(e) {
    // nothing to do
  } finally {
    setTimeout(function() {setFocusedMember();}, 3000);
  }
}

function focusToMember() {
  try {
    var isRecorder = APP.store.getState()["features/base/config"].iAmRecorder;

    if (!isRecorder) return false;
    APP.store.getState()["features/video-layout"].tileViewEnabled = false;

    setTimeout(function() {setFocusedMember();}, 3000);
  } catch(e) {
    setTimeout(function() {focusToMember();}, 3000);
  }
}

focusToMember();
</script>

Thanks a ton @emrah, It is working perfectly.

1 Like

Hi @emrah , This code is not working in jitsi-meet 2.0.5870-1. Can you please give some light on this? Thanks,

/usr/share/jitsi-meet/body.html

<script>
var PIN_PARTICIPANT = 'PIN_PARTICIPANT';

function pinParticipant(id) {
  return {
    type: PIN_PARTICIPANT,
    participant: {
      id
    }
  };
}

function focusToMember() {
  try {
    const myId = APP.conference.getMyUserId();
    const pl= APP.store.getState()["features/base/participants"];
    const p = pl.find(item => item.role != 'moderator');

    if (p) {
        APP.store.dispatch(pinParticipant(p.id));
    }
  } catch(e) {
    // nothing to do
  } finally {
    setTimeout(function() {focusToMember();}, 3000);
  }
}

function setFocus() {
  try {
    const isRecorder = APP.store.getState()["features/base/config"].iAmRecorder;
    if (!isRecorder) return false;

    APP.store.getState()["features/video-layout"].tileViewEnabled = false;
    APP.store.getState()["features/filmstrip"].visible = false;

    setTimeout(function() {focusToMember();}, 3000);
  } catch(e) {
    setTimeout(function() {setFocus();}, 3000);
  }
}

setFocus();
</script>
1 Like

Thanks @emrah for a quick response. One quick question do I need to restart all the services or only restart the nginx service will be sufficient?

Thanks @emrah, It is working. Only I have done one change here,

Replace the above line with the below one, you have shared earlier.
const pl = plist.findIndex(
item => item.role != ‘moderator’ && item.id != myId);

Thank dear for your help. You saved my life.

1 Like