Advanced Configuration
Deep dive into shaders, recording, controls, and performance.
CRT Shader Pipeline
The player includes 10 curated shaders from the libretro glsl-shaders collection. Pass the shader ID to the shader prop or let users change it at runtime.
| ID | Name | Description | Best For |
|---|---|---|---|
| "" | None | Sharp pixels, no effects | Pixel art purists |
| crt/crt-lottes | CRT Lottes | High-quality shadow mask, phosphor glow | Arcade/CRT authenticity |
| crt/crt-easymode | CRT Easy | Balanced performance and looks | Default recommendation |
| crt/crt-geom | CRT Geom | Curved screen geometry | Classic TV feel |
| crt/crt-hyllian | CRT Hyllian | Sharp with subtle scanlines | Clean CRT look |
| crt/crt-nes-mini | NES Mini | Simple scanlines like NES Classic | 8-bit games |
| crt/zfast-crt | zFast CRT | Extremely lightweight | Mobile devices |
| crt/crt-potato-cool | CRT Potato | Minimal GPU usage | Weak devices |
| handheld/lcd-grid-v2 | LCD Grid | Game Boy style LCD effect | GB, GBC, GBA, Game Gear |
| scanlines | Scanlines | Simple horizontal lines | Light enhancement |
<GamePlayer
shader="crt/crt-lottes"
onShaderChange={(newShader, requiresRestart) => {
// Some shaders require restart to take effect
if (requiresRestart) {
showToast('Shader will apply on restart');
}
}}
/>Gameplay Recording
The player uses the MediaRecorder API to capture canvas gameplay as WebM video. Recording works automatically — users press F5 to toggle.
Specs
- • Format: WebM (VP9 or VP8)
- • Frame Rate: 30 FPS
- • Bitrate: 5 Mbps
- • Features: Pause/resume, duration tracking
Browser Support
- • Chrome, Edge: ✅ VP9
- • Firefox: ✅ VP8
- • Safari: ⚠️ Limited (no VP9)
- • iOS Safari: ❌ Not supported
How It Works
- 1. User presses F5 → Red recording indicator appears
- 2. Canvas stream captured at 30fps via MediaRecorder
- 3. User presses F5 again → File downloads as
gameplay-[timestamp].webm
Keyboard Shortcuts
Player shortcuts (separate from game controls). Users can press F1 to see these in-game.
Control System
The player includes a sophisticated control system with per-console presets, keyboard remapping, and gamepad support.
Default Keyboard Layout
D-Pad
Face Buttons
Shoulders
System
Gamepad Detection
The player automatically detects and themes connected controllers:
Note on Browser Security
Browsers require a button press before reporting gamepads (security feature). The player uses requestAnimationFrame polling to detect connections.
Emergency Save System
To prevent progress loss, the player automatically saves when:
Tab Hidden
When user switches tabs or minimizes browser, the visibilitychangeevent triggers an immediate save via your onAutoSave handler.
Page Unload
The beforeunload event attempts a final save when the user navigates away or closes the tab.
Important: Emergency saves are only attempted if onAutoSaveis provided. Without this handler, no emergency saves occur.
Performance Tips
Use CHD for CD Games
CHD format is compressed and much faster to load than BIN/CUE pairs.
Match Shader to Device
Use crt/zfast-crt on mobile, crt/crt-lottes on desktop.
Host ROMs on Same Origin
Avoids CORS overhead and ensures COEP compliance.
Pre-warm the Emulator
Call Nostalgist.configure early to cache WASM modules before the user opens the player.