addTileAction()

addTileAction(name: string, properties: TileActionProperties, listener: function)

Adds a custom action to the 3-dots menu of the tiles. When the user clicks that custom menu item, then the callback listener function will be invoked.

The first parameter "name" is just an internal identifier so you can remove the custom action later with the removeTileAction() method if it is needed.

Valid tile scopes are 'remote', 'local', 'screenshare-local' and 'screenshare-remote'. Remote means tiles of other (remote) users, while local means tile of local user.

In the below example a custom send email action is added to all remote tiles.

const onSendEmailClicked = () => {
   console.log('Send Email callback called');
};

sambaFrame.addTileAction(
  'sendEmail', 
   {"label": 'Send Email', scope: 'remote'}, 
   onSendEmailClicked 
);

This method is often used in conjunction with the removeTileAction() method.

Last updated