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

Fix qt6 qml capture =>

This commit is contained in:
Elias Steurer 2021-09-10 12:45:54 +02:00
parent b0c36c4c67
commit b52f9fcfa8
3 changed files with 18 additions and 20 deletions

View File

@ -2,23 +2,22 @@ import QtQuick 2.0
import QtMultimedia
import ScreenPlayWallpaper 1.0
VideoOutput {
Video {
id: root
MediaPlayer {
id: mediaPlayer
videoOutput: root
// 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()
}
volume: Wallpaper.volume
source: Wallpaper.projectSourceFileAbsolute
Component.onCompleted: {
root.play()
}
onStopped: {
if (Wallpaper.loops)
root.play()
}
//loops: MediaPlayer.Infinite
// onErrorOccurred: function (error, errorString) {
// console.log("[qmlvideo] VideoItem.onError error " + error
// + " errorString " + errorString)
// root.fatalError()
// }
}

View File

@ -94,8 +94,7 @@ Rectangle {
if (oldType === InstalledType.VideoWallpaper)
return ;
imgCover.state = "showDefaultBackgroundImage";
loader.source = "qrc:/qml/WebView.qml";
loader.source = "qrc:/qml/MultimediaView.qml";
}
target: Wallpaper

View File

@ -41,7 +41,7 @@ Item {
anchors.fill: parent
url: "qrc:/index.html"
backgroundColor: "transparent"
onJavaScriptConsoleMessage: print(lineNumber, message)
onJavaScriptConsoleMessage:(lineNumber, message)=> print(lineNumber, message)
onLoadProgressChanged: {
if ((loadProgress === 100)) {
if (Wallpaper.type === InstalledType.VideoWallpaper)