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 <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);
|
||||||
|
|
Loading…
Reference in a new issue