The RCWeb Viewer App (app/v) is designed to be remotely controlled by other applications within the RCWeb ecosystem. It demonstrates the Asymmetric Pattern, where one or more controlling applications send commands (JavaScript) to one or more viewer applications operating in the same virtual room.


app/c, or other compatible apps like gallery or chat).The core logic of the Viewer app is managed inside script.js, which relies heavily on the core comms.js library to receive and acknowledge remote executions.
rc.showWelcome() after a short delay (preventing WebSocket connection spam on excessive refreshes). It sets up UI widgets like the room title, QR code (rc.renderQrCode()), a fullscreen toggle, and network status UI, before connecting to the server (rc.connect()).script.js:
rc.onUpdateSuccess(js): Invoked by comms.js after successfully evaluating the remote JavaScript. It sends an acknowledgment message back to the controlling client so the controller knows the command succeeded.rc.onUpdateError(error): Invoked if an error occurs while evaluating the remote script. It sends the error message back to the controller client for remote debugging purposes.rc.onNoUpdate() is triggered, which in turn calls rc.screensaver(). This slightly shifts the position of the main informational overlay at random intervals to prevent screen burn-in on unattended displays.rc.onUpdateNetworkStatus and rc.onUpdateClients to update the user interface dynamically as the connection state changes and as new clients join or leave the room.