Explorar el Código

[Web] Fix issue when pausing an non-started sample

Adam Scott hace 8 meses
padre
commit
030e7d4e2d
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      platform/web/js/libs/library_godot_audio.js

+ 3 - 0
platform/web/js/libs/library_godot_audio.js

@@ -735,6 +735,9 @@ class SampleNode {
 	 * @returns {void}
 	 */
 	_pause() {
+		if (!this.isStarted) {
+			return;
+		}
 		this.isPaused = true;
 		this.pauseTime = (GodotAudio.ctx.currentTime - this._sourceStartTime) / this.getPlaybackRate();
 		this._source.stop();