# videolan/vlc-ios architecture

> Architecture diagram of the GitHub repository videolan/vlc-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/videolan/vlc-ios
- Repository: https://github.com/videolan/vlc-ios

## Overview

This project is the official VLC repository for iOS and tvOS applications, implemented in both Objective‑C and Swift. Given its purpose—to manage media playback, network streaming and associated services—it is a complex, multi-platform mobile application that relies on a mix of in‑house modules and external frameworks (VLCKit/MobileVLCKit) to provide robust media handling functionality.

##### Main Components
- Build and CI Infrastructure:
– Represent the build scripts/build systems (Buildsystem, Fastlane files, podfiles, etc.).
– Include CI configurations (e.g., .gitlab-ci.yml) and automated testing frameworks under the “Build/Testing” layer.
- Application Core:
– Divide this into distinct modules as seen under Sources. For example, separate components for App (iOS and tvOS), CarPlay integration, Playback, Media Library, Onboarding, Cloud services, Network, and Settings.
– Highlight the architectural pattern(s) in use. For instance, many components appear to be built around MVC, MVVM or coordinator patterns (e.g., the presence of “App Coordinators” and view controllers).
- External Frameworks and Libraries:
– Include VLCKit/MobileVLCKit as a critical external dependency used for media playback and handling.
– Represent how the application links to these frameworks.
- Resources and Localization:
– Show the vast amount of Resources (artwork, localizable strings, storyboards, xib files, etc.), which underpin the UI for multiple languages and devices.
- Platform Specific Elements:
– Showcase separate flows for iOS, tvOS (and CarPlay, WiFi Sharing) with their dedicated source folders and configurations.

##### Relationships and Interactions
- Data Flow from UI to Business Logic:
– Clearly indicate how user actions on the iOS or tvOS interfaces trigger events that are mediated by coordinator classes (e.g., “VLCAppCoordinator”, “VLCCarPlaySceneDelegate”).
- Integration with External Services:
– Illustrate the connection between internal network modules (Network/Server Browsing, Cloud Services) and external media servers or online services (e.g., Dropbox, Google Drive, OneDrive, PCloud).
- Modular Partitioning:
– Emphasize boundaries between modules such as “Playback”, “Network”, “Settings” and “Media Library”.
– Indicate dependencies between these modules (for example, a “Playback Controller” might call the “Player Service”, which in turn uses VLCKit).
- Build and Deployment Pipeline:
– Add a block for the Buildsystem that shows interactions with Podfile management and custom VLCKit builds, which then feed the framework dependency into the main application build.

##### Architectural Patterns and Important Details
- The project follows established design principles for iOS app development:
– Use of Coordinators for managing flows (“TabBarCoordinator”, “VLCAppCoordinator”).
– Separation of concerns across dedicated modules (Network, Media Library, UI, Extensions, etc.).
- Platform-specific differentiations are clear in the Sources folder (for iOS vs. tvOS vs. CarPlay vs. WiFi Sharing).
- The build system and continuous integration (e.g., Fastlane under Buildsystem/Fastlane and .gitlab-ci.yml) should be drawn as part of the overall ecosystem.
- External dependencies, especially VLCKit/MobileVLCKit, are central to enabling media playback of VLC’s extensive feature set.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Infrastructure Layer
    subgraph "Build & Infrastructure"
        B1[".gitlab-ci.yml"]
        B2["Buildsystem"]
        B3["Podfile"]
        B4["Fastlane Files"]
    end

    %% Application Core Layer
    subgraph "Application Core"
        AC1["App Module - iOS"]
        AC2["App Module - tvOS"]
        AC3["CarPlay Integration"]
        AC4["Playback Module"]
        AC5["Media Library"]
        AC6["Onboarding"]
        AC7["Cloud Services"]
        AC8["Network Module"]
        AC9["Settings"]
    end

    %% External Frameworks & Resources Layer
    subgraph "External & Resources"
        ER1["VLCKit/MobileVLCKit"]
        ER2["Resources"]
        ER3["Resources/iOS"]
        ER4["Resources/tvOS"]
    end

    %% Build & Infrastructure Relationships
    B1 --> B2
    B2 --> B3
    B3 --> ER1

    %% External Relationship to Application Core
    ER1 --> AC4

    %% Application Core Internal Relationships
    AC1 --> AC4
    AC1 --> AC5
    AC1 --> AC6
    AC1 --> AC7
    AC1 --> AC8
    AC1 --> AC9
    AC1 --> AC3

    AC2 --> AC4
    AC2 --> AC5
    AC2 --> AC9

    AC8 -- "sync" --> AC7

    %% Resources Feeding into Application Core
    ER2 --> AC1
    ER2 --> AC2
    ER3 --> AC1
    ER4 --> AC2

    %% Class Definitions
    classDef build fill:#ffebcc,stroke:#f66,stroke-width:2px;
    classDef core fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef external fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef resource fill:#ffe6cc,stroke:#333,stroke-width:2px;

    %% Assign Classes
    class B1,B2,B3,B4 build;
    class AC1,AC2,AC3,AC4,AC5,AC6,AC7,AC8,AC9 core;
    class ER1 external;
    class ER2,ER3,ER4 resource;

    %% Click Events for Build & CI Infrastructure
    click B1 "https://github.com/videolan/vlc-ios/blob/master/.gitlab-ci.yml"
    click B2 "https://github.com/videolan/vlc-ios/tree/master/Buildsystem/"
    click B3 "https://github.com/videolan/vlc-ios/tree/master/Podfile"
    click B4 "https://github.com/videolan/vlc-ios/tree/master/Buildsystem/Fastlane"

    %% Click Events for Application Core
    click AC1 "https://github.com/videolan/vlc-ios/tree/master/Sources/App/iOS"
    click AC2 "https://github.com/videolan/vlc-ios/tree/master/Sources/App/tvOS"
    click AC3 "https://github.com/videolan/vlc-ios/tree/master/Sources/CarPlay"
    click AC4 "https://github.com/videolan/vlc-ios/tree/master/Sources/Playback"
    click AC5 "https://github.com/videolan/vlc-ios/tree/master/Sources/Media Library"
    click AC6 "https://github.com/videolan/vlc-ios/tree/master/Sources/Onboarding"
    click AC7 "https://github.com/videolan/vlc-ios/tree/master/Sources/Cloud"
    click AC8 "https://github.com/videolan/vlc-ios/tree/master/Sources/Network"
    click AC9 "https://github.com/videolan/vlc-ios/tree/master/Sources/Settings"

    %% Click Events for Resources
    click ER2 "https://github.com/videolan/vlc-ios/tree/master/Resources"
    click ER3 "https://github.com/videolan/vlc-ios/tree/master/Resources/iOS"
    click ER4 "https://github.com/videolan/vlc-ios/tree/master/Resources/tvOS"
```
