How mpvrex/rex-player works
REX Player is an Android libmpv video player with a Compose interface. Its main workflow is browsing local or network media, selecting a video or playlist, then playing it with configurable controls and playback state. The README also documents Shorts, web-platform streaming through an optional companion, Jellyfin, and nearby-device sharing. The graph retains these major capabilities; several are represented at their exact enclosing directory because their implementation excerpts were not provided. Relationships without direct excerpt or README evidence are omitted.
Main entry points: PlayerActivity.kt Player screen · browser Media browser · HistoryManager.kt Watch history · MediaPlaybackService.kt Background playback
Components 29
App and browsing
- App entry
app/src/main/kotlin/xyz/mpv/rex/MainActivity.kt - Media browser
app/src/main/kotlin/xyz/mpv/rex/ui/browser - Local library
app/src/main/kotlin/xyz/mpv/rex/database/repository/HybridMediaIndexRepository.kt - Shorts mode
app/src/main/kotlin/xyz/mpv/rex/ui/browser/shorts
Playback experience
- Player screen
app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt - libmpv playback
app/src/main/kotlin/xyz/mpv/rex/ui/player/MPVView.kt - Background playback
app/src/main/kotlin/xyz/mpv/rex/ui/player/MediaPlaybackService.kt - Headless playback
app/src/main/kotlin/xyz/mpv/rex/ui/player/HeadlessPlaybackController.kt - Mini player state
app/src/main/kotlin/xyz/mpv/rex/ui/browser/miniplayer/MiniPlayerStateManager.kt - Player controls
app/src/main/kotlin/xyz/mpv/rex/ui/player/controls
Media and history
- Media model
app/src/main/kotlin/xyz/mpv/rex/domain/media/model/Video.kt - Thumbnails
app/src/main/kotlin/xyz/mpv/rex/domain/thumbnail/ThumbnailRepository.kt - Watch history
app/src/main/kotlin/xyz/mpv/rex/utils/history/HistoryManager.kt - Playback state
app/src/main/kotlin/xyz/mpv/rex/database/entities/PlaybackStateEntity.kt - Recent media record
app/src/main/kotlin/xyz/mpv/rex/database/entities/RecentlyPlayedEntity.kt - Media index
app/src/main/kotlin/xyz/mpv/rex/database/repository/HybridMediaIndexRepository.kt - Metadata cache
app/src/main/kotlin/xyz/mpv/rex/database/repository/VideoMetadataCacheRepository.kt - Room database
app/src/main/kotlin/xyz/mpv/rex/database/MpvExDatabase.kt
Streaming and sharing
- Network streaming
app/src/main/kotlin/xyz/mpv/rex/ui/browser/networkstreaming - Web media resolver
app/src/main/kotlin/xyz/mpv/rex/domain/ytdl - Jellyfin integration
app/src/main/kotlin/xyz/mpv/rex/jellyfin - Nearby sharing
app/src/main/kotlin/xyz/mpv/rex/feature/webshare
Preferences and effects
- Player preferences
app/src/main/kotlin/xyz/mpv/rex/preferences/PlayerPreferences.kt - Preference store
app/src/main/kotlin/xyz/mpv/rex/preferences/preference/PreferenceStore.kt - Subtitle search
app/src/main/kotlin/xyz/mpv/rex/repository/wyzie/WyzieSearchRepository.kt - HDR tone mapping
app/src/main/kotlin/xyz/mpv/rex/domain/hdr/HdrToysManager.kt - Anime4K filters
app/src/main/kotlin/xyz/mpv/rex/domain/anime4k/Anime4KManager.kt
Other components
- Viewer
- REX Ytdlp app
Connections 30
- Viewer → App entry: opens
- App entry → Media browser: browses
app/src/main/kotlin/xyz/mpv/rex/MainActivity.kt - Media browser → Local library: indexes media
- Local library → Media model: produces
app/src/main/kotlin/xyz/mpv/rex/database/repository/HybridMediaIndexRepository.kt - Media browser → Player screen: selects media
app/src/main/kotlin/xyz/mpv/rex/ui/browser/miniplayer/MiniPlayerStateManager.kt - Player screen → libmpv playback: plays media
- Player screen → Background playback: starts background
app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt - Background playback → libmpv playback: controls playback
app/src/main/kotlin/xyz/mpv/rex/ui/player/MediaPlaybackService.kt - Player screen → Headless playback: supports background
app/src/main/kotlin/xyz/mpv/rex/ui/player/HeadlessPlaybackController.kt - Headless playback → Mini player state: updates state
app/src/main/kotlin/xyz/mpv/rex/ui/player/HeadlessPlaybackController.kt - Mini player state → Background playback: stops service
app/src/main/kotlin/xyz/mpv/rex/ui/browser/miniplayer/MiniPlayerStateManager.kt - Player controls → Player screen: configures playback
app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt - Media browser → Thumbnails: shows thumbnails
app/src/main/kotlin/xyz/mpv/rex/domain/thumbnail/ThumbnailRepository.kt - Thumbnails → Media model: reads media fields
app/src/main/kotlin/xyz/mpv/rex/domain/thumbnail/ThumbnailRepository.kt - Player screen → Watch history: records playback
- Watch history → Playback state: persists progress
app/src/main/kotlin/xyz/mpv/rex/utils/history/HistoryManager.kt - Watch history → Recent media record: records recently played
app/src/main/kotlin/xyz/mpv/rex/utils/history/HistoryManager.kt - Media index → Room database: stores index
- Media index → Media model: returns media
app/src/main/kotlin/xyz/mpv/rex/database/repository/HybridMediaIndexRepository.kt - Metadata cache → Room database: caches metadata
- Network streaming → Player screen: streams media
app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt - Web media resolver → REX Ytdlp app: resolves web media
README.md - Viewer → Jellyfin integration: connects library
README.md - Viewer → Nearby sharing: shares files
README.md - Player preferences → Preference store: reads preferences
app/src/main/kotlin/xyz/mpv/rex/preferences/PlayerPreferences.kt - Subtitle search → Player preferences: reads subtitle options
app/src/main/kotlin/xyz/mpv/rex/repository/wyzie/WyzieSearchRepository.kt - Player screen → Subtitle search: searches subtitles
- Player screen → HDR tone mapping: applies tone mapping
README.md - Player screen → Anime4K filters: applies filters
- Media browser → Shorts mode: opens Shorts
README.md