cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

AMA-CUCM Troubleshooting: Best Practices for Reading Trace Files

Switch Display Sources on Webex Room KIT

316
Views
0
Helpful
2
Comments
Beginner

Hello Experts.

 

We would like to write macro to create a button to switch sources during a call. The only possible view today is content on upside and participants down. This is not the best experience for user's perspective.

 

Someone, could please help-me send a macro code to do this challenge?

 

Dual Screens (Vertical Set).jpgVertical Set

2 Comments

Hello,

You can use a macro to adjust Monitor role settings. This specific macro below, was made for an Sx80/pro, so you will need to. edit to avoid an errors, as the system you're using has no third output.

I used the Group Button for this code, and the Values for each button, are each case in the script.

Good Luck, and hopefully this helps. 

const xapi = require('xapi');

xapi.event.on('UserInterface Extensions Widget Action', (event) => {
  if (event.Type == 'released'){
        switch(event.Value){
            case 'display_scene_1': // Far End Presentation Mode
                xapi.command('UserInterface Message TextLine Clear');
                xapi.command('UserInterface Message TextLine Display', {
                                                                  Text: 'Layout: Default',
                                                                  Duration: 30,
                                                                  X: 5000,
                                                                  Y: 10000
                });
                console.log('LayoutSelected= Default');
                xapi.config.set('Video Output Connector 1 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 2 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 3 MonitorRole', 'first');
                xapi.command('Video Layout LayoutFamily Set', {
                              Target: 'Local',
                              LayoutFamily: 'Prominent',
                });
                break;
            case 'display_scene_2': // Local Presentation Mode
                xapi.command('UserInterface Message TextLine Clear');
                xapi.command('UserInterface Message TextLine Display', {
                                                                  Text: 'Layout: Local Presenter',
                                                                  Duration: 30,
                                                                  X: 5000,
                                                                  Y: 10000
                });
                console.log('LayoutSelected= Local Presenter');
                xapi.config.set('Video Output Connector 1 MonitorRole', 'second');
                xapi.config.set('Video Output Connector 2 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 3 MonitorRole', 'first');
                break;
            case 'display_scene_3':// Presentation All Mode
                xapi.command('UserInterface Message TextLine Clear');
                xapi.command('UserInterface Message TextLine Display', {
                                                                  Text: 'Layout: Shared Content Only',
                                                                  Duration: 30,
                                                                  X: 5000,
                                                                  Y: 10000
                });
                console.log('LayoutSelected= Shared Content Only');
                xapi.config.set('Video Output Connector 1 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 2 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 3 MonitorRole', 'first');
                xapi.command('Video Layout LayoutFamily Set', {
                              Target: 'Local',
                              LayoutFamily: 'Single',
                });
                break;
            case 'display_scene_5':// Presentation All w/Far PIP && Far End All
                xapi.command('UserInterface Message TextLine Clear');
                xapi.command('UserInterface Message TextLine Display', {
                                                                  Text: 'Layout: Shared Content w/Remote PIP Dual',
                                                                  Duration: 30,
                                                                  X: 5000,
                                                                  Y: 10000
                });
                console.log('LayoutSelected= Shared Content w/Remote PIP Dual');
                xapi.config.set('Video Output Connector 1 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 2 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 3 MonitorRole', 'first');
                xapi.command('Video Layout LayoutFamily Set', {
                              Target: 'Local',
                              LayoutFamily: 'overlay',
                });
                break;
            case 'display_scene_4':
                xapi.command('UserInterface Message TextLine Clear');
                xapi.command('UserInterface Message TextLine Display', {
                                                                  Text: 'Layout: Shared Content w/Remote PIP Single',
                                                                  Duration: 30,
                                                                  X: 5000,
                                                                  Y: 10000
                });
                console.log('LayoutSelected= Shared Content w/Remote PIP Single');
                xapi.config.set('Video Output Connector 1 MonitorRole', 'first');// Output 1 = First
                xapi.config.set('Video Output Connector 2 MonitorRole', 'presentationonly');
                xapi.config.set('Video Output Connector 3 MonitorRole', 'first');// Output 2 = First
                xapi.command('Video Layout LayoutFamily Set', {
                              Target: 'Local',
                              LayoutFamily: 'overlay',
                });
                break;
           case 'display_scene_6':// Button VALUE ID
              console.log('LayoutSelected= Half and Half');
                xapi.config.set('Video Output Connector 1 MonitorRole', 'first');// Output 1 = First
                xapi.config.set('Video Output Connector 2 MonitorRole', 'first');
                xapi.config.set('Video Output Connector 3 MonitorRole', 'first');// Output 2 = First
                xapi.command('Video Layout LayoutFamily Set', {
                              Target: 'Local',
                              LayoutFamily: 'equal',
                });
                break;
            default:
                break;
        }
  }
});
Beginner

Hello.

I belive that I found the solution, please refer to: API Reference Guide CE 9.7

 

So, the macro code would be like:

Macro Code Switch_Display.JPG

 

Unfortunately, this code does not compile. (error in writting).

We are almost there, seems to be close to solve it !

 

Thank You for any helping.

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards