diff options
author | Loren Burkholder <computersemiexpert@outlook.com> | 2023-02-13 23:51:31 -0500 |
---|---|---|
committer | Loren Burkholder <computersemiexpert@outlook.com> | 2023-02-14 09:15:56 -0500 |
commit | 787febdca2a67835e4bd2a78354266a7c30afa56 (patch) | |
tree | 78c89e33ddaee7e1656a7f429565686a108a2e12 /src | |
parent | Translated using Weblate (Indonesian) (diff) | |
download | nheko-787febdca2a67835e4bd2a78354266a7c30afa56.tar.xz |
Pause video when switching rooms
Fixes #809
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/MxcMediaProxy.cpp | 7 |
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) |