Videos tab: stream/download the server video library, in-app ExoPlayer
All checks were successful
Build & Release APK / build (push) Successful in 12m15s

- New Videos tab lists videos served by health-api (GET /v1/videos), with
  thumbnails, duration/size, "Download for offline" into app-private storage
  (progress bar, remove), and tap-to-play.
- Full-screen Media3/ExoPlayer: plays the local copy if downloaded, otherwise
  streams /v1/videos/<file> with the existing sync bearer token (range requests).
- Activity handles rotation itself (configChanges) so playback survives it.
- Server side: health-api /v1/videos + video-add.sh (yt-dlp) — see README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019pvxTrcfAiFZJcS7Jve2Au
This commit is contained in:
2026-09-01 20:02:09 +10:00
parent 2e1bf3907d
commit 0d694dc98b
7 changed files with 511 additions and 2 deletions

View File

@@ -22,6 +22,20 @@ adb shell am start -n com.marcus.meditationtimer/.MainActivity --es sync_token "
Sessions shorter than 30 seconds are not recorded (gong tests).
## Videos
The Videos tab lists a library served by health-api (`GET /v1/videos`,
files at `/v1/videos/<name>` with range support, same bearer token as sync).
Add videos on the VPS:
```
~/personal/health-api/video-add.sh "https://www.youtube.com/watch?v=..."
```
(yt-dlp → 720p mp4 + thumbnail + info.json in `health-api/data/videos/`;
delete the files to remove a video.) In-app: tap to stream, or "Download for
offline" to keep a copy in app-private storage. Playback is Media3/ExoPlayer.
## Local build
```