[vlc-commits] qml: don't stop the player when leaving the Maxiplayer if the PIP is available

Pierre Lamot git at videolan.org
Mon Dec 7 12:31:57 UTC 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Oct 16 10:05:57 2020 +0200| [ef485e9b7ae7ab2aea118ea23e8d4b88b8234c9d] | committer: Pierre Lamot

qml: don't stop the player when leaving the Maxiplayer if the PIP is available

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef485e9b7ae7ab2aea118ea23e8d4b88b8234c9d
---

 modules/gui/qt/maininterface/main_interface.hpp  | 4 ++++
 modules/gui/qt/maininterface/qml/MainDisplay.qml | 1 +
 modules/gui/qt/player/qml/Player.qml             | 2 +-
 modules/gui/qt/player/qml/TopBar.qml             | 4 ++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/maininterface/main_interface.hpp b/modules/gui/qt/maininterface/main_interface.hpp
index 5a0d4e893d..289753b769 100644
--- a/modules/gui/qt/maininterface/main_interface.hpp
+++ b/modules/gui/qt/maininterface/main_interface.hpp
@@ -157,6 +157,7 @@ class MainInterface : public QVLCMW
     Q_PROPERTY(bool hasVLM READ hasVLM CONSTANT)
     Q_PROPERTY(bool clientSideDecoration READ useClientSideDecoration NOTIFY useClientSideDecorationChanged)
     Q_PROPERTY(bool hasToolbarMenu READ hasToolbarMenu NOTIFY hasToolbarMenuChanged)
+    Q_PROPERTY(bool canShowVideoPIP READ canShowVideoPIP CONSTANT)
 
 public:
     /* tors */
@@ -197,6 +198,8 @@ public:
     bool hasVLM() const;
     bool useClientSideDecoration() const;
     inline bool hasToolbarMenu() const { return m_hasToolbarMenu; }
+    inline bool canShowVideoPIP() const { return m_canShowVideoPIP; }
+    inline void setCanShowVideoPIP(bool canShowVideoPIP) { m_canShowVideoPIP = canShowVideoPIP; }
 
     bool hasEmbededVideo() const;
     VideoSurfaceProvider* getVideoSurfaceProvider() const;
@@ -266,6 +269,7 @@ protected:
     ColorSchemeModel*    m_colorScheme;
     bool                 m_clientSideDecoration = false;
     bool                 m_hasToolbarMenu = false;
+    bool                 m_canShowVideoPIP = false;
 
     /* States */
     bool                 playlistVisible;       ///< Is the playlist visible ?
diff --git a/modules/gui/qt/maininterface/qml/MainDisplay.qml b/modules/gui/qt/maininterface/qml/MainDisplay.qml
index 5756122c3e..273b6c78a1 100644
--- a/modules/gui/qt/maininterface/qml/MainDisplay.qml
+++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml
@@ -127,6 +127,7 @@ Widgets.NavigableFocusScope {
         }
     ]
 
+
     property var tabModel: ListModel {
         id: tabModelid
         Component.onCompleted: {
diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index c592393a09..912b7ab775 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -67,7 +67,7 @@ Widgets.NavigableFocusScope {
         if (rootPlayer.hasEmbededVideo && controlBarView.state === "visible") {
             toolbarAutoHide._setVisibleControlBar(false)
         } else {
-            if (player.hasVideoOutput) {
+            if (mainInterface.hasEmbededVideo && !mainInterface.canShowVideoPIP) {
                mainPlaylistController.stop()
             }
             history.previous()
diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml
index 1c685ec7e8..979a3e7f3e 100644
--- a/modules/gui/qt/player/qml/TopBar.qml
+++ b/modules/gui/qt/player/qml/TopBar.qml
@@ -102,8 +102,8 @@ Widgets.NavigableFocusScope{
                             text: i18n.qtr("Back")
                             color: VLCStyle.colors.playerFg
                             onClicked: {
-                                if (player.hasVideoOutput) {
-                                    mainPlaylistController.stop()
+                                if (mainInterface.hasEmbededVideo && !mainInterface.canShowVideoPIP) {
+                                   mainPlaylistController.stop()
                                 }
                                 history.previous()
                             }



More information about the vlc-commits mailing list