From 0e0a93914e736604238e1dbfd226558f4fcadf92 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 9 Nov 2023 21:32:19 +0100 Subject: Replace mediafiles fixes #1590 --- src/voip/CallManager.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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 #include #include -#include +#include #include #include @@ -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().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); -- cgit 1.4.1