Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/tagstudio/qt/mixed/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ def play(self, filepath: Path) -> None:
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)
Expand Down Expand Up @@ -454,6 +454,10 @@ def media_status_changed(self, status: QMediaPlayer.MediaStatus) -> None:
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())

Expand Down