cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
396
Views
0
Helpful
1
Replies

SetMatrix Macro fail

Aaron Kennison
Level 1
Level 1

I've been working with the tutorial and examples online to create a UI extension that will show both camera in the conference room at the same time (split screen/PIP). My code doesn't throw any errors and the xCommand I based them on works as expected. My Macro doesn't behave as expected. Instead of getting two cameras I get whichever camera (ConnectorId) is listed second in the code, full screen. Other than that everything works fine. Can someone tell me what I'm missing or doing incorrectly? (see code below and in attachment)

 

import xapi from 'xapi';


function guiEvent(event)

{
if (event.WidgetId === 'Content/Whiteboard') {
xapi.Command.Video.Input.SetMainVideoSource(
{ ConnectorId: 3, ConnectorId: 2, Layout: "Equal"});
}

if (event.WidgetId === 'Standard') {
xapi.Command.Video.Input.SetMainVideoSource(
{ConnectorId: 1, Layout: "Equal"});
}

if (event.WidgetId === 'Audience/Whiteboard') {
xapi.Command.Video.Input.SetMainVideoSource(
{ ConnectorId: 2, ConnectorId: 1, Layout: "Equal"});
}


if (event.WidgetId === 'Content/Audience/Whiteboard') {
xapi.Command.Video.Input.SetMainVideoSource(
{ ConnectorId: 1, ConnectorId: 3, ConnectorId: 2, Layout: "Equal"});
}
}

xapi.Event.UserInterface.Extensions.Widget.Action.on(guiEvent);

1 Reply 1

Alexander Stevenson
Cisco Employee
Cisco Employee

 

H1 @Aaron Kennison,

 

It seems lie with multiple IF statements, only one will ever get executed. An ELIF or even a workaround with a SWITCH CASE won't solve this either. I would try nesting the IF statements somehow.