# lipangit/jiaozivideoplayer architecture

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

- Interactive diagram: https://gitdiagram.com/lipangit/jiaozivideoplayer
- Repository: https://github.com/lipangit/jiaozivideoplayer

## Overview

1. **Repository shape**
   - This is an Android multi-module project centered on a reusable video playback framework, with a separate demo app that exercises the framework in many scenarios.

2. **Module boundary**
   - `jiaozivideoplayer/` is the core library.
   - `app/` is the sample application and integration testbed.
   - The demo app depends on the library and adds custom player variants, sample activities, layouts, and assets.

3. **Core playback engine**
   - The library’s main runtime lives in `cn.jzvd`.
   - `Jzvd` is the base player component and state machine.
   - `JzvdStd` is the standard out-of-the-box UI/player implementation.
   - `JZTextureView`, `JZUtils`, and `JZDataSource` support rendering, utility behavior, and source selection.

4. **Media backend abstraction**
   - Playback is abstracted behind `JZMediaInterface`.
   - `JZMediaSystem` is the built-in system-media backend.
   - The app adds alternative implementations in `app/src/main/java/cn/jzvd/demo/CustomMedia/`, including `JZMediaExo` and `JZMediaIjk`, showing that the architecture supports swapping media engines without changing the player UI layer.

5. **UI and control surface**
   - The library includes its own reusable playback chrome in `res/layout` and `res/drawable`.
   - These resources cover seek bars, play/pause/replay controls, dialogs for brightness/volume/progress, clarity selection, loading/retry states, and skins.
   - This indicates the UI is tightly coupled to the player state machine but still themeable through resources.

6. **Player behavior and modes**
   - The framework supports multiple interaction modes: standard inline playback, fullscreen transitions, tiny-window playback, orientation handling, list/recycler embedding, auto-preload, and web content embedding.
   - The sample classes make these modes explicit through names like `ActivityTinyWindow`, `ActivityPreloading`, `ActivityListViewRecyclerView`, and `ActivityWebView`.

7. **Demo application as integration layer**
   - `app/src/main/java/cn/jzvd/demo/` contains the app entry point (`ActivityMain`) and a matrix of sample screens.
   - These activities are not core logic; they demonstrate how the library behaves in different containers and lifecycle scenarios.

8. **Customization examples**
   - The `CustomJzvd/` package demonstrates extension points for specialized player skins and behaviors, such as custom title/share button visibility, speed controls, MP3 playback UI, tiny-window variants, and post-completion behavior.
   - This suggests the intended extension mechanism is subclassing the player component and supplying custom layouts/resources.

9. **List and feed integration**
   - Several activities and adapters target list-based feeds: `ActivityListView*`, `ActivityTinyWindowRecycleView*`, `AdapterListView`, and `AdapterRecyclerView`.
   - These samples indicate the library is designed to manage playback handoff and window state inside scrolling containers, a common challenge for video feeds.

10. **Assets and embedded content**
   - The app ships a local sample video in `app/src/main/assets/local_video.mp4` and an HTML asset `jzvd.html`.
   - These assets support offline demo scenarios, including direct playback and webview embedding.

11. **Platform and build characteristics**
   - This is a Gradle-based Android project, with the usual manifest, resources, ProGuard rules, wrapper, and a keystore for the demo app.
   - The library includes localized string resources across multiple languages, reinforcing that the framework UI is intended for broad end-user use, not just internal testing.

12. **Architectural summary**
   - The key flow is: demo activity or host view configures a `Jzvd`/`JzvdStd` instance, which binds a `JZDataSource`, delegates decoding/rendering to a `JZMediaInterface` implementation, and uses bundled UI resources to manage playback state.
   - The main boundary is between the reusable playback library and the demo app’s customizations and scenario-specific integrations.

Main entry points: [`jiaozivideoplayer`](https://github.com/lipangit/jiaozivideoplayer/tree/develop/jiaozivideoplayer) (jiaozivideoplayer), [`app`](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app) (app), [`jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java`](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java) (JzvdStd), [`jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java`](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java) (Jzvd)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core library"]
  node_module_core["jiaozivideoplayer<br/>Android library module"]
  node_jzvd["Jzvd<br/>player state machine<br/>[Jzvd.java]"]
  node_jzvdstd["JzvdStd<br/>standard player UI<br/>[JzvdStd.java]"]
  node_mediaif["JZMediaInterface<br/>media backend API"]
  node_mediasystem["JZMediaSystem<br/>system media backend<br/>[JZMediaSystem.java]"]
  node_textureview["JZTextureView<br/>render surface<br/>[JZTextureView.java]"]
  node_utils["JZUtils<br/>player utilities<br/>[JZUtils.java]"]
  node_datasource["JZDataSource<br/>source model<br/>[JZDataSource.java]"]
  node_uires["Player resources<br/>layout/drawable resources"]
end

subgraph group_demo["Demo app"]
  node_module_demo["app"]
  node_activitymain["ActivityMain<br/>demo entry screen<br/>[ActivityMain.java]"]
  node_activities["Scenario activities<br/>demo screens"]
  node_customjzvd["CustomJzvd<br/>player extensions"]
  node_custommedia["CustomMedia<br/>media backends"]
  node_adapters["List adapters<br/>feed integration"]
  node_demores["Demo resources<br/>layouts and assets"]
  node_assets["Sample assets<br/>embedded media"]
end

node_module_core -->|"contains"| node_jzvd
node_module_core -->|"contains"| node_jzvdstd
node_module_core -->|"defines"| node_mediaif
node_module_core -->|"provides"| node_mediasystem
node_module_core -->|"contains"| node_textureview
node_module_core -->|"contains"| node_utils
node_module_core -->|"contains"| node_datasource
node_module_core -->|"bundles"| node_uires
node_jzvd -->|"delegates to"| node_mediaif
node_jzvd -->|"uses"| node_datasource
node_jzvd -->|"renders on"| node_textureview
node_jzvdstd -->|"extends"| node_jzvd
node_jzvdstd -->|"uses"| node_uires
node_mediasystem -->|"implements"| node_mediaif
node_module_demo -->|"contains"| node_activitymain
node_module_demo -->|"contains"| node_activities
node_module_demo -->|"contains"| node_customjzvd
node_module_demo -->|"contains"| node_custommedia
node_module_demo -->|"contains"| node_adapters
node_module_demo -->|"contains"| node_demores
node_module_demo -->|"ships"| node_assets
node_activitymain -->|"launches"| node_activities
node_activities -->|"configures"| node_jzvdstd
node_customjzvd -->|"extends"| node_jzvdstd
node_custommedia -->|"implements"| node_mediaif
node_custommedia -->|"pairs with"| node_jzvdstd
node_adapters -->|"hosts"| node_jzvdstd
node_activities -->|"uses"| node_assets

click node_module_core "https://github.com/lipangit/jiaozivideoplayer/tree/develop/jiaozivideoplayer"
click node_module_demo "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app"
click node_jzvd "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java"
click node_jzvdstd "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java"
click node_mediaif "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaInterface.java"
click node_mediasystem "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java"
click node_textureview "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZTextureView.java"
click node_utils "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java"
click node_datasource "https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java"
click node_uires "https://github.com/lipangit/jiaozivideoplayer/tree/develop/jiaozivideoplayer/src/main/res"
click node_activitymain "https://github.com/lipangit/jiaozivideoplayer/blob/develop/app/src/main/java/cn/jzvd/demo/ActivityMain.java"
click node_activities "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo"
click node_customjzvd "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo/CustomJzvd"
click node_custommedia "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo/CustomMedia"
click node_adapters "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo"
click node_demores "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/res"
click node_assets "https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/assets"

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_module_core,node_jzvd,node_jzvdstd,node_mediaif,node_mediasystem,node_textureview,node_utils,node_datasource,node_uires toneBlue
class node_module_demo,node_activitymain,node_activities,node_customjzvd,node_custommedia,node_adapters,node_demores,node_assets toneAmber
```

## Components

### Core library

Reusable playback framework and bundled UI resources.

- [jiaozivideoplayer](https://github.com/lipangit/jiaozivideoplayer/tree/develop/jiaozivideoplayer): Android library module · Reusable video playback framework. · `jiaozivideoplayer`
- [Jzvd](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java): player state machine · Base playback component and lifecycle/state coordinator. · `jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java`
- [JzvdStd](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java): standard player UI · Default reusable player implementation built on Jzvd. · `jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java`
- [JZMediaInterface](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaInterface.java): media backend API · Abstraction layer for decoding and playback engines. · `jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaInterface.java`
- [JZMediaSystem](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java): system media backend · Built-in implementation of the media interface. · `jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java`
- [JZTextureView](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZTextureView.java): render surface · Video rendering surface used by the player. · `jiaozivideoplayer/src/main/java/cn/jzvd/JZTextureView.java`
- [JZUtils](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java): player utilities · Shared helper logic for player behavior and environment handling. · `jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java`
- [JZDataSource](https://github.com/lipangit/jiaozivideoplayer/blob/develop/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java): source model · Playback source selection and data holder. · `jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java`
- [Player resources](https://github.com/lipangit/jiaozivideoplayer/tree/develop/jiaozivideoplayer/src/main/res): layout/drawable resources · Bundled chrome, dialogs, controls, and state visuals for the player. · `jiaozivideoplayer/src/main/res`

### Demo app

Sample screens, custom player variants, and media backends used to exercise the library.

- [app](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app): Android sample app · Integration testbed and showcase for the library. · `app`
- [ActivityMain](https://github.com/lipangit/jiaozivideoplayer/blob/develop/app/src/main/java/cn/jzvd/demo/ActivityMain.java): demo entry screen · Main menu and launcher for the sample scenarios. · `app/src/main/java/cn/jzvd/demo/ActivityMain.java`
- [Scenario activities](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo): demo screens · Sample activities for fullscreen, tiny window, lists, web content, preloading, and orientation behaviors. · `app/src/main/java/cn/jzvd/demo`
- [CustomJzvd](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo/CustomJzvd): player extensions · Subclassed player variants that demonstrate customization points. · `app/src/main/java/cn/jzvd/demo/CustomJzvd`
- [CustomMedia](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo/CustomMedia): media backends · Alternative playback implementations that swap behind the player UI. · `app/src/main/java/cn/jzvd/demo/CustomMedia`
- [List adapters](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/java/cn/jzvd/demo): feed integration · RecyclerView and ListView adapters used to manage playback in scrolling feeds. · `app/src/main/java/cn/jzvd/demo`
- [Demo resources](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/res): layouts and assets · Demo layouts, selectors, sample HTML, and local video content. · `app/src/main/res`
- [Sample assets](https://github.com/lipangit/jiaozivideoplayer/tree/develop/app/src/main/assets): embedded media · Local video and HTML used for offline playback and WebView scenarios. · `app/src/main/assets`

## Connections

- jiaozivideoplayer → Jzvd: contains · Core playback runtime entry point.
- jiaozivideoplayer → JzvdStd: contains · Standard player implementation.
- jiaozivideoplayer → JZMediaInterface: defines · Backend abstraction for playback engines.
- jiaozivideoplayer → JZMediaSystem: provides · Default media backend.
- jiaozivideoplayer → JZTextureView: contains · Rendering surface support.
- jiaozivideoplayer → JZUtils: contains · Shared player helpers.
- jiaozivideoplayer → JZDataSource: contains · Playback source model.
- jiaozivideoplayer → Player resources: bundles · Reusable UI chrome and state resources.
- Jzvd → JZMediaInterface: delegates to · Player state machine forwards playback to backend implementations.
- Jzvd → JZDataSource: uses · Binds selected media source.
- Jzvd → JZTextureView: renders on · Hosts video output surface.
- JzvdStd → Jzvd: extends · Default UI builds on base player behavior.
- JzvdStd → Player resources: uses · Consumes bundled controls and dialogs.
- JZMediaSystem → JZMediaInterface: implements · System media engine implementation.
- app → ActivityMain: contains · Demo launcher.
- app → Scenario activities: contains · Scenario-driven sample screens.
- app → CustomJzvd: contains · Custom player subclasses.
- app → CustomMedia: contains · Alternative media engines.
- app → List adapters: contains · Feed/list integration helpers.
- app → Demo resources: contains · Sample layouts and UI assets.
- app → Sample assets: ships · Embedded sample media and HTML.
- ActivityMain → Scenario activities: launches · Entry screen routes to sample scenarios.
- Scenario activities → JzvdStd: configures · Screens instantiate and configure the standard player.
- CustomJzvd → JzvdStd: extends · Custom skins and behaviors build from the standard player.
- CustomMedia → JZMediaInterface: implements · Swappable playback engines.
- CustomMedia → JzvdStd: pairs with · Demonstrates backend swaps without changing the UI layer.
- List adapters → JzvdStd: hosts · Embeds players in list/feed containers.
- Scenario activities → Sample assets: uses · WebView and local-video demo content.
