Skip to content

Commit

Permalink
Merge pull request #288 from networked-aframe/cleanup-audio
Browse files Browse the repository at this point in the history
properly cleanup audio element in networked-audio-source remove
  • Loading branch information
vincentfretin committed Jul 27, 2021
2 parents bd5256f + 51d08ba commit d18c7cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/networked-audio-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ AFRAME.registerComponent('networked-audio-source', {
if (this.stream) {
this.sound.disconnect();
}

if (this.audioEl) {
this.audioEl.pause();
this.audioEl.srcObject = null;
this.audioEl.load();
this.audioEl = null;
}
},

setupSound: function() {
Expand Down

0 comments on commit d18c7cf

Please sign in to comment.