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

Program a mirroring button

JCFP
Level 1
Level 1

Hi there,

I am trying to program a button to mirror screens for users on a Cisco room kit plus tablet. The users wants to mirror their presentation when they are on call and not on call. I am currently trying to program it in a not on call scenario but I am having difficulties. I am not a programmer btw.

Here is my code and I created a button with the same ID but it doesn't work:

import { Config,Event } from 'xapi';

async function toggleMirroring() {
  const currentSetting = await Config.Video.Output.MirroringType.get();
  if (currentSetting === 'LastOnly') {
    await Config.Video.Output.MirroringType.set('Mirror');
    console.log('Mirroring set to Mirror');
  } else {
    await Config.Video.Output.MirroringType.set('LastOnly');
    console.log('Mirroring set to LastOnly');
  }
}

Event.UserInterface.Extensions.Widget.Action.on((event) => {
  if (event.WidgetId === 'mirror_button' && event.Type === 'released') {
    toggleMirroring();
  }
});

Any help would be appreciated.
Thanks,
JC

 

0 Replies 0