Browse Source

Merge pull request #18664 from Mugen87/dev44

Audio: Ensure paused audios start from the right position.
Mr.doob 5 years ago
parent
commit
5ac704317b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/audio/Audio.js

+ 1 - 1
src/audio/Audio.js

@@ -142,7 +142,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 		if ( this.isPlaying === true ) {
 
-			this._pausedAt = ( this.context.currentTime - this._startedAt ) * this.playbackRate;
+			this._pausedAt = Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate;
 
 			this.source.stop();
 			this.source.onended = null;