This commit is contained in:
2025-09-27 03:40:50 +02:00
parent f0f1818917
commit a0532db977

View File

@@ -596,7 +596,7 @@ class VideoPlayer:
"""Start the video player with specified mode """Start the video player with specified mode
Args: Args:
startup_mode: "default", "random", "channel", or "index" startup_mode: "default" (random), "random", "channel", or "index"
channel_number: Channel number to play (for channel mode) channel_number: Channel number to play (for channel mode)
video_index: Video index to play (for index mode) video_index: Video index to play (for index mode)
""" """
@@ -641,13 +641,8 @@ class VideoPlayer:
success = self.play_channel(channel_number) success = self.play_channel(channel_number)
elif startup_mode == "index" and video_index is not None: elif startup_mode == "index" and video_index is not None:
success = self.play_video_by_index(video_index) success = self.play_video_by_index(video_index)
else: # default mode else: # default mode - use random channel for variety
if self.default_channel in self.channels: success = self.play_random_video()
success = self.play_channel(self.default_channel)
else:
# Play first available channel
first_channel = min(self.channels.keys())
success = self.play_channel(first_channel)
if success: if success:
self.logger.info("Video player started successfully") self.logger.info("Video player started successfully")
@@ -752,7 +747,7 @@ def parse_arguments():
formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=""" epilog="""
Examples: Examples:
python3 video_player.py # Start with default channel (auto-assigned) python3 video_player.py # Start with random channel
python3 video_player.py --random # Start with random video python3 video_player.py --random # Start with random video
python3 video_player.py --channel 5 # Start with channel 5 (auto-assigned) python3 video_player.py --channel 5 # Start with channel 5 (auto-assigned)
python3 video_player.py --index 2 # Start with video at index 2 (0-based) python3 video_player.py --index 2 # Start with video at index 2 (0-based)