# RCWeb Random Video Control

**Random Video Control** is the phone-friendly companion to the **random-video** viewer. It lets one or more phones cycle through the current Pexels video sequence, pause and resume playback, and see richer details for the video currently on the display.

## What it does

- Shows a poster preview of the active video
- Shows linked photographer and Pexels attribution
- Shows duration, source dimensions, selected playback file, and sequence position
- Provides large touch buttons for **Prev**, **Play / Pause**, and **Next**
- Includes a link to the current video on Pexels

## RCWeb communication

The viewer owns all sequence state. The control sends commands to the viewer:

```javascript
rc.sendFunctionCall("random-video", "randomVideo.prev");
rc.sendFunctionCall("random-video", "randomVideo.next");
rc.sendFunctionCall("random-video", "randomVideo.toggle");
rc.sendFunctionCall("random-video", "randomVideo.requestState", rc.client);
```

The viewer sends snapshots back to controls through the global callback:

```javascript
randomVideoControl.receiveState(snapshot);
```

## Browser support

Written in ES5 with simple flexbox controls and conservative CSS for older mobile browsers.

## URL

`/random-video-c/?r=<room>`
