remove fade in effect

This commit is contained in:
2025-05-10 21:42:30 +03:00
parent bbaa720775
commit 3747f6133b

View File

@@ -153,7 +153,7 @@ class MediaPlayer(Screen):
Logger.error(f"Unsupported media type for file: {file_name}")
def play_video(self, file_path):
"""Play a video file with a fade-in effect."""
"""Play a video file without a fade-in effect."""
Logger.info(f"Playing video: {file_path}")
if not os.path.exists(file_path):
Logger.error(f"Video file not found: {file_path}")
@@ -162,17 +162,9 @@ class MediaPlayer(Screen):
# Set the video source and start playback
self.video_player.source = file_path
self.video_player.state = 'play' # Start playing the video
self.video_player.opacity = 0 # Start with the video hidden
self.video_player.opacity = 1 # Ensure the video is fully visible
self.image_display.opacity = 0 # Hide the image display
# Wait for the video to start before applying the fade-in animation
def start_fade_in(*args):
fade_in = Animation(opacity=1, duration=1) # Fade in over 1 second
fade_in.start(self.video_player) # Start the fade-in animation
# Schedule the fade-in animation after a short delay
Clock.schedule_once(start_fade_in, 0.1)
# Schedule the next media after the video's duration
Clock.schedule_once(self.next_media, self.video_player.duration)