Send a string text through the command channel.
const cmdChannel = client.getCommandClient();
// send to a user in the current session
cmdChannel.send('test', userId)
// send to a user by external key / guid (may be in another session)
cmdChannel.send('test', { userKey: 'my-key' })
cmdChannel.send('test', { userGuid: 'xxxx' })
// broadcast to the main session and all subsessions
cmdChannel.send('test', { scope: 'all' })
.then(() => {
// success
})
.catch(v => {
// fail
console.log(v)
})
The text to send.
The recipient or broadcast scope. If omitted, the message is broadcast to the current session.
ExecutedResult
Use the
getCommandClientmethod for theVideoClientto access the command channel client.