mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-12 01:36:20 +02:00
feat: implement web-based IPTV player using HLS.js and mpegts.js with parent frame communication
This commit is contained in:
1 parent
10230aa131
commit
4f484be343
2 files changed
+22
-4
No files matched your search
@@ -157,6 +157,15 @@ class _MoviesTabState extends ConsumerState<MoviesTab> {
|
||||
);
|
||||
}
|
||||
|
||||
String? _getProxiedIconUrl(String? originalUrl) {
|
||||
if (originalUrl == null || originalUrl.isEmpty) return null;
|
||||
// Proxy toutes les URLs externes (http et https) via notre serveur
|
||||
if (originalUrl.startsWith('http://') || originalUrl.startsWith('https://')) {
|
||||
return '/api/xtream/$originalUrl';
|
||||
}
|
||||
return originalUrl;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settings = ref.watch(iptvSettingsProvider);
|
||||
@@ -175,7 +184,7 @@ class _MoviesTabState extends ConsumerState<MoviesTab> {
|
||||
final heroItems = displayMovies.take(5).map((m) => HeroItem(
|
||||
id: m.streamId,
|
||||
title: m.name,
|
||||
imageUrl: m.streamIcon ?? '',
|
||||
imageUrl: _getProxiedIconUrl(m.streamIcon) ?? '',
|
||||
subtitle: m.rating != null ? '${_formatRating(m.rating)} ★' : null,
|
||||
onMoreInfo: () {
|
||||
_playMovie(m);
|
||||
@@ -291,7 +300,7 @@ class _MoviesTabState extends ConsumerState<MoviesTab> {
|
||||
|
||||
return MediaCard(
|
||||
title: movie.name,
|
||||
imageUrl: movie.streamIcon,
|
||||
imageUrl: _getProxiedIconUrl(movie.streamIcon),
|
||||
|
||||
subtitle: movie.rating != null ? '${_formatRating(movie.rating)} ★' : null,
|
||||
rating: _formatRating(movie.rating),
|
||||
|
||||
@@ -152,6 +152,15 @@ class _SeriesTabState extends ConsumerState<SeriesTab> {
|
||||
);
|
||||
}
|
||||
|
||||
String? _getProxiedIconUrl(String? originalUrl) {
|
||||
if (originalUrl == null || originalUrl.isEmpty) return null;
|
||||
// Proxy toutes les URLs externes (http et https) via notre serveur
|
||||
if (originalUrl.startsWith('http://') || originalUrl.startsWith('https://')) {
|
||||
return '/api/xtream/$originalUrl';
|
||||
}
|
||||
return originalUrl;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settings = ref.watch(iptvSettingsProvider);
|
||||
@@ -173,7 +182,7 @@ class _SeriesTabState extends ConsumerState<SeriesTab> {
|
||||
final heroItems = displaySeries.take(5).map((s) => HeroItem(
|
||||
id: s.seriesId.toString(), // ID logic might differ for Series
|
||||
title: s.name,
|
||||
imageUrl: s.cover ?? '',
|
||||
imageUrl: _getProxiedIconUrl(s.cover) ?? '',
|
||||
subtitle: s.rating != null ? '${_formatRating(s.rating)} ★' : null,
|
||||
onMoreInfo: () => _openSeries(s),
|
||||
)).toList();
|
||||
@@ -281,7 +290,7 @@ class _SeriesTabState extends ConsumerState<SeriesTab> {
|
||||
final serie = displaySeries[index];
|
||||
return MediaCard(
|
||||
title: serie.name,
|
||||
imageUrl: serie.cover,
|
||||
imageUrl: _getProxiedIconUrl(serie.cover),
|
||||
|
||||
subtitle: serie.rating != null ? '${_formatRating(serie.rating)} ★' : null,
|
||||
rating: _formatRating(serie.rating),
|
||||
|
||||
Reference in new issue
Block a user