# edde746/plezy architecture

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

- Interactive diagram: https://gitdiagram.com/edde746/plezy
- Repository: https://github.com/edde746/plezy

## Overview

Plezy is a cross-platform Flutter client for Plex, Jellyfin, and Emby, with native playback backends and platform integrations. The README describes browsing, discovery, playback, music, Live TV, downloads, and synchronized group viewing; the supplied tree and excerpts chiefly expose Android playback internals, not the Flutter feature implementation. The graph therefore emphasizes evidenced Android player wiring and retains the README’s major product capabilities as documented, unsampled subsystems. Dashed links mark relationships not verified in the supplied source.

Main entry points: [`android/app/src/main/kotlin/com/edde746/plezy/exoplayer`](https://github.com/edde746/plezy/tree/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer) (Video playback), [`android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt`](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt) (ExoPlayer bridge), [`android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt`](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt) (Android host), [`android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt`](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt) (mpv bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Client capabilities"]
  node_browse["Browse &amp; discover"]
  node_explore["Catalogs &amp; requests"]
  node_video["Video playback"]
  node_music["Music playback"]
  node_livetv["Live TV &amp; DVR"]
  node_downloads["Offline downloads"]
  node_watchtogether["Watch together"]
end

subgraph group_playback["Android playback"]
  node_exo["ExoPlayer bridge<br/>[ExoPlayerPlugin.kt]"]
  node_exocore["ExoPlayer core<br/>[ExoPlayerCore.kt]"]
  node_mpvbridge["mpv bridge<br/>[MpvPlayerPlugin.kt]"]
  node_mpvcore["mpv core<br/>[MpvPlayerCore.kt]"]
end

subgraph group_native["Playback internals"]
  node_asshandler["ASS subtitle handler<br/>[AssHandler.kt]"]
  node_asspipeline["Subtitle render pipeline"]
  node_specrender["Speculative renderer"]
  node_nativejni["mpv JNI runtime<br/>[main.cpp]"]
end

subgraph group_platform["Platform support"]
  node_androidhost["Android host<br/>[MainActivity.kt]"]
  node_playerbinding["Player channel binding"]
  node_framerate["Display-rate control"]
  node_externalplayer["External player handoff"]
  node_watchnext["System watch-next<br/>[WatchNextPlugin.kt]"]
end

node_user(("Viewer"))

node_user -.->|"browses"| node_browse
node_user -.->|"discovers"| node_explore
node_user -.->|"plays video"| node_video
node_user -.->|"plays music"| node_music
node_user -.->|"tunes TV"| node_livetv
node_user -.->|"downloads media"| node_downloads
node_user -.->|"joins session"| node_watchtogether
node_androidhost -->|"registers"| node_exo
node_androidhost -->|"registers"| node_mpvbridge
node_androidhost -->|"registers"| node_watchnext
node_exo -->|"delegates playback"| node_exocore
node_exo -->|"uses subtitles"| node_asshandler
node_mpvbridge -->|"delegates playback"| node_mpvcore
node_asshandler -.->|"renders subtitles"| node_asspipeline
node_asspipeline -->|"consults renderer"| node_specrender
node_mpvcore -.->|"uses native runtime"| node_nativejni
node_exo -->|"binds player channel"| node_playerbinding
node_mpvbridge -->|"binds player channel"| node_playerbinding
node_video -.->|"matches refresh rate"| node_framerate
node_video -.->|"launches external player"| node_externalplayer
node_video -.->|"updates system shelf"| node_watchnext

click node_browse "https://github.com/edde746/plezy/tree/main/android/app/src/main"
click node_explore "https://github.com/edde746/plezy/tree/main/android/app/src/main"
click node_video "https://github.com/edde746/plezy/tree/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer"
click node_music "https://github.com/edde746/plezy/tree/main/android/app/src/main"
click node_livetv "https://github.com/edde746/plezy/tree/main/android/app/src/main"
click node_downloads "https://github.com/edde746/plezy/tree/main/android/app/src/main"
click node_watchtogether "https://github.com/edde746/plezy/tree/main/android/app/src/main"
click node_androidhost "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt"
click node_exo "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt"
click node_exocore "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerCore.kt"
click node_mpvbridge "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt"
click node_mpvcore "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerCore.kt"
click node_asshandler "https://github.com/edde746/plezy/blob/main/android/libass/src/main/java/com/edde746/plezy/libass/media/AssHandler.kt"
click node_asspipeline "https://github.com/edde746/plezy/blob/main/android/libass/src/main/java/com/edde746/plezy/libass/media/widget/AssSubtitleAtlasPipeline.kt"
click node_specrender "https://github.com/edde746/plezy/blob/main/android/libass/src/main/java/com/edde746/plezy/libass/media/widget/SpecRenderEngine.kt"
click node_nativejni "https://github.com/edde746/plezy/blob/main/android/libmpv/src/main/cpp/main.cpp"
click node_playerbinding "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/shared/PlayerChannelBinding.kt"
click node_framerate "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/shared/DisplayModeSelector.kt"
click node_externalplayer "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/ExternalPlayerChannel.kt"
click node_watchnext "https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/watchnext/WatchNextPlugin.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_browse,node_explore,node_video,node_music,node_livetv,node_downloads,node_watchtogether,node_user toneBlue
class node_exo,node_exocore,node_mpvbridge,node_mpvcore toneAmber
class node_asshandler,node_asspipeline,node_specrender,node_nativejni toneMint
class node_androidhost,node_playerbinding,node_framerate,node_externalplayer,node_watchnext toneRose
```

## Components

### Client capabilities

- [Browse & discover](https://github.com/edde746/plezy/tree/main/android/app/src/main): `android/app/src/main`
- [Catalogs & requests](https://github.com/edde746/plezy/tree/main/android/app/src/main): `android/app/src/main`
- [Video playback](https://github.com/edde746/plezy/tree/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer): `android/app/src/main/kotlin/com/edde746/plezy/exoplayer`
- [Music playback](https://github.com/edde746/plezy/tree/main/android/app/src/main): `android/app/src/main`
- [Live TV & DVR](https://github.com/edde746/plezy/tree/main/android/app/src/main): `android/app/src/main`
- [Offline downloads](https://github.com/edde746/plezy/tree/main/android/app/src/main): `android/app/src/main`
- [Watch together](https://github.com/edde746/plezy/tree/main/android/app/src/main): `android/app/src/main`

### Android playback

- [ExoPlayer bridge](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt): `android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt`
- [ExoPlayer core](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerCore.kt): `android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerCore.kt`
- [mpv bridge](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt): `android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt`
- [mpv core](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerCore.kt): `android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerCore.kt`

### Playback internals

- [ASS subtitle handler](https://github.com/edde746/plezy/blob/main/android/libass/src/main/java/com/edde746/plezy/libass/media/AssHandler.kt): `android/libass/src/main/java/com/edde746/plezy/libass/media/AssHandler.kt`
- [Subtitle render pipeline](https://github.com/edde746/plezy/blob/main/android/libass/src/main/java/com/edde746/plezy/libass/media/widget/AssSubtitleAtlasPipeline.kt): `android/libass/src/main/java/com/edde746/plezy/libass/media/widget/AssSubtitleAtlasPipeline.kt`
- [Speculative renderer](https://github.com/edde746/plezy/blob/main/android/libass/src/main/java/com/edde746/plezy/libass/media/widget/SpecRenderEngine.kt): `android/libass/src/main/java/com/edde746/plezy/libass/media/widget/SpecRenderEngine.kt`
- [mpv JNI runtime](https://github.com/edde746/plezy/blob/main/android/libmpv/src/main/cpp/main.cpp): `android/libmpv/src/main/cpp/main.cpp`

### Platform support

- [Android host](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt): `android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt`
- [Player channel binding](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/shared/PlayerChannelBinding.kt): `android/app/src/main/kotlin/com/edde746/plezy/shared/PlayerChannelBinding.kt`
- [Display-rate control](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/shared/DisplayModeSelector.kt): `android/app/src/main/kotlin/com/edde746/plezy/shared/DisplayModeSelector.kt`
- [External player handoff](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/ExternalPlayerChannel.kt): `android/app/src/main/kotlin/com/edde746/plezy/ExternalPlayerChannel.kt`
- [System watch-next](https://github.com/edde746/plezy/blob/main/android/app/src/main/kotlin/com/edde746/plezy/watchnext/WatchNextPlugin.kt): `android/app/src/main/kotlin/com/edde746/plezy/watchnext/WatchNextPlugin.kt`

### Other components

- **Viewer**

## Connections

- Viewer → Browse & discover: browses
- Viewer → Catalogs & requests: discovers
- Viewer → Video playback: plays video
- Viewer → Music playback: plays music
- Viewer → Live TV & DVR: tunes TV
- Viewer → Offline downloads: downloads media
- Viewer → Watch together: joins session
- Android host → ExoPlayer bridge: registers (evidence: `android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt`)
- Android host → mpv bridge: registers (evidence: `android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt`)
- Android host → System watch-next: registers (evidence: `android/app/src/main/kotlin/com/edde746/plezy/MainActivity.kt`)
- ExoPlayer bridge → ExoPlayer core: delegates playback (evidence: `android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt`)
- ExoPlayer bridge → ASS subtitle handler: uses subtitles (evidence: `android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt`)
- mpv bridge → mpv core: delegates playback (evidence: `android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt`)
- ASS subtitle handler → Subtitle render pipeline: renders subtitles (evidence: `android/libass/src/main/java/com/edde746/plezy/libass/media/widget/AssSubtitleAtlasPipeline.kt`)
- Subtitle render pipeline → Speculative renderer: consults renderer (evidence: `android/libass/src/main/java/com/edde746/plezy/libass/media/widget/AssSubtitleAtlasPipeline.kt`)
- mpv core → mpv JNI runtime: uses native runtime
- ExoPlayer bridge → Player channel binding: binds player channel (evidence: `android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt`)
- mpv bridge → Player channel binding: binds player channel (evidence: `android/app/src/main/kotlin/com/edde746/plezy/mpv/MpvPlayerPlugin.kt`)
- Video playback → Display-rate control: matches refresh rate
- Video playback → External player handoff: launches external player
- Video playback → System watch-next: updates system shelf
