Page MenuHomePhorge

D147.1732550934.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D147.1732550934.diff

diff --git a/src/contents/ui/event-types/Video.qml b/src/contents/ui/event-types/Video.qml
--- a/src/contents/ui/event-types/Video.qml
+++ b/src/contents/ui/event-types/Video.qml
@@ -7,10 +7,9 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import QtMultimedia
import moe.kazv.mxc.kazv 0.0 as MK
-import QtMultimedia 5.15
-
import org.kde.kirigami 2.13 as Kirigami
import '.' as Types
@@ -25,9 +24,10 @@
property var videoUri: matrixSdk.mxcUriToHttp(mxcUri)
property var videoInfo: event.content.info || {}
- property var videoResolution: video.metaData.resolution
+ property var videoResolution: video.metaData.value(MediaMetaData.Resolution)
property var videoWidth: videoResolution && videoResolution.width || (videoInfo.w || 1)
property var videoHeight: videoResolution && videoResolution.height || (videoInfo.h || 1)
+ property var videoMaxHeight: compactMode ? Kirigami.Units.gridUnit * 5 : Infinity
property var thumbnailInfo: videoInfo.thumbnail_info || {}
property var thumbnailMxcUri: videoInfo.thumbnail_url
property var thumbnailUri: matrixSdk.mxcUriToHttp(thumbnailMxcUri)
@@ -53,12 +53,13 @@
source: videoUri
loops: MediaPlayer.Infinite
-
- Layout.minimumHeight: Kirigami.Units.gridUnit * 10
- Layout.minimumWidth: Kirigami.Units.gridUnit * 10
- Layout.maximumWidth: innerContentWidth
- Layout.preferredWidth: videoWidth
- Layout.preferredHeight: videoHeight / videoWidth * width
+ Layout.fillWidth: true
+ property double videoWidth: upper.thumbnailWidth || upper.videoWidth || video.implicitWidth || 1
+ property double videoHeight: upper.thumbnailHeight || upper.videoHeight || video.implicitHeight || 1
+ property double privHeight: Math.min(videoMaxHeight, videoHeight)
+ property double privWidth: privHeight / videoHeight * videoWidth
+ Layout.preferredWidth: privWidth
+ Layout.preferredHeight: width < privWidth ? privHeight / privWidth * width : privHeight
fillMode: VideoOutput.PreserveAspectFit
TapHandler {

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 8:08 AM (17 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40247
Default Alt Text
D147.1732550934.diff (2 KB)

Event Timeline