Il proxy Rails gestisce il redirect MediaMTX su /live/match_* e riscrive le playlist; edge nginx reindirizza /live/ sotto /hls/. Su iOS, SessionBuilder HaishinKit, pipeline mixer corretta e refresh token. Co-authored-by: Cursor <cursoragent@cursor.com>
Match Live TV — app iOS nativa
Porting SwiftUI dell'app Android con stessa UI, brand e contratti API backend.
Stack
- UI: SwiftUI, NavigationStack
- Rete: URLSession + Codable
- Auth: Keychain
- Streaming: HaishinKit (RTMP) + AVFoundation
- Overlay: Core Graphics (bitmap composito su pipeline video)
Struttura
MatchLiveTv/
App/ — entry point
Core/ — config, token store, utility
Data/ — API, repository, ActionCable
Domain/ — modelli
Streaming/ — motore RTMP, overlay nativi
UI/ — schermate SwiftUI
Resources/ — Assets.xcassets (brand), Info.plist
Parità multi-sport (riferimento: docs/TABELLONI_E_OVERLAY.md)
| Board | Controlli broadcast | Overlay video | Stato iOS |
|---|---|---|---|
| volley / racket | +1, undo, chiudi set (API close_set) |
Tabellone a colonne | Completo |
| basket | +1/+2/+3, undo, advance_period |
Compact scoreboard | Completo |
| timed | +1, undo, advance_period |
Compact scoreboard | Completo |
| generic | +1 / undo locale | Watermark | Completo |
| timer | — | Solo watermark | Completo |
Il cronometro basket/timed è gestito in regia web, non sull'overlay video (come Android).
Asset brand
Gli asset in brand/ sono importati in Resources/Assets.xcassets:
logo-white-m,logo-white-m-256— wordmark e watermarklogo-dark-gradient,logo-dark-gradient-256— app iconCopertinaCanale*.png— riferimenti visivi brand
Build
python3 generate_xcodeproj.py # rigenera MatchLiveTv.xcodeproj
./scripts/build_ios_release.sh
Override API: API_BASE_URL=https://staging.example.com ./scripts/build_ios_release.sh
Test
cd native/ios
python3 generate_xcodeproj.py
xcodebuild -project MatchLiveTv.xcodeproj -scheme MatchLiveTv \
-destination 'platform=iOS Simulator,name=iPhone 17' \
-derivedDataPath build/DerivedData \
ONLY_ACTIVE_ARCH=YES ARCHS=arm64 EXCLUDED_ARCHS=x86_64 \
test -only-testing:MatchLiveTvTests
Requisiti
- Xcode 16+
- iOS 16+
- Mac con Apple Silicon o Intel
Funzionalità
- Login JWT, hub partite (reload al ritorno da diretta), wizard 3 step
- Diretta RTMP 1280×720 con overlay tabellone/watermark
- ActionCable SessionChannel per punteggio e comandi regia
- Telemetria dispositivo periodica
- Orientamento: portrait ovunque, landscape solo in broadcast
Documentazione correlata
docs/TABELLONI_E_OVERLAY.md— regolamenti, board, overlaydocs/MULTI_SPORT.md— catalogo sport e engine scoringdocs/ARCHITECTURE.md— infrastruttura e flussi live/HLS