CHU-IPTV — Application Android TV Native
Architecture
app/src/main/java/fr/cosmolan/chuiptv/
├── ui/ # Couche présentation (Compose for TV)
│ ├── MainActivity.kt # Activity principale (mode kiosque)
│ ├── MainViewModel.kt # ViewModel principal (MVVM)
│ ├── home/ # Écran QR pairing
│ ├── player/ # Lecteur TV (Media3/ExoPlayer)
│ ├── remote/ # Overlay télécommande
│ └── settings/ # Configuration (room, serveur)
├── data/ # Couche données
│ ├── api/ # Retrofit API client
│ ├── model/ # Modèles de données
│ └── repository/ # Repositories
└── service/ # Services Android
├── PlaybackService.kt # MediaSession (lecture en arrière-plan)
├── HeartbeatService.kt # Monitoring heartbeat (30s)
├── SocketManager.kt # Socket.IO client
└── BootReceiver.kt # Démarrage automatique
Stack Technique
| Composant |
Technologie |
| UI |
Jetpack Compose for TV 1.0 |
| Player |
Media3 ExoPlayer (HLS) |
| Réseau |
Retrofit 2 + OkHttp 4 |
| WebSocket |
Socket.IO Client 2.1 |
| QR Code |
ZXing Core 3.5 |
| Images |
Coil Compose 2.5 |
| Persistance |
DataStore Preferences |
| Navigation |
Navigation Compose |
| Architecture |
MVVM + Repository Pattern |
Prérequis
- Android Studio Hedgehog (2023.1.1) ou supérieur
- JDK 17
- Android SDK 34
- Un appareil Android TV (ou émulateur TV)
Build
git clone https://git.cosmolan.fr/tarzzan/chu-iptv.git
cd chu-iptv/apps/android-tv
./gradlew assembleDebug
./gradlew installDebug
Mode Kiosque
adb shell dpm set-device-owner fr.cosmolan.chuiptv/.service.DeviceAdminReceiver
Navigation D-Pad
| Touche |
Action |
| CH+ / Haut |
Chaîne suivante |
| CH- / Bas |
Chaîne précédente |
| OK / Enter |
Afficher overlay infos |
| Back |
Masquer overlay |
| Vol+ |
Volume + |
| Vol- |
Volume - |
| Menu |
Afficher le guide EPG |