mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 19:58:54 +01:00
audio/internal/readerdriver: Skip operation on error (js)
This commit is contained in:
parent
737ccf18fb
commit
df40217427
@ -126,7 +126,22 @@ func (c *context) Resume() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *player) Play() {
|
||||||
|
if p.err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if p.state != playerPaused {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
p.state = playerPlay
|
||||||
|
p.appendBuffer(js.Undefined(), nil)
|
||||||
|
p.appendBuffer(js.Undefined(), nil)
|
||||||
|
}
|
||||||
|
|
||||||
func (p *player) Pause() {
|
func (p *player) Pause() {
|
||||||
|
if p.err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if p.state != playerPlay {
|
if p.state != playerPlay {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -232,20 +247,14 @@ func (p *player) appendBuffer(this js.Value, args []js.Value) interface{} {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *player) Play() {
|
|
||||||
if p.state != playerPaused {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
p.state = playerPlay
|
|
||||||
p.appendBuffer(js.Undefined(), nil)
|
|
||||||
p.appendBuffer(js.Undefined(), nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *player) IsPlaying() bool {
|
func (p *player) IsPlaying() bool {
|
||||||
return p.state == playerPlay
|
return p.state == playerPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *player) Reset() {
|
func (p *player) Reset() {
|
||||||
|
if p.err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if p.state == playerClosed {
|
if p.state == playerClosed {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user