Replace mediafiles

fixes #1590
This commit is contained in:
Nicolas Werner 2023-11-09 21:32:19 +01:00
parent 31aebb33ae
commit 0e0a93914e
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
8 changed files with 7 additions and 8 deletions

View file

@ -1,5 +0,0 @@
The below media files were obtained from https://github.com/matrix-org/matrix-react-sdk/tree/develop/res/media
callend.ogg
ringback.ogg
ring.ogg

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -7,8 +7,8 @@
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>
#include <memory>
#include <QAudioOutput>
#include <QGuiApplication> #include <QGuiApplication>
#include <QUrl> #include <QUrl>
@ -186,10 +186,13 @@ CallManager::CallManager(QObject *parent)
connect( connect(
&CallDevices::instance(), &CallDevices::devicesChanged, this, &CallManager::devicesChanged); &CallDevices::instance(), &CallDevices::devicesChanged, this, &CallManager::devicesChanged);
auto audioOutput = new QAudioOutput(&player_);
player_.setAudioOutput(audioOutput);
connect( connect(
&player_, &QMediaPlayer::mediaStatusChanged, this, [this](QMediaPlayer::MediaStatus status) { &player_, &QMediaPlayer::mediaStatusChanged, this, [this](QMediaPlayer::MediaStatus status) {
if (status == QMediaPlayer::LoadedMedia) nhlog::ui()->debug("WebRTC: ringtone status {}",
player_.play(); QMetaEnum::fromType<QMediaPlayer::MediaStatus>().valueToKey(status));
}); });
connect(&player_, connect(&player_,
@ -841,6 +844,7 @@ CallManager::retrieveTurnServer()
void void
CallManager::playRingtone(const QUrl &ringtone, bool repeat) CallManager::playRingtone(const QUrl &ringtone, bool repeat)
{ {
nhlog::ui()->debug("Trying to play ringtone {}", ringtone.toString().toStdString());
player_.setLoops(repeat ? QMediaPlayer::Infinite : 1); player_.setLoops(repeat ? QMediaPlayer::Infinite : 1);
player_.setSource(ringtone); player_.setSource(ringtone);
// player_.audioOutput()->setVolume(100); // player_.audioOutput()->setVolume(100);