Get order of participants' video elements


I’ve noticed that the order in which participants original joined is not preserved when a new user joins.

For example if the room owner is joined by one user, sometimes a third user who joins will not see the video order of
[owner] → [2nd user participant] → [3rd user]
but instead
[2nd user] → [owner] → [3rd user]
often appears.

It seems that the video streams are populated and added to the grid whenever they become available.
Is there any way to get this list of participants based on the order of their video elements?

Well, one solution is just a static query like:

let part_vids = document.querySelectorAll('span[id^=participant_].videocontainer');