# hansjd/kvflight architecture

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

- Interactive diagram: https://gitdiagram.com/hansjd/kvflight
- Repository: https://github.com/hansjd/kvflight

## Overview

kvflight is a small iOS live-streaming app represented by Swift and Xamarin implementations. Users open the app to watch an HLS stream; the Xamarin player checks configured stream addresses before playback and reloads on foregrounding, while the Swift player starts a configured stream and also reloads on foregrounding. The sampled files show playback and lifecycle behavior, but the README documents no additional capabilities; storyboard wiring was not inspected.

Main entry points: [`Xamarin/kvflight/Main.cs`](https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/Main.cs) (Xamarin entry), [`Swift/kvflight/ViewController.swift`](https://github.com/hansjd/kvflight/blob/master/Swift/kvflight/ViewController.swift) (Swift stream player), [`Xamarin/kvflight/ViewController.cs`](https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/ViewController.cs) (Xamarin stream player), [`Xamarin/kvflight/AppDelegate.cs`](https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/AppDelegate.cs) (Xamarin app setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["App lifecycle"]
  node_swift_app["Swift app setup<br/>[AppDelegate.swift]"]
  node_xamarin_entry["Xamarin entry<br/>[Main.cs]"]
  node_xamarin_app["Xamarin app setup<br/>[AppDelegate.cs]"]
end

subgraph group_swift["Swift player"]
  node_swift_player["Swift stream player"]
end

subgraph group_xamarin["Xamarin player"]
  node_xamarin_player["Xamarin stream player<br/>[ViewController.cs]"]
end

node_user(("Viewer"))
node_stream_service["HLS streams"]

node_xamarin_entry -->|"starts app"| node_xamarin_app
node_swift_player -->|"requests stream"| node_stream_service
node_xamarin_player -->|"checks and plays"| node_stream_service

click node_swift_app "https://github.com/hansjd/kvflight/blob/master/Swift/kvflight/AppDelegate.swift"
click node_xamarin_entry "https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/Main.cs"
click node_xamarin_app "https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/AppDelegate.cs"
click node_swift_player "https://github.com/hansjd/kvflight/blob/master/Swift/kvflight/ViewController.swift"
click node_xamarin_player "https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/ViewController.cs"

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_swift_app,node_xamarin_entry,node_xamarin_app,node_user toneBlue
class node_swift_player toneAmber
class node_xamarin_player toneMint
class node_stream_service toneIndigo
```

## Components

### App lifecycle

- [Swift app setup](https://github.com/hansjd/kvflight/blob/master/Swift/kvflight/AppDelegate.swift): `Swift/kvflight/AppDelegate.swift`
- [Xamarin entry](https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/Main.cs): `Xamarin/kvflight/Main.cs`
- [Xamarin app setup](https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/AppDelegate.cs): `Xamarin/kvflight/AppDelegate.cs`

### Swift player

- [Swift stream player](https://github.com/hansjd/kvflight/blob/master/Swift/kvflight/ViewController.swift): `Swift/kvflight/ViewController.swift`

### Xamarin player

- [Xamarin stream player](https://github.com/hansjd/kvflight/blob/master/Xamarin/kvflight/ViewController.cs): `Xamarin/kvflight/ViewController.cs`

### Other components

- **Viewer**
- **HLS streams**

## Connections

- Xamarin entry → Xamarin app setup: starts app (evidence: `Xamarin/kvflight/Main.cs`)
- Swift stream player → HLS streams: requests stream (evidence: `Swift/kvflight/ViewController.swift`)
- Xamarin stream player → HLS streams: checks and plays (evidence: `Xamarin/kvflight/ViewController.cs`)
