From 5fba1df486cbe032d2f68369ee1dbcc662ddeb63 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 18 Dec 2021 12:40:25 +0100 Subject: [PATCH] Add Qt MM based wallpaper property changes --- ScreenPlayWallpaper/qml/MultimediaView.qml | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ScreenPlayWallpaper/qml/MultimediaView.qml b/ScreenPlayWallpaper/qml/MultimediaView.qml index 6b49bac3..341865fe 100644 --- a/ScreenPlayWallpaper/qml/MultimediaView.qml +++ b/ScreenPlayWallpaper/qml/MultimediaView.qml @@ -38,10 +38,35 @@ Item { VideoOutput { id: vo anchors.fill: parent + } AudioOutput { id: ao volume: Wallpaper.volume + muted: Wallpaper.muted + } + + Connections { + function onFillModeChanged(fillMode) { + if(fillMode === "stretch"){ + vo.fillMode = VideoOutput.Stretch + return + } + if(fillMode === "fill"){ + vo.fillMode = VideoOutput.PreserveAspectFit + return + } + if(fillMode === "contain" || fillMode === "cover" || fillMode === "scale-down"){ + vo.fillMode = VideoOutput.PreserveAspectCrop + } + } + + function onCurrentTimeChanged(currentTime) { + mediaPlayer.position = currentTime * mediaPlayer.duration + } + + + target: Wallpaper } }