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
|
||||
addSpeed(speed: number) {
|
||||
if(!this.audioNode || this.audioNode.playbackRate.value === 0) {
|
||||
if(!this.audioNode || this.audioContext.state === "suspended") {
|
||||
return
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ export default class AudioPlayer {
|
||||
return
|
||||
}
|
||||
|
||||
if(this.audioNode.playbackRate.value === 0) {
|
||||
if(this.audioContext.state === "suspended") {
|
||||
this.resume()
|
||||
} else {
|
||||
this.pause()
|
||||
|
Loading…
Reference in New Issue
Block a user