mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-21 22:18:04 +02:00
feat: implement initial mobile IPTV feature with player screen, live TV, movies, and series tabs, along with the Xtream API service.
This commit is contained in:
1 parent
b1f887af69
commit
829c5751ca
6 files changed
+112
-80
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../../../features/iptv/screens/player_screen.dart';
|
||||
export '../../../../features/iptv/screens/player_screen.dart' show StreamType;
|
||||
import '../../../../core/models/playlist_config.dart';
|
||||
import '../../../../features/iptv/widgets/lite_player_view.dart';
|
||||
import '../../../../features/iptv/providers/xtream_provider.dart';
|
||||
|
||||
/// Mobile wrapper for the PlayerScreen.
|
||||
/// Currently reuses the desktop PlayerScreen as it adapts well to mobile (video player),
|
||||
/// but allows for future mobile-specific overlays or gesture controls.
|
||||
class MobilePlayerScreen extends StatelessWidget {
|
||||
class MobilePlayerScreen extends ConsumerWidget {
|
||||
final String streamId;
|
||||
final String title;
|
||||
final StreamType streamType;
|
||||
@@ -23,15 +23,35 @@ class MobilePlayerScreen extends StatelessWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// For now, we reuse the existing PlayerScreen which is responsive.
|
||||
// In the future, we can add Mobile-specific gesture detectors here.
|
||||
return PlayerScreen(
|
||||
streamId: streamId,
|
||||
title: title,
|
||||
playlist: playlist,
|
||||
streamType: streamType,
|
||||
containerExtension: containerExtension,
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final service = ref.read(xtreamServiceProvider(playlist));
|
||||
String streamUrl = '';
|
||||
|
||||
if (streamType == StreamType.live) {
|
||||
streamUrl = service.getLiveStreamUrl(streamId);
|
||||
} else if (streamType == StreamType.vod) {
|
||||
streamUrl = service.getVodStreamUrl(streamId, containerExtension);
|
||||
} else if (streamType == StreamType.series) {
|
||||
streamUrl = service.getSeriesStreamUrl(streamId, containerExtension);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
title: Text(title, style: const TextStyle(color: Colors.white)),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: LitePlayerView(
|
||||
streamUrl: streamUrl,
|
||||
isLive: streamType == StreamType.live,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user