Explorar o código

Audio: Fix setting of .isPlaying when stopping the audio source

Mugen87 %!s(int64=7) %!d(string=hai) anos
pai
achega
10d2d346ff
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/audio/Audio.js

+ 2 - 0
src/audio/Audio.js

@@ -119,6 +119,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
 		if ( this.isPlaying === true ) {
 		if ( this.isPlaying === true ) {
 
 
 			this.source.stop();
 			this.source.stop();
+			this.source.onended = null;
 			this.offset += ( this.context.currentTime - this.startTime ) * this.playbackRate;
 			this.offset += ( this.context.currentTime - this.startTime ) * this.playbackRate;
 			this.isPlaying = false;
 			this.isPlaying = false;
 
 
@@ -138,6 +139,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
 		}
 		}
 
 
 		this.source.stop();
 		this.source.stop();
+		this.source.onended = null;
 		this.offset = 0;
 		this.offset = 0;
 		this.isPlaying = false;
 		this.isPlaying = false;