Real-time Remote Screen Viewing (Screen Streaming)
The Streaming system (server-nest/src/screen-streaming) allows administrators to watch what's happening on the screen in real-time, similar to VNC but web-based.
Technology
The solution uses WebSockets (ScreenStreamingGateway) for frame transmission.
Data Flow
- Start Stream: The administrator requests viewing. The server sends a
START_STREAMcommand to the device. - Device Capture: The device starts capturing the screen at a defined rate (for example 5-10 FPS).
- Compression: Each frame is compressed to JPEG (at low/medium quality to save bandwidth).
- Transmission: The frames are sent via Socket to the server.
- Broadcasting: The server passes the frames to the client (Admin Dashboard) which displays them on an
<img />or<canvas />element that updates frequently.
Security and Performance
- Token Auth: The Socket channel is secured and requires
MANAGE_REMOTE_CONTROLpermission. - Throttling: The server limits the transmission rate to avoid choking the synagogue's network.
- Auto Stop: The streaming stops automatically if the administrator closes the window or after a timeout (for example 2 minutes) to save resources.
Common Issues
- Lag: Highly dependent on the synagogue's upload speed.
- Black Screen: On some Android devices, protected video content (DRM) may appear black in screenshots.