Explorar o código

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

Adam Scott hai 8 meses
pai
achega
030e7d4e2d
Modificáronse 1 ficheiros con 3 adicións e 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}
 	 * @returns {void}
 	 */
 	 */
 	_pause() {
 	_pause() {
+		if (!this.isStarted) {
+			return;
+		}
 		this.isPaused = true;
 		this.isPaused = true;
 		this.pauseTime = (GodotAudio.ctx.currentTime - this._sourceStartTime) / this.getPlaybackRate();
 		this.pauseTime = (GodotAudio.ctx.currentTime - this._sourceStartTime) / this.getPlaybackRate();
 		this._source.stop();
 		this._source.stop();