# nobi08/videoplayer architecture

> Architecture diagram of the GitHub repository nobi08/videoplayer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nobi08/videoplayer
- Repository: https://github.com/nobi08/videoplayer

## Overview

This Android app lets users browse device videos and open a selection in a playback screen. The library scans MediaStore, supports folder browsing, search and sorting, then launches the player with the selected playlist. The player provides playback controls and clip export; a MediaSession service supports background playback and reattachment. Settings and reusable gauge widgets are separate runtime surfaces. The excerpts establish these main links, but do not show player construction, settings navigation, or widget use, so those connections are omitted.

Main entry points: [`app/src/main/java/com/nobi/player/PlayerActivity.kt`](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/PlayerActivity.kt) (Player screen), [`app/src/main/java/com/nobi/player/MainActivity.kt`](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/MainActivity.kt) (Video library), [`app/src/main/java/com/nobi/player/PlaybackService.kt`](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/PlaybackService.kt) (Playback service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Video library"]
  node_library_ui["Video library<br/>[MainActivity.kt]"]
end

subgraph group_playback["Playback"]
  node_player_screen["Player screen<br/>[PlayerActivity.kt]"]
  node_media3_player["ExoPlayer"]
  node_clip_output[("Saved clips")]
end

subgraph group_background["Background playback"]
  node_playback_service["Playback service<br/>[PlaybackService.kt]"]
  node_media_session["MediaSession"]
end

subgraph group_ui["App surfaces"]
  node_settings["Settings screen"]
  node_gauge_widgets["Gauge widgets<br/>[Widgets.kt]"]
end

node_user(("User"))
node_media_store[("MediaStore")]

node_user -.->|"opens"| node_library_ui
node_library_ui -->|"queries videos"| node_media_store
node_user -->|"searches and sorts"| node_library_ui
node_library_ui -->|"launches with playlist"| node_player_screen
node_player_screen -.->|"controls playback"| node_media3_player
node_player_screen -->|"reattaches player"| node_playback_service
node_playback_service -->|"shares player"| node_media3_player
node_playback_service -->|"builds session"| node_media_session
node_player_screen -->|"writes clips"| node_media_store

click node_library_ui "https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/MainActivity.kt"
click node_player_screen "https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/PlayerActivity.kt"
click node_playback_service "https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/PlaybackService.kt"
click node_settings "https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/SettingsActivity.kt"
click node_gauge_widgets "https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/Widgets.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_library_ui,node_user toneBlue
class node_player_screen,node_media3_player,node_clip_output,node_media_store toneAmber
class node_playback_service,node_media_session toneMint
class node_settings,node_gauge_widgets toneRose
```

## Components

### Video library

- [Video library](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/MainActivity.kt): `app/src/main/java/com/nobi/player/MainActivity.kt`

### Playback

- [Player screen](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/PlayerActivity.kt): `app/src/main/java/com/nobi/player/PlayerActivity.kt`
- **ExoPlayer**
- **Saved clips**

### Background playback

- [Playback service](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/PlaybackService.kt): `app/src/main/java/com/nobi/player/PlaybackService.kt`
- **MediaSession**

### App surfaces

- [Settings screen](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/SettingsActivity.kt): `app/src/main/java/com/nobi/player/SettingsActivity.kt`
- [Gauge widgets](https://github.com/nobi08/videoplayer/blob/main/app/src/main/java/com/nobi/player/Widgets.kt): `app/src/main/java/com/nobi/player/Widgets.kt`

### Other components

- **User**
- **MediaStore**

## Connections

- User → Video library: opens
- Video library → MediaStore: queries videos (evidence: `app/src/main/java/com/nobi/player/MainActivity.kt`)
- User → Video library: searches and sorts (evidence: `app/src/main/java/com/nobi/player/MainActivity.kt`)
- Video library → Player screen: launches with playlist (evidence: `app/src/main/java/com/nobi/player/MainActivity.kt`)
- Player screen → ExoPlayer: controls playback
- Player screen → Playback service: reattaches player (evidence: `app/src/main/java/com/nobi/player/PlayerActivity.kt`)
- Playback service → ExoPlayer: shares player (evidence: `app/src/main/java/com/nobi/player/PlaybackService.kt`)
- Playback service → MediaSession: builds session (evidence: `app/src/main/java/com/nobi/player/PlaybackService.kt`)
- Player screen → MediaStore: writes clips (evidence: `app/src/main/java/com/nobi/player/PlayerActivity.kt`)
