feat: add mobile-optimized IPTV player with HLS and MpegTS support

This commit is contained in:
Michael committed 2026-03-29 10:19:36 +02:00
1 parent 3c9a9c7be7
commit fa6ae90d8d
38 files changed
+1280 -895

No files matched your search

+31 -18
View File
@@ -36,19 +36,25 @@ class SeasonPassesApi {
final streamUrl = data['stream_url'] as String?;
if (showTitle == null || showTitle.isEmpty) {
return Response(400,
body: json.encode({'error': 'show_title est requis'}),
headers: {'Content-Type': 'application/json'});
return Response(
400,
body: json.encode({'error': 'show_title est requis'}),
headers: {'Content-Type': 'application/json'},
);
}
if (channelId == null || channelId.isEmpty) {
return Response(400,
body: json.encode({'error': 'channel_id est requis'}),
headers: {'Content-Type': 'application/json'});
return Response(
400,
body: json.encode({'error': 'channel_id est requis'}),
headers: {'Content-Type': 'application/json'},
);
}
if (streamUrl == null || streamUrl.isEmpty) {
return Response(400,
body: json.encode({'error': 'stream_url est requis'}),
headers: {'Content-Type': 'application/json'});
return Response(
400,
body: json.encode({'error': 'stream_url est requis'}),
headers: {'Content-Type': 'application/json'},
);
}
// Récupérer l'utilisateur depuis le contexte
@@ -57,13 +63,18 @@ class SeasonPassesApi {
// Vérifier si un season pass identique existe déjà
final existing = _db.getAllSeasonPasses();
final duplicate = existing.any((p) =>
(p['show_title'] as String).toLowerCase() == showTitle.toLowerCase() &&
p['channel_id'] == channelId);
final duplicate = existing.any(
(p) =>
(p['show_title'] as String).toLowerCase() ==
showTitle.toLowerCase() &&
p['channel_id'] == channelId,
);
if (duplicate) {
return Response(409,
body: json.encode({'error': 'Un Season Pass identique existe déjà'}),
headers: {'Content-Type': 'application/json'});
return Response(
409,
body: json.encode({'error': 'Un Season Pass identique existe déjà'}),
headers: {'Content-Type': 'application/json'},
);
}
final pass = _db.createSeasonPass(
@@ -74,9 +85,11 @@ class SeasonPassesApi {
);
print('[SeasonPass] Créé: "$showTitle" sur chaîne $channelId');
return Response(201,
body: json.encode(pass),
headers: {'Content-Type': 'application/json'});
return Response(
201,
body: json.encode(pass),
headers: {'Content-Type': 'application/json'},
);
} catch (e) {
return Response.internalServerError(
body: json.encode({'error': 'Erreur: $e'}),