diff --git a/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml b/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml index 3ee48e86..7c67032e 100644 --- a/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml +++ b/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml @@ -326,9 +326,6 @@ parts: - libdouble-conversion3 - libegl1 - libgbm1 - - libgstreamer-gl1.0-0 - - libgstreamer-plugins-base1.0-0 - - libgstreamer1.0-0 - libgudev-1.0-0 - libjsoncpp1 - libllvm12 diff --git a/src/app/utilsadapter.cpp b/src/app/utilsadapter.cpp index 7aba8d7a..a04cd842 100644 --- a/src/app/utilsadapter.cpp +++ b/src/app/utilsadapter.cpp @@ -759,3 +759,18 @@ UtilsAdapter::getOneline(const QString& input) output.truncate(index); return output; } + +QVariantMap +UtilsAdapter::getVideoPlayer(const QString& resource, const QString& bgColor) +{ + static const QString htmlVideo + = "
" + ""; + return { + {"isVideo", true}, + {"html", htmlVideo.arg(resource, bgColor)}, + }; +} diff --git a/src/app/utilsadapter.h b/src/app/utilsadapter.h index ee8101cb..e4a98c6a 100644 --- a/src/app/utilsadapter.h +++ b/src/app/utilsadapter.h @@ -143,6 +143,8 @@ public: Q_INVOKABLE QString getOneline(const QString& input); + Q_INVOKABLE QVariantMap getVideoPlayer(const QString& resource, const QString& bgColor); + Q_SIGNALS: void debugMessageReceived(const QString& message); void changeFontSize(); diff --git a/src/app/wizardview/components/WelcomePage.qml b/src/app/wizardview/components/WelcomePage.qml index 8da3a49e..82e27fa6 100644 --- a/src/app/wizardview/components/WelcomePage.qml +++ b/src/app/wizardview/components/WelcomePage.qml @@ -72,35 +72,55 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter width: Math.max(508, root.width - 100) - Rectangle { + Item { Layout.alignment: Qt.AlignCenter | Qt.AlignTop Layout.preferredWidth: JamiTheme.welcomeLogoWidth Layout.preferredHeight: JamiTheme.welcomeLogoHeight - MediaPlayer { - id: mediaPlayer - source: JamiTheme.darkTheme ? JamiResources.logo_dark_webm : JamiResources.logo_light_webm - videoOutput: videoOutput - loops: MediaPlayer.Infinite - } + Loader { + id: videoPlayer - VideoOutput { - id: videoOutput + property var mediaInfo: UtilsAdapter.getVideoPlayer(JamiTheme.darkTheme ? JamiResources.logo_dark_webm : JamiResources.logo_light_webm, JamiTheme.secondaryBackgroundColor) anchors.fill: parent + anchors.margins: 2 + sourceComponent: WITH_WEBENGINE? avMediaComp : basicPlayer + + Component { + id: avMediaComp + Loader { + Component.onCompleted: { + var qml = "qrc:/webengine/VideoPreview.qml" + setSource( qml, { isVideo: mediaInfo.isVideo, html:mediaInfo.html } ) + } + } + } + + Component { + id: basicPlayer + + Item { + // NOTE: Seems to crash on snap for whatever reason. For now use VideoPreview in priority + MediaPlayer { + id: mediaPlayer + source: JamiTheme.darkTheme ? JamiResources.logo_dark_webm : JamiResources.logo_light_webm + videoOutput: videoOutput + loops: MediaPlayer.Infinite + } + + VideoOutput { + id: videoOutput + anchors.fill: parent + } + + Component.onCompleted: { + mediaPlayer.play() + } + } + + } } - Component.onCompleted: { - mediaPlayer.play() - } - - Behavior on opacity { NumberAnimation { duration: 150 } } - - layer.enabled: opacity - layer.effect: FastBlur { - source: videoOutput - radius: (1. - opacity) * 100 - } }