summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/qt6/QtPlayer.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/avmedia/source/qt6/QtPlayer.cxx b/avmedia/source/qt6/QtPlayer.cxx
index 1ad675f37d5c..5f75394ff1a3 100644
--- a/avmedia/source/qt6/QtPlayer.cxx
+++ b/avmedia/source/qt6/QtPlayer.cxx
@@ -11,6 +11,7 @@
#include <QtCore/QUrl>
#include <QtMultimedia/QAudioOutput>
+#include <QtMultimedia/QMediaMetaData>
#include <QtMultimediaWidgets/QVideoWidget>
#include <QtWidgets/QLayout>
@@ -178,8 +179,16 @@ awt::Size SAL_CALL QtPlayer::getPreferredPlayerWindowSize()
{
osl::MutexGuard aGuard(m_aMutex);
- awt::Size aSize(0, 0);
- return aSize;
+ assert(m_xMediaPlayer);
+ const QMediaMetaData aMetaData = m_xMediaPlayer->metaData();
+ const QVariant aResolutionVariant = aMetaData.value(QMediaMetaData::Resolution);
+ if (aResolutionVariant.canConvert<QSize>())
+ {
+ const QSize aResolution = aResolutionVariant.value<QSize>();
+ return awt::Size(aResolution.width(), aResolution.height());
+ }
+
+ return awt::Size(0, 0);
}
uno::Reference<::media::XPlayerWindow>