Skip to content

Commit

Permalink
Fix error when only one resolution is available
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedon-dev committed Mar 30, 2024
1 parent 80e0187 commit ed61c8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ui/screens/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:window_manager/window_manager.dart';
class VideoPlayerScreen extends StatefulWidget {
final UniversalVideoMetadata videoMetadata;

const VideoPlayerScreen({required this.videoMetadata});
const VideoPlayerScreen({super.key, required this.videoMetadata});

@override
State<VideoPlayerScreen> createState() => _VideoPlayerScreenState();
Expand Down Expand Up @@ -61,6 +61,8 @@ class _VideoPlayerScreenState extends State<VideoPlayerScreen> {
}
selectedResolution = nextHighest;
}
} else {
selectedResolution = sortedResolutions![0];
}
// Check if m3u8 links exist and display toast message
if (widget.videoMetadata.m3u8Uris[selectedResolution] == null) {
Expand Down

0 comments on commit ed61c8f

Please sign in to comment.