From 607b9129d8a5705719f6ff7cb7ae803e32bde5dd Mon Sep 17 00:00:00 2001 From: Popov72 Date: Mon, 17 Aug 2020 11:54:51 +0200 Subject: [PATCH] Fix changing the loop value (by calling `updateOptions`) for a sound already started did not work --- dist/preview release/what's new.md | 1 + src/Audio/sound.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dist/preview release/what's new.md b/dist/preview release/what's new.md index 3417b596763..ce1bc7e5300 100644 --- a/dist/preview release/what's new.md +++ b/dist/preview release/what's new.md @@ -284,6 +284,7 @@ - Fix docs Matrix.RotationYawPitchRoll and Matrix.RotationYawPitchRollToRef ([VSerain](https://github.com/VSerain)) - Fix issue in `GLTFLoader._updateBoneMatrices()` where bone rest position was not set. ([drigax](https://github.com/drigax)) - Fix the bounding box of instances that does not match the instance position / rotation / scaling ([Popov72](https://github.com/Popov72)) +- Fix changing the loop value (by calling `updateOptions`) for a sound already started did not work ([Popov72](https://github.com/Popov72)) ## Breaking changes - `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh)) diff --git a/src/Audio/sound.ts b/src/Audio/sound.ts index 05c1ca118fc..c7f98fe0773 100644 --- a/src/Audio/sound.ts +++ b/src/Audio/sound.ts @@ -469,10 +469,12 @@ export class Sound { if (this.isPlaying) { if (this._streaming && this._htmlAudioElement) { this._htmlAudioElement.playbackRate = this._playbackRate; + this._htmlAudioElement.loop = this.loop; } else { if (this._soundSource) { this._soundSource.playbackRate.value = this._playbackRate; + this._soundSource.loop = this.loop; } } }