The RCWeb Controls App (app/c) is the remote control interface within the RCWeb ecosystem. It demonstrates the Asymmetric Pattern, allowing a user on a mobile device or another browser to send JavaScript commands to a target viewer application operating in the same virtual room.


The core logic is orchestrated within script.js which relies entirely on the robust peer-to-peer foundation provided by the comms.js library.
loadControls() initializes default input values (like sample image/video URLs) and connects the controller interface to the server via rc.connect().showColor(), showImage(), or showHtml()—the app generates the precise DOM manipulation code required. This generated string is then dispatched to the room via rc.send(js, "v") or sendJavaScript().createDynamicFileUrl() function coordinates file sharing. For large files, it generates a proxy URL (/x-file/...) and relies on sendFileChunk() and sendChunk() to slice the file and upload bytes incrementally via HTTP PUT requests as the viewer requests them. The controller must keep the tab open for the stream to stay alive (promptExit()).rc.onViewUpdateSuccess and rc.onViewUpdateError broadcasts from the viewer app. This surfaces real-time execution feedback (success or error notices) back to the user within the control interface UI.insideInstalledApp()). If true, it automatically restricts the desktop window to resemble a mobile view size by applying window.resizeTo(430, 500).