summary refs log tree commit diff
path: root/src/voip/CallManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/voip/CallManager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/voip/CallManager.cpp b/src/voip/CallManager.cpp
index 46679e71..d31592bf 100644
--- a/src/voip/CallManager.cpp
+++ b/src/voip/CallManager.cpp
@@ -7,8 +7,8 @@
 #include <chrono>
 #include <cstdint>
 #include <cstdlib>
-#include <memory>
 
+#include <QAudioOutput>
 #include <QGuiApplication>
 #include <QUrl>
 
@@ -186,10 +186,13 @@ CallManager::CallManager(QObject *parent)
     connect(
       &CallDevices::instance(), &CallDevices::devicesChanged, this, &CallManager::devicesChanged);
 
+    auto audioOutput = new QAudioOutput(&player_);
+    player_.setAudioOutput(audioOutput);
+
     connect(
       &player_, &QMediaPlayer::mediaStatusChanged, this, [this](QMediaPlayer::MediaStatus status) {
-          if (status == QMediaPlayer::LoadedMedia)
-              player_.play();
+          nhlog::ui()->debug("WebRTC: ringtone status {}",
+                             QMetaEnum::fromType<QMediaPlayer::MediaStatus>().valueToKey(status));
       });
 
     connect(&player_,
@@ -841,6 +844,7 @@ CallManager::retrieveTurnServer()
 void
 CallManager::playRingtone(const QUrl &ringtone, bool repeat)
 {
+    nhlog::ui()->debug("Trying to play ringtone {}", ringtone.toString().toStdString());
     player_.setLoops(repeat ? QMediaPlayer::Infinite : 1);
     player_.setSource(ringtone);
     // player_.audioOutput()->setVolume(100);