# yashoncode/meetube architecture

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

- Interactive diagram: https://gitdiagram.com/yashoncode/meetube
- Repository: https://github.com/yashoncode/meetube

## Overview

MeeTube is an Android YouTube video-and-music client, with a TV-oriented app layer and MeeTune music experience. The primary flow is browsing or searching media, opening a video, then playing it with playback controls and persisted state; downloads and background/car playback are parallel outcomes. The README also documents channels, live chat, lyrics, karaoke, casting and offline playback. Source excerpts show playback orchestration, state persistence, car-media integration and download queuing; links to other documented capabilities are limited where implementation excerpts were unavailable.

Main entry points: [`common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java`](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java) (Playback orchestration), [`common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java`](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java) (Media item), [`common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java`](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java) (Playback state), [`mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java`](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java) (Car media service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_splash["App startup"]
  node_views["View routing<br/>[ViewManager.java]"]
  node_prefs[("Preferences<br/>[AppPrefs.java]")]
end

subgraph group_media["Media discovery"]
  node_browse["Browse and channels"]
  node_search["Search"]
  node_video["Media item<br/>[Video.java]"]
end

subgraph group_playback["Playback"]
  node_playback["Playback orchestration"]
  node_playview["Playback interface<br/>[PlaybackView.java]"]
  node_engine["Player engine<br/>[PlayerEngine.java]"]
  node_format["Track selection<br/>[FormatItem.java]"]
  node_state[("Playback state")]
  node_background["Background playback"]
  node_autoframe["Display frame sync"]
end

subgraph group_music["Music experience"]
  node_music["MeeTune and lyrics"]
  node_karaoke["On-device karaoke<br/>[KaraokeEngine.java]"]
end

subgraph group_offline["Offline and integrations"]
  node_downloads["Download queue"]
  node_registry[("Download registry")]
  node_car["Car media service"]
  node_cast["Casting"]
end

node_user(("Viewer"))

node_user -->|"opens app"| node_splash
node_playback -->|"opens video"| node_playview
node_playback -->|"handles media"| node_video
node_playback -.->|"coordinates events"| node_engine
node_engine -->|"uses formats"| node_format
node_state -->|"stores progress"| node_video
node_state -->|"persists state"| node_prefs
node_downloads -->|"queues items"| node_registry
node_car -->|"reads downloads"| node_registry
node_car -->|"resolves media"| node_video
node_user -->|"discovers media"| node_browse
node_user -->|"searches media"| node_search
node_user -.->|"saves offline"| node_downloads
node_user -->|"casts playback"| node_cast
node_user -->|"switches to music"| node_music
node_music -.->|"offers karaoke"| node_karaoke
node_playback -.->|"continues playback"| node_background
node_playback -.->|"syncs display"| node_autoframe

click node_splash "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SplashPresenter.java"
click node_views "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/views/ViewManager.java"
click node_browse "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java"
click node_search "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SearchPresenter.java"
click node_video "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java"
click node_playback "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java"
click node_playview "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/views/PlaybackView.java"
click node_engine "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/manager/PlayerEngine.java"
click node_format "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/FormatItem.java"
click node_state "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java"
click node_prefs "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/AppPrefs.java"
click node_downloads "https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/downloads/MobileDownloadService.java"
click node_registry "https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/downloads/DownloadRegistry.java"
click node_car "https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java"
click node_cast "https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/casting/CastSessionService.java"
click node_music "https://github.com/yashoncode/meetube/tree/main/mobile/src/stmobile/java/com/newtube/mobile/ui/meetune"
click node_karaoke "https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/ui/meetune/KaraokeEngine.java"
click node_background "https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/ui/playback/MobilePlaybackService.java"
click node_autoframe "https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/autoframerate/AutoFrameRateHelper.java"

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_splash,node_views,node_prefs,node_user toneBlue
class node_browse,node_search,node_video toneAmber
class node_playback,node_playview,node_engine,node_format,node_state,node_background,node_autoframe toneMint
class node_music,node_karaoke toneRose
class node_downloads,node_registry,node_car,node_cast toneIndigo
```

## Components

### App navigation

- [App startup](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SplashPresenter.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SplashPresenter.java`
- [View routing](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/views/ViewManager.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/views/ViewManager.java`
- [Preferences](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/AppPrefs.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/AppPrefs.java`

### Media discovery

- [Browse and channels](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java`
- [Search](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SearchPresenter.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SearchPresenter.java`
- [Media item](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java`

### Playback

- [Playback orchestration](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java`
- [Playback interface](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/views/PlaybackView.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/views/PlaybackView.java`
- [Player engine](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/manager/PlayerEngine.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/manager/PlayerEngine.java`
- [Track selection](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/FormatItem.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/FormatItem.java`
- [Playback state](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java`
- [Background playback](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/ui/playback/MobilePlaybackService.java): `mobile/src/stmobile/java/com/newtube/mobile/ui/playback/MobilePlaybackService.java`
- [Display frame sync](https://github.com/yashoncode/meetube/blob/main/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/autoframerate/AutoFrameRateHelper.java): `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/autoframerate/AutoFrameRateHelper.java`

### Music experience

- [MeeTune and lyrics](https://github.com/yashoncode/meetube/tree/main/mobile/src/stmobile/java/com/newtube/mobile/ui/meetune): `mobile/src/stmobile/java/com/newtube/mobile/ui/meetune`
- [On-device karaoke](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/ui/meetune/KaraokeEngine.java): `mobile/src/stmobile/java/com/newtube/mobile/ui/meetune/KaraokeEngine.java`

### Offline and integrations

- [Download queue](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/downloads/MobileDownloadService.java): `mobile/src/stmobile/java/com/newtube/mobile/downloads/MobileDownloadService.java`
- [Download registry](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/downloads/DownloadRegistry.java): `mobile/src/stmobile/java/com/newtube/mobile/downloads/DownloadRegistry.java`
- [Car media service](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java): `mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java`
- [Casting](https://github.com/yashoncode/meetube/blob/main/mobile/src/stmobile/java/com/newtube/mobile/casting/CastSessionService.java): `mobile/src/stmobile/java/com/newtube/mobile/casting/CastSessionService.java`

### Other components

- **Viewer**

## Connections

- Viewer → App startup: opens app (evidence: `README.md`)
- Playback orchestration → Playback interface: opens video (evidence: `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java`)
- Playback orchestration → Media item: handles media (evidence: `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/PlaybackPresenter.java`)
- Playback orchestration → Player engine: coordinates events
- Player engine → Track selection: uses formats (evidence: `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/manager/PlayerEngine.java`)
- Playback state → Media item: stores progress (evidence: `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java`)
- Playback state → Preferences: persists state (evidence: `common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java`)
- Download queue → Download registry: queues items (evidence: `mobile/src/stmobile/java/com/newtube/mobile/downloads/MobileDownloadService.java`)
- Car media service → Download registry: reads downloads (evidence: `mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java`)
- Car media service → Media item: resolves media (evidence: `mobile/src/stmobile/java/com/newtube/mobile/car/CarMediaService.java`)
- Viewer → Browse and channels: discovers media (evidence: `README.md`)
- Viewer → Search: searches media (evidence: `README.md`)
- Viewer → Download queue: saves offline
- Viewer → Casting: casts playback (evidence: `README.md`)
- Viewer → MeeTune and lyrics: switches to music (evidence: `README.md`)
- MeeTune and lyrics → On-device karaoke: offers karaoke (evidence: `mobile/src/stmobile/java/com/newtube/mobile/ui/meetune/KaraokeEngine.java`)
- Playback orchestration → Background playback: continues playback (evidence: `mobile/src/stmobile/java/com/newtube/mobile/ui/playback/MobilePlaybackService.java`)
- Playback orchestration → Display frame sync: syncs display
