Pause() check state prior to execution
This commit is contained in:
@@ -406,6 +406,9 @@ func (p *Player) PlayPause() error {
|
|||||||
|
|
||||||
// Pause playback and update the player state
|
// Pause playback and update the player state
|
||||||
func (p *Player) Pause() error {
|
func (p *Player) Pause() error {
|
||||||
|
if p.status.State != Playing {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
err := p.setPaused(true)
|
err := p.setPaused(true)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
p.prePausedState = p.status.State
|
p.prePausedState = p.status.State
|
||||||
|
|||||||
Reference in New Issue
Block a user