[vlc-commits] QML: mini-player and full-player mode selection

Adrien Maglo git at videolan.org
Tue Jul 16 16:01:20 CEST 2019


vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Mon Jun 17 18:57:21 2019 +0200| [5d477453d468f102ae78f24d56b2371fb3a7b3da] | committer: Jean-Baptiste Kempf

QML: mini-player and full-player mode selection

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/qml/MainInterface.qml | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt/qml/MainInterface.qml b/modules/gui/qt/qml/MainInterface.qml
index abe9de7c64..4fe998795a 100644
--- a/modules/gui/qt/qml/MainInterface.qml
+++ b/modules/gui/qt/qml/MainInterface.qml
@@ -124,23 +124,19 @@ Rectangle {
             focus: true
 
             Connections {
-                target: player
-                onPlayingStateChanged: {
-                    console.log("onPlayingStateChanged", state)
-                    if (state === PlayerController.PLAYING_STATE_STOPPED)
-                        loadCurrentHistoryView()
-                    else {
-                        console.log(player.hasVideoOutput, history.current.view !== "player")
-                        if (player.hasVideoOutput && history.current.view !== "player")
+                target: player.videoTracks
+
+                onDataChanged: {
+                    var nbVideoTracks = player.videoTracks.rowCount()
+
+                    if (nbVideoTracks > 0) {
+                        if (history.current.view !== "player")
                             history.push(["player"], History.Go)
                     }
-                }
-
-                onHasVideoOutputChanged: {
-                    console.log("before push player", player.hasVideoOutput)
-                    if (player.hasVideoOutput) {
-                        console.log("push player")
-                        history.push(["player"], History.Go)
+                    else {
+                        console.log("go previous", history.current.view)
+                        if (history.current.view === "player")
+                            history.previous(History.Go)
                     }
                 }
             }



More information about the vlc-commits mailing list