From 1374fb36987b620a309a41c4aa63879bc3509ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Thu, 10 Mar 2022 12:54:17 +0100 Subject: [PATCH] don't call play/pause on osx to display the first frame (the video won't pause) --- src/domain/UBGraphicsMediaItemDelegate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index 4ab1a298..cea439ce 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -242,13 +242,15 @@ void UBGraphicsMediaItemDelegate::mediaStatusChanged(QMediaPlayer::MediaStatus s if (status == QMediaPlayer::LoadedMedia) mMediaControl->totalTimeChanged(delegated()->mediaDuration()); - // At the beginning of the video, play/pause to load and display the first frame + // At the beginning of the video, play/pause to load and display the first frame (not working on OSX) +#ifndef Q_OS_OSX if ((status == QMediaPlayer::LoadedMedia || status == QMediaPlayer::BufferedMedia) && delegated()->mediaPosition() == delegated()->initialPos() && !delegated()->isStopped()) { delegated()->play(); delegated()->pause(); } +#endif // At the end of the video, make sure the progress bar doesn't autohide if (status == QMediaPlayer::EndOfMedia)