sendMessageToCustomTile()
sendMessageToCustomTile({name: string, event?: string, origin?: string, data?: any})
sambaFrame.on('userJoined', (event) => {
const data = event.data;
if (data.type === 'local') {
sambaFrame.addCustomTile({
"name": "AI",
"html": '<iframe src="url to your customm site with a listener inside"></iframe>',
"position": "last"
});
.....................
//At some point later
sambaFrame.sendMessageToCustomTile({
//Identifier and title of your custom tile. Must match the name in addCustomTile
"name": "AI",
//A custom event name which your tile knows about
"event": "muteInternally",
/*
The target origin for postMessage
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
*/
"origin": "*" ,
//Some custom payload data if you need
"data": {
"everything": true/false
}
});
}
});Last updated