aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Andreyev <aa13q@ya.ru>2023-03-25 19:29:03 +0300
committerFelix Queißner <felix@ib-queissner.de>2023-03-25 18:02:04 +0100
commita63178f48fe23b0de779ea1988e72e4b128fcb1a (patch)
tree2abae066ac5a7ececd6c348a94c8bf032052a322
parentb833a5d261727616b18cfc81f13b624b1316044f (diff)
Improve Qt 6 support
Add missing mediaplayer widget logic Contributes to: https://github.com/MasterQ32/kristall/pull/266
-rw-r--r--src/widgets/mediaplayer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/widgets/mediaplayer.cpp b/src/widgets/mediaplayer.cpp
index 41aa105..74551ca 100644
--- a/src/widgets/mediaplayer.cpp
+++ b/src/widgets/mediaplayer.cpp
@@ -10,6 +10,7 @@
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QMediaContent>
#else
+#include <QAudioOutput>
#include <QUrl>
#endif
@@ -90,7 +91,11 @@ void MediaPlayer::on_playpause_button_clicked()
this->player.pause();
}
#else
- // aa13q
+ if(this->player.playbackState() != QMediaPlayer::PlayingState) {
+ this->player.play();
+ } else {
+ this->player.pause();
+ }
#endif
}
@@ -99,7 +104,7 @@ void MediaPlayer::on_mute_button_clicked(bool checked)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
this->player.setMuted(checked);
#else
- // aa13q
+ this->player.audioOutput()->setMuted(checked);
#endif
}