@tuanthinhit Hi,
There is no API to switch Layouts but here is my trick
client.on('connection-change', (e) => {
if (e.state == 'Connected') {
return new Promise((resolve, reject) => {
let ribbon = document.querySelector('button[title="Ribbon"]');
if (ribbon) {
ribbon.click();
console.log('-- switching to speak view --');
return resolve(true);
}
return reject(true);
}).then((r) => {
var xpath = "//span[text()='Active']";
var speakView = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
if (speakView && speakView.singleNodeValue) {
speakView.singleNodeValue.click();
}
}).catch((error) => {
console.log('--- error when switching to speak view --> ', error);
});
}
});
If any query still please ask. Thanks