Pause() check state prior to execution

This commit is contained in:
zackslash
2023-10-19 20:03:31 +01:00
parent e191bf0d9f
commit 5175c5cae4
+3
View File
@@ -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