mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-21 14:08:04 +02:00
Merge pull request #21 from R0m1k3/antigravity
feat: Implement a video player screen using Chewie for live, VOD, and…
This commit is contained in:
commit
24b84942aa
1 file changed
+13
@@ -45,8 +45,18 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
|
|||||||
|
|
||||||
Future<void> _initializePlayer() async {
|
Future<void> _initializePlayer() async {
|
||||||
try {
|
try {
|
||||||
|
// Validate playlist before proceeding
|
||||||
|
if (widget.playlist.dns.isEmpty ||
|
||||||
|
widget.playlist.username.isEmpty ||
|
||||||
|
widget.playlist.password.isEmpty) {
|
||||||
|
throw Exception('Invalid playlist configuration: missing credentials');
|
||||||
|
}
|
||||||
|
|
||||||
final xtreamService = ref.read(xtreamServiceProvider(widget.playlist));
|
final xtreamService = ref.read(xtreamServiceProvider(widget.playlist));
|
||||||
|
|
||||||
|
// Explicitly ensure playlist is set (defensive programming)
|
||||||
|
xtreamService.setPlaylist(widget.playlist);
|
||||||
|
|
||||||
// Generate stream URL based on type
|
// Generate stream URL based on type
|
||||||
late String streamUrl;
|
late String streamUrl;
|
||||||
switch (widget.streamType) {
|
switch (widget.streamType) {
|
||||||
@@ -66,6 +76,9 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Debug: Print stream URL to console
|
||||||
|
debugPrint('PlayerScreen: Initializing stream URL: $streamUrl');
|
||||||
|
|
||||||
_videoPlayerController = VideoPlayerController.networkUrl(
|
_videoPlayerController = VideoPlayerController.networkUrl(
|
||||||
Uri.parse(streamUrl),
|
Uri.parse(streamUrl),
|
||||||
|
|||||||
Reference in new issue
Block a user