# mrbipbip/xtream-iptv-player-v3 architecture

> Architecture diagram of the GitHub repository mrbipbip/xtream-iptv-player-v3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrbipbip/xtream-iptv-player-v3
- Repository: https://github.com/mrbipbip/xtream-iptv-player-v3

## Overview

##### Main Components

a. Client-Side Components:
- UI Layer
- Activities (Dashboard, Live Streams, VOD, EPG, Settings)
- Fragments
- Adapters
- Custom Views

- Player Components
- ExoPlayer Integration
- NST Player Implementation
- VLC Player Integration
- MX Player Integration

- Core Services
- EPG Service
- Streaming Service
- Authentication Service

b. Backend Integration:
- API Communication Layer
- Retrofit Client
- API Endpoints
- Callback Handlers

c. Data Management:
- Local Storage
- SQLite Database (DatabaseHandler)
- Cache Management
- Preferences Storage

##### Layer Structure (top to bottom)

**[UI Layer]**
- ↕
**[Presenter Layer]**
- ↕
**[Business Logic Layer]**
- ↕
**[Data Layer]**
- ↕
**[Network Layer]**

##### Key Relationships

- Player Integration Flow:
**[UI Activities] → [Player Selection] → [Specific Player Implementation]**
- ↓
- [Stream Handling]
- ↓
- [Media Playback]

- Data Flow:
**[API Client] → [Data Models] → [Local Database] → [UI Components]**

##### Component Details

Use these symbols:
- Cloud symbol for API endpoints
- Rectangles with rounded corners for services
- Straight rectangles for activities/fragments

##### Specific Features

- Authentication flow
- Live TV streaming
- VOD playback
- EPG synchronization
- Parental controls
- Category management
- Favorites system
- Search functionality

- UI components
- Business logic
- Data management
- Player implementations
- Network communication

This system design should reflect the complex nature of the IPTV player while maintaining clarity in showing how different components interact with each other.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef player fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef network fill:#e74c3c,stroke:#c0392b,color:white
    classDef service fill:#9b59b6,stroke:#8e44ad,color:white
    classDef interface fill:#95a5a6,stroke:#7f8c8d,color:white

    %% UI Layer
    subgraph UI
        Activities["Activities"]:::ui
        Fragments["Fragments"]:::ui
        Adapters["Adapters"]:::ui
        CustomViews["Custom Views"]:::ui
    end

    %% Player Layer
    subgraph Players
        PlayerSelection["Player Selection"]:::interface
        ExoPlayer["ExoPlayer"]:::player
        NSTPlayer["NST Player"]:::player
        VLCPlayer["VLC Player"]:::player
        MXPlayer["MX Player"]:::player
    end

    %% Services Layer
    subgraph Services
        EPGService["EPG Service"]:::service
        StreamingService["Streaming Service"]:::service
        AuthService["Authentication Service"]:::service
    end

    %% Data Layer
    subgraph Data
        Database[(SQLite Database)]:::data
        Cache["Cache Management"]:::data
        Preferences["Preferences Storage"]:::data
        DataModels["Data Models"]:::data
    end

    %% Network Layer
    subgraph Network
        RetrofitClient["Retrofit Client"]:::network
        APIEndpoints["API Endpoints"]:::network
        Callbacks["Callback Handlers"]:::network
    end

    %% Interfaces
    Interfaces["Common Interfaces"]:::interface

    %% Relationships
    Activities --> PlayerSelection
    Fragments --> PlayerSelection
    PlayerSelection --> ExoPlayer & NSTPlayer & VLCPlayer & MXPlayer
    Activities & Fragments --> EPGService
    EPGService --> Database
    Activities --> StreamingService
    StreamingService --> RetrofitClient
    RetrofitClient --> APIEndpoints
    APIEndpoints --> Callbacks
    Callbacks --> DataModels
    DataModels --> Database
    Database --> Activities
    AuthService --> RetrofitClient
    Interfaces --> Players
    Adapters --> Activities
    CustomViews --> Activities

    %% Click Events
    click Activities "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/activity/"
    click Fragments "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/fragment/"
    click Adapters "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/adapter/"
    click ExoPlayer "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/exoplayer2/"
    click NSTPlayer "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/nstplayer/"
    click Database "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/model/database/"
    click DataModels "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/model/"
    click Callbacks "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/model/callback/"
    click APIEndpoints "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/model/webrequest/"
    click EPGService "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/utility/epg/"
    click Interfaces "https://github.com/mrbipbip/xtream-iptv-player-v3/tree/master/src/main/java/z/xtreamiptv/playerv3/v2api/view/interfaces/"
```
