--- name: reference-workout-api description: "Workout-player API contract at 192.168.86.172:8091 — endpoints for videos, stats, routines, streaming" metadata: node_type: memory type: reference originSessionId: 826ce615-b163-439f-aaa9-7b3be198b03a --- Workout-player service runs at http://192.168.86.172:8091 on the homelab. **Endpoints (derived from prior mirror-os JS codebase):** - `GET /api/videos?folder=` — list videos, optional folder filter. Returns `{videos: [...], folders: [...]}` - `GET /api/stats` — aggregate stats (total, completed, inProgress counts) - `GET /api/routines` — list routines. Returns `{routines: [...]}` - `PATCH /api/videos` — save progress. Body: `{videoId, position, percent}` - `GET /api/stream?path=` — stream video file directly **Video object fields:** id, title, path, folder, duration, trimStart, trimEnd, lastPosition, percentCompleted, restSeconds **State machine for workout sessions:** browse → playing → rest (between queue items) → complete **How to apply:** When building the workout integration in Flutter, use these endpoints. The stream URL can be passed directly to media_kit/mpv for playback.