summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2023-02-13 23:51:31 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2023-02-14 09:15:56 -0500
commit787febdca2a67835e4bd2a78354266a7c30afa56 (patch)
tree78c89e33ddaee7e1656a7f429565686a108a2e12 /src
parentTranslated using Weblate (Indonesian) (diff)
downloadnheko-787febdca2a67835e4bd2a78354266a7c30afa56.tar.xz
Pause video when switching rooms
Fixes #809
Diffstat (limited to 'src')
-rw-r--r--src/ui/MxcMediaProxy.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/MxcMediaProxy.cpp b/src/ui/MxcMediaProxy.cpp
index 46d7430f..da5a2231 100644
--- a/src/ui/MxcMediaProxy.cpp
+++ b/src/ui/MxcMediaProxy.cpp
@@ -21,10 +21,12 @@
 #include <QTemporaryFile>
 #endif
 
+#include "ChatPage.h"
 #include "EventAccessors.h"
 #include "Logging.h"
 #include "MatrixClient.h"
 #include "timeline/TimelineModel.h"
+#include "timeline/TimelineViewManager.h"
 
 MxcMediaProxy::MxcMediaProxy(QObject *parent)
   : QMediaPlayer(parent)
@@ -47,6 +49,11 @@ MxcMediaProxy::MxcMediaProxy(QObject *parent)
                 if (t == QMediaMetaData::Orientation)
                     emit orientationChanged();
             });
+
+    connect(ChatPage::instance()->timelineManager()->rooms(),
+            &RoomlistModel::currentRoomChanged,
+            this,
+            &MxcMediaProxy::pause);
 }
 void
 MxcMediaProxy::setVideoSurface(QAbstractVideoSurface *surface)