Skip to content

Commit

Permalink
Implement play_pause
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Oct 27, 2024
1 parent 037d311 commit 16fcae5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/mpris_event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,17 @@ impl MprisPlayerService {
// If `self.can_pause` is `false`, attempting to call this method should have no effect and
// raise an error.
async fn play_pause(&self) {
// ignore for now
// TODO: implement
match self.playback_status {
PlaybackStatus::Playing => {
self.pause().await;
}
PlaybackStatus::Paused => {
self.play().await;
},
PlaybackStatus::Stopped => {
warn!("Cannot play, playback is stopped");
}
}
}

// Stops playback.
Expand Down

0 comments on commit 16fcae5

Please sign in to comment.