# Vault Display — Step 04 Matrix + Emergency Runtime

## Added

- Full matrix canvas rendering in the browser player
- Per-screen crop positioning for the 2x2 matrix wall
- Matrix/campaign/emergency mode rendering support
- Playlist runtime fixes to prevent stacked timers during refresh
- Faster display refresh cycle for operational changes
- Cached full playlist payloads for better offline recovery
- Global emergency override setting
- Emergency override API
- Emergency admin page
- Matrix page guidance for matrix-only vs global emergency behaviour
- Dashboard emergency state indicator
- Dashboard current mode visibility
- Demo full-matrix campaign content
- Demo emergency notice content
- Step 4 SQL patch

## Important Behaviour

### Individual Mode

Each matrix screen uses its assigned playlist.

### Matrix Mode

All four matrix screens use playlist ID `8` as a shared 3840x2160 canvas. Each browser crops its own section:

- matrix-1: top-left
- matrix-2: top-right
- matrix-3: bottom-left
- matrix-4: bottom-right

### Campaign Mode

Currently behaves like matrix mode and uses playlist ID `8`.

### Matrix Emergency Mode

Only affects the four matrix screens and uses playlist ID `9`.

### Global Emergency Override

Forces all seven screens to use playlist ID `9`.

Admin URL:

```text
/public/admin/emergency.php
```

API:

```text
/api/set-emergency-override.php
```

JSON payload:

```json
{"enabled": true}
```

## Install / Update

For an existing Step 3 installation, import:

```bash
mysql -u USER -p vault_display < install/step04-matrix-emergency.sql
```

For a fresh install, use:

```bash
mysql -u USER -p < install/install-all.sql
```

## Next Step

Step 5 should add the scheduling engine:

- playlist item date/time filtering
- day-of-week filtering
- priority overrides
- campaign start/end dates
- out-of-hours display rules
