cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1973
Views
11
Helpful
2
Replies

Macro to swap monitors connecting to Room Kit Plus

Hi All,

 

I would like to create a macro to swap the monitors connecting to Room Kit Plus but the codes below does not work. Seems even the "MonitorRoles" are swapped, there is no effect to the monitors during a call. Appreciate if anyone could help.

 

if (xapi.Config.Video.Output.Connector[1].MonitorRole.get()=== 'Second') {

xapi.config.set('Video Output Connector 2 MonitorRole', 'Second');
xapi.config.set('Video Output Connector 1 MonitorRole', 'First');

}
else {

xapi.config.set('Video Output Connector 1 MonitorRole', 'Second');
xapi.config.set('Video Output Connector 2 MonitorRole', 'First');

}

 

2 Accepted Solutions

Accepted Solutions

tomas_vll
Level 1
Level 1

This works for me

import xapi from 'xapi';

function guiEvent(event) {
  
  if (event.Clicked.PanelId === 'SwitchMonitors'){
 
    xapi.Config.Video.Output.Connector.get().then(switchMon); // Async function, might as well do a =>
    
  }
}

function switchMon(conf){
  let roleFirst = conf[0]['MonitorRole'];
  let roleSecond = conf[1]['MonitorRole'];

  xapi.Config.Video.Output.Connector[1]['MonitorRole'].set(roleSecond);
  xapi.Config.Video.Output.Connector[2]['MonitorRole'].set(roleFirst);

}


xapi.event.on('UserInterface Extensions Panel', guiEvent);

 

View solution in original post

Hi tomas_vll, that works perfectly for me!

I tried another macros which detect the call status and swap the monitors automatically, however, it can only detect when the presentation is started by the local user, but it does not include a function to detect when a presentation is started by a remote participant (it only detect if the remote participant share the video, seems cannot determine if it is a presentation), so it still does not work. Not sure if there is a status to tell if it is a camera video or a presentation video that the remote participant shared. Anyway, a swap monitor button can help at the moment!

Thanks again!

View solution in original post

2 Replies 2

tomas_vll
Level 1
Level 1

This works for me

import xapi from 'xapi';

function guiEvent(event) {
  
  if (event.Clicked.PanelId === 'SwitchMonitors'){
 
    xapi.Config.Video.Output.Connector.get().then(switchMon); // Async function, might as well do a =>
    
  }
}

function switchMon(conf){
  let roleFirst = conf[0]['MonitorRole'];
  let roleSecond = conf[1]['MonitorRole'];

  xapi.Config.Video.Output.Connector[1]['MonitorRole'].set(roleSecond);
  xapi.Config.Video.Output.Connector[2]['MonitorRole'].set(roleFirst);

}


xapi.event.on('UserInterface Extensions Panel', guiEvent);

 

Hi tomas_vll, that works perfectly for me!

I tried another macros which detect the call status and swap the monitors automatically, however, it can only detect when the presentation is started by the local user, but it does not include a function to detect when a presentation is started by a remote participant (it only detect if the remote participant share the video, seems cannot determine if it is a presentation), so it still does not work. Not sure if there is a status to tell if it is a camera video or a presentation video that the remote participant shared. Anyway, a swap monitor button can help at the moment!

Thanks again!