summary refs log tree commit diff
path: root/resources/qml/delegates
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-01-08 01:23:55 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2024-01-08 01:23:55 +0100
commiteed23cdf1102a8099bd7f47bfe3fb44e19148a08 (patch)
tree1b7f6d43daee97d0a3871aa9062432946335b30e /resources/qml/delegates
parentSpeedup room switching by forcing a bigger initial item size (diff)
downloadnheko-eed23cdf1102a8099bd7f47bfe3fb44e19148a08.tar.xz
Fix lag when media messages are shown and fix media controls
Diffstat (limited to 'resources/qml/delegates')
-rw-r--r--resources/qml/delegates/PlayableMediaMessage.qml18
1 files changed, 10 insertions, 8 deletions
diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml

index 7c035922..e948df02 100644 --- a/resources/qml/delegates/PlayableMediaMessage.qml +++ b/resources/qml/delegates/PlayableMediaMessage.qml
@@ -24,23 +24,24 @@ Item { property int tempWidth: originalWidth < 1? 400: originalWidth implicitWidth: type == MtxEvent.VideoMessage ? Math.round(tempWidth*Math.min((timelineView.height/divisor)/(tempWidth*proportionalHeight), 1)) : 500 width: Math.min(parent?.width ?? implicitWidth, implicitWidth) - height: (type == MtxEvent.VideoMessage ? width*proportionalHeight : 80) + fileInfoLabel.height + height: (type == MtxEvent.VideoMessage ? width*proportionalHeight : mediaControls.height) + fileInfoLabel.height //implicitHeight: height property int metadataWidth - property bool fitsMetadata: (parent.width - fileInfoLabel.width) > metadataWidth+4 + property bool fitsMetadata: parent != null ? ((parent.width - fileInfoLabel.width) > metadataWidth+4) : false + + Component.onCompleted: mxcmedia.startDownload(true) MxcMedia { id: mxcmedia // TODO: Show error in overlay or so? roomm: room - // FIXME: This takes 500ms on my device, why and how can we avoid that? - audioOutput: AudioOutput { - muted: mediaControls.muted - volume: mediaControls.desiredVolume - } + eventId: content.eventId videoOutput: videoOutput + + muted: mediaControls.muted + volume: mediaControls.desiredVolume } Rectangle { @@ -56,6 +57,7 @@ Item { Image { anchors.fill: parent + visible: content.type == MtxEvent.VideoMessage source: content.thumbnailUrl ? thumbnailUrl.replace("mxc://", "image://MxcImage/") + "?scale" : "image://colorimage/:/icons/icons/ui/video-file.svg?" + palette.windowText asynchronous: true fillMode: Image.PreserveAspectFit @@ -85,7 +87,7 @@ Item { mediaState: mxcmedia.playbackState onPositionChanged: mxcmedia.position = position onPlayPauseActivated: mxcmedia.playbackState == MediaPlayer.PlayingState ? mxcmedia.pause() : mxcmedia.play() - onLoadActivated: mxcmedia.eventId = eventId + onLoadActivated: mxcmedia.startDownload() } }