Introduction
This document describes how to enable a button powered by Macros that switches SpeakerTrack and PresenterTrack mode in WebEx Room Devices.
Prerequisites
Requirements
Cisco recommends that you have knowledge of these topics:
Components Used
The information in this document is based on these software and hardware versions:
- Collaboration Endpoints (CE) 9.15.
- Any cloud software version.
Configure
Endpoint Configuration
Step 1. Log in to the device Web Interface.
![Endpoint admin web login](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-00.png)
Step 2. Navigate to Customization > Macro Editor.
![Endpoint Menu](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-01.png)
Step 3. In the Macros menu, select Create new macro.
![Endpoint Menu](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-02.png)
Note: If the error Macros are currently disabled on this system appears, select Enable Macros.
![Endpoint Menu](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-03.png)
Strep 4. When macros are enabled, a new file is created, as shown in the next image:
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-04.png)
Step 5. Copy and paste the next code:
import xapi from 'xapi';
const presenterTrackConnectorID = 2;
function handleError(error){
console.log('Error:', error);
}
function changeCameraInput(){
xapi.command('Video Input SetMainVideoSource', {
ConnectorId: presenterTrackConnectorID,
}).catch(handleError);
}
function enablePresenterTrack(){
xapi.command('Cameras PresenterTrack Set', {
Mode: 'Follow',
}).catch(handleError);
}
function enableSpeakerTrack(){
xapi.command('Cameras SpeakerTrack Activate').catch(handleError);
}
function presenterTrackChanger(event){
if(event.PanelId === 'PresenterMode'){
xapi.status
.get('Cameras PresenterTrack Status')
.then((value) => {
//console.log(value);
if(value === 'Off'){
changeCameraInput();
enablePresenterTrack();
console.log('Presenter Track Enabled');
}else{
enableSpeakerTrack();
console.log('Speaker Track Enabled');
}
});
}
}
xapi.event.on('UserInterface Extensions Panel Clicked',presenterTrackChanger);
Step 6. Select the engine next to the file name and select Save to System.
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-05.png)
Step 7. Navigate to Customization > UI Extensions Editor.
![Endpoint Menu](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-06.png)
Step 8. In order to create the button, select New.
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-07.png)
Step 9. Select Add from the Action Button section.
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-08.png)
Step 10. Once the button is created you just need to customize, from the Properties section, select the next configuration:
Id |
PresenterMode |
Name |
MODE |
Button visibility |
Always |
Icon |
Camera |
![Endpoint Menu](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-09.png)
Step 11. Button is created and shown in the left panel.
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-10.png)
Verify
If the macros are created correctly, you see the output shown in the next image:
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-11.png)
Navigate to UI Extensions configuration and select the view button in the upper left.
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-12.png)
If everything is configured correctly, you must see the next output:
![Touch panel](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-13.png)
Troubleshoot
Cannot save the macro.
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-14.png)
This kind of error, is probably caused because the line show in the next image is dupplicated:
![Macro Editor](/c/dam/en/us/support/docs/collaboration-endpoints/webex-room-series/217247-how-to-configure-macros-to-switch-betwee-15.png)