Don't use playback rate for state detection

This commit is contained in:
Eduard Urbach 2018-04-20 13:55:49 +02:00
parent bd0182adf4
commit c11690763e

View File

@ -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()