Don't use playback rate for state detection
This commit is contained in:
parent
bd0182adf4
commit
c11690763e
@ -229,7 +229,7 @@ export default class AudioPlayer {
|
|||||||
|
|
||||||
// Add speed
|
// Add speed
|
||||||
addSpeed(speed: number) {
|
addSpeed(speed: number) {
|
||||||
if(!this.audioNode || this.audioNode.playbackRate.value === 0) {
|
if(!this.audioNode || this.audioContext.state === "suspended") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ export default class AudioPlayer {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.audioNode.playbackRate.value === 0) {
|
if(this.audioContext.state === "suspended") {
|
||||||
this.resume()
|
this.resume()
|
||||||
} else {
|
} else {
|
||||||
this.pause()
|
this.pause()
|
||||||
|
Loading…
Reference in New Issue
Block a user