mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
feat(iptv): introduce web-based video player screen for live, VOD, and series content
This commit is contained in:
1 parent
e6c9dbf050
commit
86cf10051d
6 files changed
+51
-14
No files matched your search
@@ -125,6 +125,15 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
return rating;
|
||||
}
|
||||
|
||||
/// Proxy HTTP images through backend to avoid CORS/mixed-content issues
|
||||
String? _getProxiedImageUrl(String? originalUrl) {
|
||||
if (originalUrl == null || originalUrl.isEmpty) return null;
|
||||
if (originalUrl.startsWith('http://')) {
|
||||
return '/api/xtream/$originalUrl';
|
||||
}
|
||||
return originalUrl;
|
||||
}
|
||||
|
||||
void _playMovie(Movie movie) {
|
||||
ref.read(watchHistoryProvider.notifier).markMovieWatched(movie.streamId);
|
||||
|
||||
@@ -160,7 +169,7 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
final heroItems = _movies.take(3).map((m) => HeroItem(
|
||||
id: m.streamId,
|
||||
title: m.name,
|
||||
imageUrl: m.streamIcon ?? '',
|
||||
imageUrl: _getProxiedImageUrl(m.streamIcon),
|
||||
subtitle: m.rating != null ? '${_formatRating(m.rating)} ★' : null,
|
||||
onMoreInfo: () => _playMovie(m),
|
||||
)).toList();
|
||||
@@ -251,7 +260,7 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
|
||||
return MediaCard(
|
||||
title: movie.name,
|
||||
imageUrl: movie.streamIcon,
|
||||
imageUrl: _getProxiedImageUrl(movie.streamIcon),
|
||||
|
||||
subtitle: movie.rating != null ? '${_formatRating(movie.rating)} ★' : null,
|
||||
rating: _formatRating(movie.rating),
|
||||
|
||||
@@ -124,6 +124,15 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
return rating;
|
||||
}
|
||||
|
||||
/// Proxy HTTP images through backend to avoid CORS/mixed-content issues
|
||||
String? _getProxiedImageUrl(String? originalUrl) {
|
||||
if (originalUrl == null || originalUrl.isEmpty) return null;
|
||||
if (originalUrl.startsWith('http://')) {
|
||||
return '/api/xtream/$originalUrl';
|
||||
}
|
||||
return originalUrl;
|
||||
}
|
||||
|
||||
void _openSeries(Series series) {
|
||||
Navigator.push(
|
||||
context,
|
||||
@@ -153,7 +162,7 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
final heroItems = _series.take(3).map((s) => HeroItem(
|
||||
id: s.seriesId.toString(),
|
||||
title: s.name,
|
||||
imageUrl: s.cover ?? '',
|
||||
imageUrl: _getProxiedImageUrl(s.cover),
|
||||
subtitle: s.rating != null ? '${_formatRating(s.rating)} ★' : null,
|
||||
onMoreInfo: () => _openSeries(s),
|
||||
)).toList();
|
||||
@@ -251,7 +260,7 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
|
||||
return MediaCard(
|
||||
title: series.name,
|
||||
imageUrl: series.cover,
|
||||
imageUrl: _getProxiedImageUrl(series.cover),
|
||||
|
||||
subtitle: series.rating != null ? '${_formatRating(series.rating)} ★' : null,
|
||||
rating: _formatRating(series.rating),
|
||||
|
||||
Reference in new issue
Block a user