Make playPause() also work when player is in stopped state

This commit is contained in:
Bart De Vries 2023-12-04 13:43:55 +01:00
parent 749eb17c56
commit 9483607a20
1 changed files with 4 additions and 3 deletions

View File

@ -442,10 +442,11 @@ void AudioManager::pause()
void AudioManager::playPause() void AudioManager::playPause()
{ {
if (playbackState() == KMediaSession::PlaybackState::PausedState) if (playbackState() == KMediaSession::PlaybackState::PlayingState) {
play();
else if (playbackState() == KMediaSession::PlaybackState::PlayingState)
pause(); pause();
} else {
play();
}
} }
void AudioManager::stop() void AudioManager::stop()