summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineViewManager.cpp11
-rw-r--r--src/timeline/TimelineViewManager.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 7c81ca8f..353f7065 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -242,6 +242,17 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin
                 &TimelineViewManager::callStateChanged);
         connect(
           callManager_, &CallManager::newCallParty, this, &TimelineViewManager::callPartyChanged);
+        connect(callManager_,
+                &CallManager::newVideoCallState,
+                this,
+                &TimelineViewManager::videoCallChanged);
+}
+
+void
+TimelineViewManager::setVideoCallItem()
+{
+        WebRTCSession::instance().setVideoItem(
+          view->rootObject()->findChild<QQuickItem *>("videoCallItem"));
 }
 
 void
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 9a2a6467..1a2d4c4e 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -36,6 +36,7 @@ class TimelineViewManager : public QObject
         Q_PROPERTY(
           bool isNarrowView MEMBER isNarrowView_ READ isNarrowView NOTIFY narrowViewChanged)
         Q_PROPERTY(webrtc::State callState READ callState NOTIFY callStateChanged)
+        Q_PROPERTY(bool onVideoCall READ onVideoCall NOTIFY videoCallChanged)
         Q_PROPERTY(QString callPartyName READ callPartyName NOTIFY callPartyChanged)
         Q_PROPERTY(QString callPartyAvatarUrl READ callPartyAvatarUrl NOTIFY callPartyChanged)
         Q_PROPERTY(bool isMicMuted READ isMicMuted NOTIFY micMuteChanged)
@@ -55,6 +56,8 @@ public:
         Q_INVOKABLE bool isInitialSync() const { return isInitialSync_; }
         bool isNarrowView() const { return isNarrowView_; }
         webrtc::State callState() const { return WebRTCSession::instance().state(); }
+        bool onVideoCall() const { return WebRTCSession::instance().isVideo(); }
+        Q_INVOKABLE void setVideoCallItem();
         QString callPartyName() const { return callManager_->callPartyName(); }
         QString callPartyAvatarUrl() const { return callManager_->callPartyAvatarUrl(); }
         bool isMicMuted() const { return WebRTCSession::instance().isMicMuted(); }
@@ -89,6 +92,7 @@ signals:
         void showRoomList();
         void narrowViewChanged();
         void callStateChanged(webrtc::State);
+        void videoCallChanged();
         void callPartyChanged();
         void micMuteChanged();