From 47baa6f09ecb7f7c847a7506ad6eff83681cf1d2 Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Sat, 6 Sep 2025 15:00:50 -0700 Subject: [PATCH] fix: always show first frame of video; autoplay will always play (#1104) Co-authored-by: Sumith <109025648+sumithsudheer@users.noreply.github.com> --- src/tagstudio/qt/mixed/media_player.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tagstudio/qt/mixed/media_player.py b/src/tagstudio/qt/mixed/media_player.py index c891cd0a..44997c28 100644 --- a/src/tagstudio/qt/mixed/media_player.py +++ b/src/tagstudio/qt/mixed/media_player.py @@ -404,12 +404,12 @@ class MediaPlayer(QGraphicsView): if not self.is_paused: self.player.stop() self.player.setSource(QUrl.fromLocalFile(self.filepath)) - - if self.autoplay.isChecked(): - self.player.play() else: self.player.setSource(QUrl.fromLocalFile(self.filepath)) + if self.autoplay.isChecked(): + self.player.play() + def load_toggle_play_icon(self, playing: bool) -> None: icon = self.driver.rm.pause_icon if playing else self.driver.rm.play_icon self.play_pause.load(icon) @@ -454,6 +454,10 @@ class MediaPlayer(QGraphicsView): duration = self.format_time(self.player.duration()) self.position_label.setText(f"{current} / {duration}") + # Ensures first frame of non-autoplay videos are loaded + if not self.autoplay.isChecked(): + self.player.pause() + def _update_controls(self, size: QSize) -> None: self.scene().setSceneRect(0, 0, size.width(), size.height())