Video SDK Type and Version:
Web Video SDK UI Toolkit Version 2.1.0-1 (with Video SDK 2.1.5)
I’m developing a real-time multiplayer game component using the Zoom Video SDK. The game requires bidirectional communication between the host and participant to synchronize game state, including:
- Game start/end events
- Current word being displayed
- Score updates
- Player turn switching
- Timer synchronization
I’ve implemented the game using two approaches:
- Primary approach: Using the Command Channel as recommended in documentation for real-time game state synchronization between host and participant.
- Fallback approach: Using Chat messages as a secondary method when the Command Channel is unavailable.
The implementation follows the pattern from the docs:
// Primary Command Channel approach
const cmdClient = zoomClient.getCommandClient();
if (cmdClient) {
// Send game updates
cmdClient.send(JSON.stringify({
cmd: "GAME_STATE",
gameSessionId: sessionId,
gameState: { /* game state data */ }
}));
}
// Event listener for receiving commands
client.on('command-channel-message', (payload) => {
const message = JSON.parse(payload.text);
// Process game command
});
Despite implementing multiple methods to access the command channel, I consistently receive:
Could not get command client from Zoom SDK - will retry
Command channel not available
No viable communication method found for session sharing
Failed to get command client after multiple retries
I’m using various approaches to get the command client:
- Direct access:
zoomClient.getCommandClient()
- Through core client:
zoomClient.getCoreClient().getCommandClient()
- With retries: Setting up a periodic retry mechanism
Troubleshooting Routes:
- Implemented multiple ways to access the command client
- Added a retry mechanism that attempts to get the command client every 2 seconds
- Added chat channel fallback for transmitting game state
- Verified the Video SDK initialization is complete before attempting to access the command channel
- Confirmed the appropriate permissions were enabled in the JWT token
- Tested with simple message sending to isolate the issue
- Checked SDK documentation for any initialization requirements for the command channel
How To Reproduce:
- Authentication method: JWT token with appropriate permissions including command channel
- Browser: Chrome 122 on macOS
- Steps:
- Initialize Zoom Video SDK UI Toolkit
- Join a session successfully
- Attempt to access command channel using
zoomClient.getCommandClient()
- Observe “Could not get command client from Zoom SDK” error
- See retry attempts fail with “Command channel not available”
My question: Is there a specific initialization step or timing requirement for the command channel that might be missing from my implementation? Are there any known issues with the command channel in the current SDK version? Any guidance on the correct way to access and use the command channel would be greatly appreciated.