# Nexus Media 1.0 — Evidence

POC 1.0 for the first-party Nexus Media player in Ninja Nexus Shell (not Windows Media Player, not VLC).

## Scope

- Local library scan: Videos, Music, Downloads folders
- Video + music playback with Nexus UI controls
- Library grid/list, favorites, playlists (JSON), queue, metadata panel
- Home: Seneste afspillet, Favoritter, Nye medier
- Launcher wiring via `nexus:media` (`app-nexus-media` in `apps.manifest.json`)
- Lockdown blocks `wmp.exe` / Movies & TV with message: **Åbn Nexus Media i stedet.**

## Media engine

| Mode | WPF API | Backend |
|------|---------|---------|
| Video | `MediaElement` (view-hosted) | Windows Media Foundation via WPF |
| Audio | `MediaPlayer` | Windows Media Foundation via WPF |

Tag metadata (artist, album, duration, bitrate) via **TagLibSharp** at scan time; runtime duration/resolution from opened media.

## Architecture

| Layer | Type |
|-------|------|
| `NexusMediaView` | WPF UserControl |
| `NexusMediaViewModel` | MVVM + `NexusMiniPlayerState` hooks |
| `NexusMediaLibraryService` | Scan Videos / Music / Downloads |
| `NexusMediaPlayerService` | Play / pause / stop / seek / volume / fullscreen |
| `NexusPlaylistService` | `%LocalAppData%/NinjaNexus/media/playlists/*.json` |
| `NexusMediaMetadataService` | Filename, format, tags, runtime probe |
| `NexusQueueService` | In-memory queue add/remove/reorder |
| `NexusMediaFavoritesService` | `%LocalAppData%/NinjaNexus/media/favorites.json` |

## Supported formats (POC)

- **Video:** MP4, MKV, MOV, AVI, WEBM
- **Audio:** MP3, WAV, FLAC, AAC, OGG
- Unsupported formats show a Nexus error message listing allowed types.

## Screenshot checklist

Capture from a Release build with `--safe-poc` or `--overlay`:

- [ ] `media-home.png` — Home with Seneste afspillet, Favoritter, Nye medier
- [ ] `media-video-library.png` — Video grid with title / duration / resolution
- [ ] `media-video-player.png` — Full video overlay with Nexus controls
- [ ] `media-music-library.png` — Music list (title, artist, album, duration)
- [ ] `media-now-playing.png` — Right panel Now Playing + metadata + queue

Store screenshots in this folder next to this README.

## Manual verification

1. Launcher → **Nexus Media** (pinned `app-nexus-media`)
2. Place sample MP4 in Videos and MP3 in Music; click **Opdater**
3. Double-click a video → overlay player with play/pause/stop/seek/fullscreen
4. Open Musik → double-click track → bottom Nexus Player Bar with shuffle/repeat
5. Star a favorite → verify `%LocalAppData%\NinjaNexus\media\favorites.json`
6. Create afspilningsliste → verify `media\playlists\{id}.json`
7. With lockdown active, attempt Windows Media Player → blocked with Nexus Media hint

## POC-only limitations

- No streaming, cloud, transcoding, or Plex/Jellyfin
- Video thumbnails are styled placeholders (no ffmpeg shell extract)
- Mini player ViewModel hooks only — no dock tile yet
- Queue is session-based (not persisted across restarts)
- Codec info is best-effort from tags / extension

## v2 plan

- Persisted queue and resume position
- Album art extraction and video frame thumbnails
- Dock mini player integration
- Nexus Console commands (`media-play`, `media-scan`)
- Store entry opens Media directly (`nexus:media` from Ninja Store)
