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 <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);