mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-23 15:08:07 +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
89d8951d08
commit
5ec3169bd0
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final settings = ref.watch(iptvSettingsProvider);
|
final settings = ref.watch(iptvSettingsProvider);
|
||||||
@@ -175,7 +184,7 @@ class _MoviesTabState extends ConsumerState<MoviesTab> {
|
|||||||
final heroItems = displayMovies.take(5).map((m) => HeroItem(
|
final heroItems = displayMovies.take(5).map((m) => HeroItem(
|
||||||
id: m.streamId,
|
id: m.streamId,
|
||||||
title: m.name,
|
title: m.name,
|
||||||
imageUrl: m.streamIcon ?? '',
|
imageUrl: _getProxiedIconUrl(m.streamIcon) ?? '',
|
||||||
subtitle: m.rating != null ? '${_formatRating(m.rating)} ★' : null,
|
subtitle: m.rating != null ? '${_formatRating(m.rating)} ★' : null,
|
||||||
onMoreInfo: () {
|
onMoreInfo: () {
|
||||||
_playMovie(m);
|
_playMovie(m);
|
||||||
@@ -291,7 +300,7 @@ class _MoviesTabState extends ConsumerState<MoviesTab> {
|
|||||||
|
|
||||||
return MediaCard(
|
return MediaCard(
|
||||||
title: movie.name,
|
title: movie.name,
|
||||||
imageUrl: movie.streamIcon,
|
imageUrl: _getProxiedIconUrl(movie.streamIcon),
|
||||||
|
|
||||||
subtitle: movie.rating != null ? '${_formatRating(movie.rating)} ★' : null,
|
subtitle: movie.rating != null ? '${_formatRating(movie.rating)} ★' : null,
|
||||||
rating: _formatRating(movie.rating),
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final settings = ref.watch(iptvSettingsProvider);
|
final settings = ref.watch(iptvSettingsProvider);
|
||||||
@@ -173,7 +182,7 @@ class _SeriesTabState extends ConsumerState<SeriesTab> {
|
|||||||
final heroItems = displaySeries.take(5).map((s) => HeroItem(
|
final heroItems = displaySeries.take(5).map((s) => HeroItem(
|
||||||
id: s.seriesId.toString(), // ID logic might differ for Series
|
id: s.seriesId.toString(), // ID logic might differ for Series
|
||||||
title: s.name,
|
title: s.name,
|
||||||
imageUrl: s.cover ?? '',
|
imageUrl: _getProxiedIconUrl(s.cover) ?? '',
|
||||||
subtitle: s.rating != null ? '${_formatRating(s.rating)} ★' : null,
|
subtitle: s.rating != null ? '${_formatRating(s.rating)} ★' : null,
|
||||||
onMoreInfo: () => _openSeries(s),
|
onMoreInfo: () => _openSeries(s),
|
||||||
)).toList();
|
)).toList();
|
||||||
@@ -281,7 +290,7 @@ class _SeriesTabState extends ConsumerState<SeriesTab> {
|
|||||||
final serie = displaySeries[index];
|
final serie = displaySeries[index];
|
||||||
return MediaCard(
|
return MediaCard(
|
||||||
title: serie.name,
|
title: serie.name,
|
||||||
imageUrl: serie.cover,
|
imageUrl: _getProxiedIconUrl(serie.cover),
|
||||||
|
|
||||||
subtitle: serie.rating != null ? '${_formatRating(serie.rating)} ★' : null,
|
subtitle: serie.rating != null ? '${_formatRating(serie.rating)} ★' : null,
|
||||||
rating: _formatRating(serie.rating),
|
rating: _formatRating(serie.rating),
|
||||||
|
|||||||
Reference in new issue
Block a user