浏览代码

Merge pull request #14591 from Mugen87/dev18

Audio: Fix setting of .isPlaying when stopping the audio source
Mr.doob 7 年之前
父节点
当前提交
2630a49436
共有 1 个文件被更改,包括 2 次插入0 次删除
  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 ) {
 
 			this.source.stop();
+			this.source.onended = null;
 			this.offset += ( this.context.currentTime - this.startTime ) * this.playbackRate;
 			this.isPlaying = false;
 
@@ -138,6 +139,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
 		}
 
 		this.source.stop();
+		this.source.onended = null;
 		this.offset = 0;
 		this.isPlaying = false;