summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-11-09 21:32:19 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2023-11-09 21:32:19 +0100
commit0e0a93914e736604238e1dbfd226558f4fcadf92 (patch)
tree3eb92bc4ea96c4d2b6791ba9de814763821c5ab6 /src
parentFix macos builds with newer icu (diff)
downloadnheko-0e0a93914e736604238e1dbfd226558f4fcadf92.tar.xz
Replace mediafiles
fixes #1590
Diffstat (limited to 'src')
-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);