When using Vue.js, I maintain a list of all Participants in an array called participants
. Initially, when a Participant joins, they are added to this array. The v-for directive is then used to generate the container for the Participant's media. Once the container is ready, I use the ref attribute to locate it and call track.attach()
to add the Participant's tracks.
In case of removal, is there any specific advantage to using track.detach()
as opposed to simply removing the Participant from the participants
array, which would result in the HTML element containing the tracks being destroyed? Will this have any impact on events triggered or cause issues with disconnection?