07-19-2021 11:20 PM - edited 09-09-2021 08:40 PM
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');
}
Solved! Go to Solution.
08-02-2021 12:11 AM - edited 08-02-2021 12:12 AM
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);
09-09-2021 08:34 PM - edited 09-09-2021 08:42 PM
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!
08-02-2021 12:11 AM - edited 08-02-2021 12:12 AM
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);
09-09-2021 08:34 PM - edited 09-09-2021 08:42 PM
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!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide