# RCWeb Screen View App

The **RCWeb Screen View App** (`app/screen-view`) is the viewer half of the RCWeb screen sharing pair. It follows the **Asymmetric Pattern**: viewers stay receive-only, while `screen-c` browsers in the same room publish WebRTC screen and audio streams into the page.

![icon](pwa-512x512.png "Screen View App Icon")

## What it does

- **Receives room broadcasts**: Discovers every compatible `screen-c` client in the room and requests a stream from each of them.
- **Displays live media**: Renders incoming screen feeds in a responsive grid and keeps any shared audio attached to the same video element.
- **Reconnect tools**: Provides per-stream and whole-room reconnect buttons so viewers can ask broadcasters to renegotiate a stream.
- **Audio monitoring control**: Lets the viewer enable or mute room audio locally to accommodate browser autoplay restrictions.

## How it works

- **RCWeb signaling**: `script.js` uses `rc.sendFunctionCall(...)` to request streams, receive broadcaster presence updates, and exchange WebRTC answers and ICE candidates.
- **Receive-only peer connections**: Each broadcaster gets its own `RTCPeerConnection` with `recvonly` transceivers so the viewer stays passive and never captures local media.
- **Broadcaster metadata**: Lightweight presence messages keep the UI updated with broadcaster names and whether audio or video is currently available.
- **Room cleanup**: Stream cards are removed when RCWeb reports that a broadcaster has left the room or explicitly signals that it is closing.

## Notes

- Remote shared audio may require a user click before the browser allows playback.
- Like the controller app, this viewer relies on STUN servers and does **not** include TURN relay support.
