From 5175c5cae414c36eaf6f691e0c3de04f468232db Mon Sep 17 00:00:00 2001 From: zackslash Date: Thu, 19 Oct 2023 20:03:31 +0100 Subject: [PATCH] Pause() check state prior to execution --- player/player.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/player/player.go b/player/player.go index 32945d4..d2aa2f1 100644 --- a/player/player.go +++ b/player/player.go @@ -406,6 +406,9 @@ func (p *Player) PlayPause() error { // Pause playback and update the player state func (p *Player) Pause() error { + if p.status.State != Playing { + return nil + } err := p.setPaused(true) if err == nil { p.prePausedState = p.status.State