Options
All
  • Public
  • Public/Protected
  • All
Menu

Use the getCommandClient method for the VideoClient to access the command channel client.

Index

Functions

Functions

  • Send a string text through the command channel.

    example only work to VideoSDK

     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)
    })

    Parameters

    • text: string

      The text to send.

    • Optional target: CommandChannelTarget

      The recipient or broadcast scope. If omitted, the message is broadcast to the current session.

    Returns Promise<ExecutedFailure | CommandChannelMsg>

    ExecutedResult