Quellcode durchsuchen

Merge pull request #18664 from Mugen87/dev44

Audio: Ensure paused audios start from the right position.
Mr.doob vor 5 Jahren
Ursprung
Commit
5ac704317b
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  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 ) {
 		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.stop();
 			this.source.onended = null;
 			this.source.onended = null;