1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Fix wallpaper playing

This commit is contained in:
Elias Steurer 2021-09-10 11:36:47 +02:00
parent 40d8696e99
commit 2b7d6422bd
2 changed files with 16 additions and 12 deletions

View File

@ -1,21 +1,24 @@
import QtQuick 2.0
import QtMultimedia
import ScreenPlayWallpaper 1.0
VideoOutput {
id:root
id: root
MediaPlayer {
id: mediaPlayer
videoOutput: root
//volume: Wallpaper.volume
//source: Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute)
source: Qt.resolvedUrl("C:/Users/Eli/Videos/videoplayback.webm")
Component.onCompleted: mediaPlayer.play()
//loops: true
onErrorOccurred: function(error, errorString) {
if (MediaPlayer.NoError !== error) {
console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
root.fatalError()
}
// volume: Wallpaper.volume
source: Wallpaper.projectSourceFileAbsolute
Component.onCompleted: {
print("play", source)
mediaPlayer.play()
}
// loops: MediaPlayer.Infinite
onErrorOccurred: function (error, errorString) {
console.log("[qmlvideo] VideoItem.onError error " + error
+ " errorString " + errorString)
root.fatalError()
}
}
}

View File

@ -12,7 +12,8 @@ Rectangle {
function init() {
switch (Wallpaper.type) {
case InstalledType.VideoWallpaper:
loader.source = "qrc:/MultimediaView.qml";
loader.source = "qrc:/qml/MultimediaView.qml";
fadeIn();
break;
case InstalledType.HTMLWallpaper:
loader.setSource("qrc:/qml/WebView.qml", {