mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 11:28:49 +03:00
parent
31aebb33ae
commit
0e0a93914e
8 changed files with 7 additions and 8 deletions
|
@ -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
|
BIN
resources/media/callend.mscz
Normal file
BIN
resources/media/callend.mscz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
resources/media/ringback.mscz
Normal file
BIN
resources/media/ringback.mscz
Normal file
Binary file not shown.
Binary file not shown.
BIN
resources/media/ringtone.mscz
Normal file
BIN
resources/media/ringtone.mscz
Normal file
Binary file not shown.
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue